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.

  1. Right click a finding or multiple selected findings and choose Suppress from the menu.

  2. Enter a reason for suppressing the finding and choose where the suppression will be stored.

    You can select one of the following Suppress 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.

  3. Click OK to complete the suppression.

Manually Suppressing Findings in Source Code

To define dotTEST suppressions directly in the C# and VB.NET source code:

  1. Determine the rule ID of the rule that you want to suppress. Rule IDs are listed in the Test Configurations.
  2. Open the source code in an editor.
  3. 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 COM (COM Guidelines) category:
    // parasoft-suppress COM
    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 COM.SCVA and COM.SRTMR:
    // parasoft-suppress COM.SCVA COM.SRTMR
  4. Enter the following comment at the line of code where you want to stop suppressing the violation:
    //parasoft-end-suppress <RULE_ID>

  5. Save the modified code.
    For example:

    private void eventMove(object o, EventArgs e)
    {
     Move(+1); // parasoft-suppress CS.PUO
    }

    The line "Move(+1)" will be ignored by CS.PUO.