CodeRush Code Issues overall list
Here is the list of code issues shipped in the latest official version of CodeRush Pro. All issues are categorized by their type. Read more…
Here is the list of code issues shipped in the latest official version of CodeRush Pro. All issues are categorized by their type. Read more…
CodeRush Code Issues technology (also known as Code Analysis) is essentially background static analyzer of the source code. The code is analyzed during code writing and/or reading without compiling or executing the program.
One of the most prominent uses of a static analyzer is for code defect detection. While you’re working in the source code, it will point out the code errors even before it’s compiled, and other specifics that can help improve the overall quality of the source code. This can help you improve your coding practices, and learn new language technics. Static-analysis techniques can also detect buffer overflows, security vulnerabilities, memory leaks, timing anomalies (such as race conditions, deadlocks), dead or unused source code segments, and other common programming mistakes.
Cause:
Destructors are invoked automatically, and used to destroy instances of classes. The developer has no control over when the destructor is called, because this is determined by the garbage collector. Redundant destructor is a an empty destructor without any code inside, that can be safely removed.
Cause:
This code issue shows a warning when the catch block is empty. Usually empty catch block is a bad idea, because you are silently swallowing an error condition and then continuing an execution of the program, or the program may simply fail for an unknown reason.
In general, when an exception occurs, it can be thrown up to the caller, or it can be caught in a catch block. When catching an exception, it is recommended to inform the user about the problem, or log it for a future review.
If you heavily use region directives in CSharp, Visual Basic, or C++, the following CodeRush features may help you to make it easier to work with them:
Auto Declare allows you to quickly declare a variable (field, local or parameter) based on its type. To apply Auto Declare, type the class name and press the Ctrl+A shortcut. The variable will be declared with an appropriate name, and an action hint will be shown:
The Move to Region (also known as Member Mover) CodeRush feature extends the Member drop down menu with a menu item that allows you to move the active member to a region according to your preference:
These CodeRush clipboard features allow you to take an identifier or a block of code, and put it into clipboard without selecting it in advance. Just place the editor text caret at the identifier or at the start or end of a code block and press the copy key (Ctrl+C or Ctrl+Insert) or the cut key (Ctrl+X or Shift+Delete). This makes it easy to use cut and copy operations to move, duplicate or delete contiguous blocks of code, like methods, properties, conditional statements, loops, try/catch/finally blocks, comments, etc without selecting it first.