Archive

Author Archive

Code Issues – Unused type parameter

February 14th, 2011 Comments off

Cause:

This code issue of a dead code type shows type parameters to a generic type, or method definitions that are not referenced within its scope, and can be removed. In a generic type or method definition, a type parameter is a placeholder for a specific type that a client specifies when they instantiate a variable of the generic type. Removing the unused type parameter may improve readability.

Read more…

CodeRush Code Issues types overview

February 14th, 2011 Comments off

There are different types of code issues that the Code Analysis technology provides. Each issue is highlighted with the appropriate color, and has its own icon, depending on its type. These types are:

  • Errors
  • Warnings
  • Hints
  • Dead Code
  • Duplicate Code
  • Code Smells

Read more…

CodeRush Code Issues overall list

February 11th, 2011 Comments off

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 overview

February 11th, 2011 Comments off

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.

Read more…

Code Issues – Redundant Destructor

February 10th, 2011 Comments off

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.

Read more…

Code Issues – Catch block is empty

February 10th, 2011 Comments off

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.

Read more…

DXCore Components – ContractProvider

February 8th, 2011 Comments off

The ContractProvider DXCore component is used to extend the available contracts list for the Add Contract code provider shipped with Refactor! Pro and CodeRush Xpress.

The control doesn’t exist on the Visual Studio toolbox by default. You have to manually add it by selecting the “Choose Items…” in the context menu of the Visual Studio toolbox:

Read more…

Code Providers – Add Contract

February 7th, 2011 Comments off

Add Contract code provider adds conditions (contracts or guard code) for a validation of the active method parameters. You can choose the preferred contract via the sub-menu of the Add Contract:

Refactor! Add Contract with sub-menu

Read more…