Reviewing code automatically

An automated code review is a development feature that applies a set of rules to a code base to validate compliance with best development practices and software engineering guidelines. Rules are grouped based on a particular aspect of quality (for example globalization) or severity (for example the Quick code review looks for serious problems only). The reviewed code base can be the workspace, a project, or an individual Java file.

You run a code review by clicking the Run icon in the Code Review view. The results of rule violations, called findings, are presented to the user as a list of findings with the full path name of the file and line number. Software architects and developers review the list of findings to determine how to refactor the code.

The code review feature automates the typical manual process of reviewing code, performed by a software developer or architect to review code. While the manual code review process can consist of time-consuming and subjective discussions, the automated code review is effective, quick, and consistent. The automated code review supplements the manual code review, but it does not replace it.

To perform an automated code review:

  1. Open the Code Review view.

  2. Select a code review to run.

  3. Define the scope of code review.

  4. Run the code review.

  5. Work with the code review findings.

Code reviews
A code review is a selection of categories and rules that focus on an aspect of software quality (such as globalization) or a software property (such as severity). For example the Quick code review is a selection of rules that all have the highest severity level, which is “problem.” Note that if you change one of the rules in this code review to have a different severity level, that rule will no longer appear in the Quick code review.

Rule categories
A rule category is a collection of code review rules that focus on a particular aspect of quality. You can enable or disable a rule category or individual rules in it, depending on your code review needs.

Opening the Code Review view
The Code Review view is the starting point for all code review tasks. You can initiate all code review tasks from the Code Review view.

Selecting a code review
A code review is a selection of categories and rules that focus on an aspect of software quality (such as globalization) or a software property (such as severity). When you review a code base, you can select a supplied code review to run on your code base.

Running a code review
Running code review lets you analyze your code by applying a specified set of rules to a code base. The rules can be applied to one project, a single source file, or the entire workspace, depending on the nature of the rule. Optionally, you can configure the code review (for details, see "Configuring code review") to only show a specific set of findings. After you decide the scope of the review, you run the code review by clicking the Review icon,

. You can run a code review from the Code Review view itself or from the pop-up menu of the Package Explorer view or Java Navigator view.

Fixing a problem found in code review
A code review produces findings that you may or may not consider problems. If you decide that a finding is a problem that you want to address, the source code editor and Code Review Details view help you fix it.

Configuring code review
An automated code review is a development feature that applies a set of rules to a code base to validate compliance with best development practices and software engineering guidelines. To get the maximum value from code review, development leads can review all the rules in the Complete code review and configure the code review by enabling and categorizing only the rules important for the team.

Reference
This section contains topics that describe code review user interface elements and supplied code reviews.