Excluding packages and classes from the Complete code review
Based on knowledge about an existing code base, a development lead might decide to exclude portions of code from a code review. This usually applies to code that is not directly owned, and therefore cannot be modified, by the development team.
To exclude portions of code from a code review:
- Click Window > Show View > Other, expand Java, select Code Review, and click OK to open the Code Review view.
- Click Window > Preferences. The Preferences window opens, showing the Code Review page. Note: After you run a J2EE Best Practices code review that applies at least one deep rule, JAR files are listed on the Excluded page by default. Deep J2EE rules not only produce findings, but also show the paths that lead to the findings
- In the left pane, expand Java > Code Review, then select Excluded.
- On the Excluded page, click Add. The Configure properties window opens.
- Click Browse. The Select resource window appears. Browse to the package or class to exclude from the view and select it. Click OK. Depending on what you want to exclude, do one of the following:
- To exclude a package or class from a code review, select it and then click OK.
- To exclude a servlet from being reviewed by deep J2EE rules, select the servlet’s .java or .class file and then click OK.
- To exclude a JAR file from being reviewed by deep J2EE rules, select the JAR file and then click OK.
Note: The deep J2EE rules require data flow analysis, the method that traces the paths to a finding. These rules recognize two file types to exclude, a fully qualified servlet or JAR file, and ignore all others.
- Repeat steps 4 and 5 until all the packages or classes to exclude are added to the list on the Excluded page, and then click OK to close the Preferences window. When a user runs the Complete code review, the resources in the list will not be reviewed.
To include a portion of code that is currently excluded from a code review, select the resource on the Excluded page and click Remove.
Parent topic
Configuring code review