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 violation or multiple selected violations and choose Suppress from the menu.

  2. Enter a reason for suppressing the violation and choose a suppression type when prompted.

  3. Click OK to complete the suppression.

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.

     

 

 

  • No labels