Problem detection (code review)

Code review problem list

Project Analyzer does an automated code review to detect programming problems and to suggest improvements. This feature is useful for optimization, quality control and automated coding standards enforcement.

Code review rules
Comment directives
Problem options
Problem reports

Problem types

  1. Optimization. Unoptimal programming: slow performance, high memory consumption and dead code. Enhance the run-time speed and lower the memory requirements by fixing these problems.
  2. Style. Source code style issues and suggestions. These problems are visible to programmers, not the end users. Developing with bad style doesn't necessarily cause errors right away, but inconsistent style often leads to lower understandability and the introduction of new errors during maintenance or further development.
    Metrics is a sub-category of Style. You can set target values for different metrics and monitor if some part of your program exceeds the limits. Read more about metrics. The Enterprise Edition is required to view metrics problems.
  3. Logic. Oddities in the control and data flows of your program: questionable coding, erratic behavior, hidden flaws and problems that are waiting to emerge later. These problems can cause your program to fail or to produce bad results, or they can represent optimization opportunities. Take time to carefully examine any found logic problems.
  4. Functionality. Issues affecting run-time behavior and the user interface. These are the problems that end users are most likely to complain about.
  5. VB.NET compatibility. These problems show incompatibilities between VB6 and VB.NET syntax. The Enterprise Edition is required to view compatibility issues.
  6. Internal. This is a rare problem type that appears if Project Analyzer has found something in the analysis that it cannot handle. Right-click the problem to view a suggested solution.

View the code review rules to read details about the problems. You can also right-click a problem to read what it is about.

Severity levels

Severe problem. These problems make your program much worse. Sometimes you need to fix severe problems first to really tackle the other problems.

Warning. These problems should be fixed, but they are not critical. Fixing these problems will make your program better in some way.

Information. These are the least severe problems. Fixing these problems will make your code better, but the effect may not be visible to the users in the short run.

Internal. This rare severity class appears if the analysis is limited by a known issue that Project Analyzer cannot handle. Right-click the problem to view a suggested solution.

Code review rules

How do I see the problems?

How do I fix the problems?

Get a Problem report, and fix your code. Auto-fix can automatically repair a part of the problems, remove dead code and add a comment about those problems that cannot be fixed automatically.

Why isn't this code shown as a problem?

Sometimes you may notice that Project Analyzer doesn't indicate a problem even if the code looks problematic. There are a few explanations to this.

  1. Project Analyzer detected a reason why you should accept problematic code. For example, you cannot safely remove a piece of seemingly dead code because it may be called implicitly. Or, there's no sense in writing an error handler for an empty procedure.
  2. The code was generated by Visual Studio and you shouldn't change it manually.
  3. A comment directive is in effect.

Read more

Code review rules
Comment directives
Problem options
Problem reports

©Aivosto Oy - Project Analyzer Help Contents