Analyzing Project Results

Once a project is defined, to analyze the project , select Project -> Run... from the main menu. You will see a progress bar at the bottom of the screen. As the analysis progresses, the views display the result of analysis. Most views are updated while analysis progresses, while the views - Metrics and Project Summary are updated upon completion of analysis.

Source

Source tab displays a tree of packages and files present in the project. As code analysis is performed it also displays the count of violations found for that file next to individual files names. It also displays the total number of violations next to package name, which is total of violations found in all the files belonging to given package.

This tab also lists the names of the authors collected while analysing the file. Author names are read from the Java docs's @author tag appearing with the classes. When an author is selected, the list of his/ her files along with violations is listed in the Developers view.

The subtotals of violations appearing along with package names or developer names provides a quick overall summary of code analysis.

Rules

The Rules tab has three layers of nodes: The first two nodes are Severity or Category as you have specified in Tools -> Options... Java Code Test. The third level contains the rules. As code analysis is performed it also displays number of violations found for individual rules, categories and severities.

The subtotals of violations appearing along with category or severity provides a quick overall summary of result of analysis.

You may also move rules between categories or severities. Projects->RulesManager allows you to select severity and category for rules.

Violations

It lists the violations corresponding to the item currently selected in either source tab or rules tab i.e. when a Java file is selected in source tab, this view lists all the violations that were found in that Java file. It also displays the line number at which those violations were observed. If a line number is clicked, it opens the file in eclipse editor with given line number highlighted.

The pop-up menu contains options to auto fix or Suppress violations.

Auto-fix is the feature where AppPerfect CodeTest alters the source code to fix the violation.

Suppress violations feature enables you to ignore specific violations. This allows you to ignore given instances of violations while still considering other violation of the same rule. You may need to suppress a violation if you find given coding style being used purposefully in certain cases. When a violation is suppressed AppPerfect CodeTest inserts specific comment in the source code where the violation occurred. Violations which are suppressed may also be unsuppressed later, so that they start appearing back in the violations view. Please note that the violations which you suppress are moved to suppressed violations view only after next analysis.

You may sort the data by a column value by clicking the column title.

An icon in orange color is displayed along with the violations which are auto fixable, blue icons represent the rules which are configurable.

Suppressed Violations

This view lists the violations which have been suppressed. It lists the suppressed violations corresponding to the item selected in the source tree or rules tree.

The view's pop-up menu contains options to un suppress violations. Once unsuppressed the violations start appearing back in the violations view.

It contains a line number column like violations view. Clicking any line number opens the file in eclipse editor with give line number highlighted.

You may sort the data by a column value by clicking the column title.

Auto Fixable Violations

This view is a sub-set of violations view. It lists only those rules which may be fixed automatically by AppPerfect CodeTest. The view's pop-up menu contains options to auto fix violations. It lists the suppressed violations corresponding to the item selected in the source tree or rules tree.

It contains a line number column like violations view. Clicking any line number opens the file in eclipse editor with give line number highlighted.

You may sort the data by a column value by clicking the column title.

Auto Fixes

This view lists the summary of auotomatically fixed violations. A violation may be auto fixed using pop-up in the Violations view / Auto fixable Violations View. A violation may also be auto fixed during analysis. This view lists original code that violated the rule and the code as modified by AppPerfect CodeAnalzyer. This view shows the auto fixed violations corresponding to the item currently selected in source tab or rules tab.

This view contains pop-up option for reverting auto fix. AppPerfect CodeTest backups the original file before performing auto fix, when reverted an auto fix AppPerfect CodeTest restores the file back. Please note that you may only revert the latest set of auto fixes on a file. If you auto fix certain violations of a file during analysis, they may all be reverted back at once. But if you auto fix a violation from violations view, you may only revert that particular violation and not the earlier auto fixed violations. This is because the previously backed up file gets overwritten.

Metrics

It shows the statistics collected during analysis. It shows the following metrics.

Project Summary

This view has two tabs - Severity-wise Violations and Category-wise Violations. The Pie chart quickly gives you a clear picture of distribution of violations across Categories and Severities.

You may sort the data in the table by any column value by clicking the column title.

Problems

Problems view provide information if the syntax errors are detected in your code. This report has the File Name column corresponding to it the Line Number and related Error Description can be seen. This report is helpful as it gives list of the errors to help the developer correct them easily. Whether all the syntax errors are listed or only the first syntax error in the file is listed depends on whether you have chosen to continue or abort analysis after syntax error is found. These options can be set through Tools->Options->CodeTest->On Syntax Error.

If you get syntax errors on jdk 1.5 constructs, please make sure that jdk 1.5 or higher is selected for the project. This can be checked at Project->Preferences->Java Settings.

Developers

This view displays the violations count of the files belonging to the author currently selected in the source tab.

Console

This view displays the status/progress messages logged by AppPerfect CodeTest during analysis. It displays the start and end time of the analysis.


Showing / Hiding Columns

Most view allow you to choose the show/hide the columns. When right click the popup lists the column.

Exporting Results

Once code analysis has run on your project and different views are visible as explained above, you may export this view into multiple formats using Export view to.