Archive

Archive for the ‘Code Analysis’ Category

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…

Code Issues – Try statement without catch or finally

January 24th, 2011 Comments off

Cause:

This code issue shows an error if a ‘try’ statement doesn’t have a ‘catch’ or ‘finally’ statement. The try block must be completed, whether with catch or finally blocks.

The try block contains the guarded code that may cause the exception. The block is executed until an exception is thrown or it is completed successfully.

Read more…

Code Issues – Static constructors must be parameterless

January 24th, 2011 Comments off

Cause:

A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only. Parameters are not allowed for static constructors.

Read more…

Code Issues – Interface expected

January 23rd, 2011 Comments off

This code issue shows an error when the structure is derived from a non-interface type. Structures can only inherit from other interfaces according to various language specifications.

Read more…