Archive

Archive for the ‘Code Analysis’ Category

Code Issues – Member can be static

October 18th, 2012 Comments off

Cause:

Static members are part of a type and non-static members are part of an instance of that type. If you want to have a shared state or a function between different instances of the same type, a static member will be helpful. This code issue informs you about an instance member that can be converted into a static member.

Read more…

Code Issues – Undeclared element

October 18th, 2012 Comments off

Cause:

Highlights identifier references to local variables, fields, method, properties, classes, structures, interfaces and everything that is not yet declared.

Read more…

Code Issues – Format item index too large

October 18th, 2012 Comments off

Cause:

In the String.Format call you can specify any number of arguments and the corresponding format items, where those argument values will be inlined. When the corresponding argument in the call is absent, the FormatException will be thrown (Index (zero based) must be greater than or equal to zero and less than the size of the argument list). The compiler does not validate the format items, so this may lead to errors in your application. This code issue allows you to avoid such errors by highlighting format items with an incorrect index.

Read more…

Code Issues – Control cannot leave the body of a finally clause

October 18th, 2012 Comments off

Cause:

Returns are forbidden in finally clauses by the compiler. A compiler error will occur in case of a return statement inside a finally block, and refuse to let you write such potentially ambiguous and confusing code. The purpose of a finally statement is to ensure that the necessary cleanup of objects happens immediately and always. In other words, it is designed for releasing all locks and resources and cannot leave the block until finishing the cleanup task.

Read more…

Code Issues of the dead code type for members and blocks

October 18th, 2012 Comments off

Here are several of the code issues, which highlight redundant and unnecessary code blocks that may be safely removed for improving code readability.

Read more…

Code Issues hints for declaration and initialization

October 12th, 2012 Comments off

Here are a few simple code issues of a hint type (suggestion) for declarations and initializations.

Read more…

Code Issues hints for expressions

September 28th, 2012 Comments off

Here are the code issues for different expressions. If the fix is applied, following a hint it may optimize the code and/or improve its readability.

Read more…

Code Issues hints for types and members

September 28th, 2012 Comments off

Here are the suggestions (hints) code issues which might improve the readability, clarity and performance of your source code.

Read more…