...
You can prevent dotTEST from reporting specific static analysis findings by defining suppressions. Suppressions are useful when you generally follow a rule, but decide to ignore specific occurrences of the reported finding. If you do not want to receive findings for any violations of a specific rule, disable the rule in the test configuration.
Suppression schemes can be defined in source code or in a suppression file.
Defining Suppressions in Source Code
...
- It is a good practice to specify the reason for suppression.
- The
line
attribute should be used with caution as it may invalidate the suppression if the code is moved to another line when the source file is modified.
Defining Line Suppressions Based on Regex Patterns
You can configure C/C++test to automatically suppress static rule violations that are detected on lines that match a regular expression pattern. This may be useful when you want to suppress tasks that are difficult to suppress using the in-line or in-code suppressions, such as Qt macros.
You can specify the regex patterns by the configuring the following options in your .properties file or in the command line (see Configuration Overview):
...
- .
...
Static rule violations that occur on lines that match the configured regex pattern(s) will be suppressed. For example, the following configuration will suppresses all findings detected on code lines that contain "Q_" anywhere on the line:
...
Scroll Pagebreak |
---|