In this section:
Suppressing Findings in the IDE
You can suppress individual instances of findings, all instances of a finding type in a file, or all findings in the file from the Findings view.
Right-click on a single finding or a group of selected findings and choose Suppress from the menu.
Enter a reason for suppressing the finding and choose where the suppression will be stored.
You can select one of the following storage options:
- the finding locally on desktop - The suppressions will be stored in your workspace or solution and used only during local analysis runs. If you select this option, it will suppress all occurrences of the selected finding in the file (the number of occurrences will be displayed in the dialog box).You can configure the custom location for storing local suppression with the suppression.local.dir option; see Automation User Guide for details.
- in Development Testing Platform- The suppressions will be stored in Development Testing Platform and shared with the team.
- in source code - The findings will be suppressed in code and shared across the team when checked in your source control system.
You can review suppressed findings and unsuppress the findings that have been saved locally on desktop.
Click Parasoft in the menu bar, choose Preferences (Eclipse), Options (NetBeans) or Settings (IntelliJ),select Import Findings and Coverage and enable the Suppressed findings from local analysis or file option (see Customizing Import Options for details).
Open the DTP Findings view, choose Configure Contents from the menu and enable the Suppressed findings option (see Customizing the Findings View for details).
- Run analysis or import findings (see Importing Findings). The suppressed findings will be displayed in the DTP Findings view.
- You can right-click a finding and choose the Go To option to view the code that triggered the finding.
- Unsuppress findings if necessary. Suppressions that are saved in the code need to be unsuppressed manually in the code. Suppressions stored in DTP can be unsuppressed in DTP. To unsupress locally suppressed findings, right-click on a finding or a group of selected findings and choose Unsuppress locally... from the menu:
Manually Suppressing Findings in Source Code
To suppress the reporting of findings from a specific rule or rule category:
- Determine the rule ID of the rule that you want to suppress. Rule IDs are listed in the Test Configurations.
- Open the source code in an editor.
Enter a comment (in the following format) at the line of code where you want to start the suppressing the violation:
// parasoft-begin-suppress <RULE_ID>
To suppress all violations in a category, list only the category part of the Rule ID. For example, use the following comment to suppress all rules in the OOP (Object Oriented Programming) category:
// parasoft-suppress OOP
To suppress violations of two or more rules, list both Rule IDs, separated by one or more space characters. For example, use the following comment to suppress the rules OOP.AF and OOP.OPM:
// parasoft-suppress OOP.AF OOP.OPM
For complete documentation on the
parasoft-suppresscommand, see “parasoft-suppress Command Details” section below.
Enter the following comment at the line of code where you want to stop suppressing the violation:
- Save the modified code.
In-line (in-code) suppressions will not be listed in the Suppressions view. Suppressions local to the workspace or shared by Team Server are listed in that view; in-line suppressions are listed along with the source code text.
If you want a suppression to continue through an entire file, you do not need to add a parasoft-end-suppress comment.
parasoft-suppress Command Details
Single Line Suppressions