Tracking in-line suppression comments
How to track the use of in-line suppression comments in the code in SonarQube Server 2026.4.
Note: For C, C++, and Objective-C, we recommend using
sonar-resolveto resolve issues directly in the code rather than suppressing them with//NOSONAR. See Resolving issues in the code for more information.
Issue suppression on a specific line is possible in most languages by using the //NOSONAR comment or a comparable in-line suppression mechanism suited to the language.
To track the use of in-line suppression comments:
For C, C++, Objective-C, PHP, T-SQL:
Use the rule
NoSonarto track the use of theNOSONARcomment.
For COBOL, PL/SQL:
Use the rule
NoSonarCheckto track the use of theNOSONARcomment.
For JavaScript, TypeScript:
Use the rule S1291 to track the use of the
NOSONARcomment.
For Java:
Use the rule S1309 to track the use of the
@SuppressWarningsannotation.
For Python:
Use the rule S1291 to track the use of the
NOSONARcomment.Use the rule S1309 to track the use of the
noqacomment.Use the rule S7632 to detect malformed
NOSONARandnoqacomments.
For more information about the in-line suppression of issues for a given language, refer to the corresponding section in Languages .
Last updated
Was this helpful?

