Problem detection (code review)
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
- 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.
- 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.
- 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.
- Functionality. Issues affecting run-time behavior and the user interface. These are the problems that end users are most likely to complain about.
- VB.NET compatibility. These problems show incompatibilities between VB6 and VB.NET syntax. The Enterprise Edition is required to view compatibility issues.
- 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.
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?
- Problem list is located at the bottom of the main window.
- Problem reports create listings of the problems found. See the Report menu.
- Project Printer is a document generator that can list problems next to the problematic code.
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.
- 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.
- The code was generated by Visual Studio and you shouldn't change it manually.
- A comment directive is in effect.
Code review rules
©Aivosto Oy - Project Analyzer Help Contents