In this section:
Table of Contents | ||
---|---|---|
|
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.
Conditional Content product: (cpptest, jtest) product: (cpptest, jtest) sv-attr:0A01020401598D973E6641760F8AF4E5 0A01020401598D973E6749C5267CE6FE 0A01020401598D973E671AAA268425A3 Enter a reason for suppressing the finding and choose where the suppression will be stored.
You can select one of the following storage options:
- 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 Configuration in Automation User Guide for details.
- On Development Testing Platform - The suppressions will be stored in Development Testing Platform and shared with the team. You can suppress only findings that are already registered on DTP.
- In source code - The findings will be suppressed in code and shared across the team when checked in your source control system.
Conditional Content product: (cpptest, jtest) product: (cpptest, jtest) sv-attr:0A01020401598D973E6641760F8AF4E5 0A01020401598D973E6749C5267CE6FE 0A01020401598D973E671AAA268425A3 - Click OK to complete the suppression.
Reviewing Suppressions
You can review suppressed findings and unsuppress the findings that have been saved locally on desktop.
Click Parasoft in the menu bar, choose
Conditional Content product: (jtest) product: (jtest) sv-attr:0A01020401598D973E6641760F8AF4E5 0A01020401598D973E671AAA268425A3 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 指摘事項ビューのカスタマイズ for details).
- Run analysis or import findings (see 指摘事項のインポート). 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
Conditional Content | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
To suppress the reporting of findings from a specific rule or rule category:
Example 1:
Example 2:
parasoft-suppress Command DetailsSingle Line SuppressionsCommand
Examples
|
Code Block |
---|
<begin suppression keyword> [<rule category> | <rule category> . <rule id> | <rule category > - <rule severity> | ALL ] <suppression comment> ..... java code ..... <end suppression keyword> [<rule category> | <rule category> . <rule id> | <rule category > - <rule severity> | ALL ] <suppression comment> |
Examples
Code Block |
---|
// parasoft-begin-suppress CODSTA "begin suppress all rules in category CODSTA" ..... // parasoft-end-suppress CODSTA "end suppress all rules in category CODSTA" // parasoft-begin-suppress CODSTA.NEA "begin suppress rule CODSTA.NEA" ..... // parasoft-end-suppress CODSTA.NEA "end suppress rule CODSTA.NEA" // parasoft-begin-suppress CODSTA-1 "begin suppress all rules in category CODSTA with severity level 1" ...... // parasoft-end-suppress CODSTA-1 "end suppress all rules in category CODSTA with severity level 1" //parasoft-begin-suppress ALL "begin suppress all rules" ....... // parasoft-end-suppress ALL "end suppress all rules" // parasoft-begin-suppress CODSTA FORMAT.MCH "begin suppress all rules in category CODSTA and rule FORMAT.MCH" ..... // parasoft-end-suppress CODSTA FORMAT.MCH "end suppress all rules in category CODSTA and rule FORMAT.MCH" // parasoft-begin-suppress CODSTA "begin suppress all rules in category CODSTA" ...... // parasoft-end-suppress CODSTA-1 "end suppress all rules in category CODSTA with severity level 1; however rules with severity level 2-5 in category CODSTA are still suppressed." ...... // parasoft-end-suppress CODSTA "end suppress all rules in category CODSTA" // parasoft-begin-suppress ALL "begin suppress all rules" ...... // parasoft-end-suppress CODSTA FORMAT-1 "end suppress all rules in category CODSTA and all rules in category FORMAT with severity level 1; however, others rules in CODSTA and FORMAT-1 are still suppressed."....... // parasoft-end-suppress ALL "end suppress all rules" //parasoft-begin-suppress ALL "begin suppress all rules, since no end suppression comment, all rules will be suppressed start from this line" ........ |