# How to Restrict the Use of NOSONAR and @SuppressWarnings in SonarQube 9.9.2 Community Edition

**URL:** <https://community.sonarsource.com/t/how-to-restrict-the-use-of-nosonar-and-suppresswarnings-in-sonarqube-9-9-2-community-edition/119764>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube\
**Created:** [July 26, 2024, 11:08am UTC](https://community.sonarsource.com/t/how-to-restrict-the-use-of-nosonar-and-suppresswarnings-in-sonarqube-9-9-2-community-edition/119764 "2024-07-26T11:08:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayakumari](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jayakumari/32/49610_2.png) [@jayakumari](https://community.sonarsource.com/u/jayakumari)\
**Post date:** [July 26, 2024, 11:08am UTC](https://community.sonarsource.com/t/how-to-restrict-the-use-of-nosonar-and-suppresswarnings-in-sonarqube-9-9-2-community-edition/119764/1 "2024-07-26T11:08:11Z")

</div>

I’m currently using SonarQube 9.9.2 Community Edition for our code quality management. I’ve noticed that many developers in our team are using `NOSONAR` comments and `@SuppressWarnings` annotations to suppress validations in various languages such as Java, HTML, JavaScript, XML, etc.

While these annotations can be useful in specific scenarios, they are often overused, potentially hiding critical issues that should be addressed. I would like to restrict the use of `NOSONAR` and `@SuppressWarnings` to ensure that all code quality issues are properly addressed rather than suppressed. How to detect and flag the use of `NOSONAR` and `@SuppressWarnings` in different languages?  
Any help or suggestions on managing this in SonarQube Community Edition would be greatly appreciated!

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![anon67236913](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@anon67236913](https://community.sonarsource.com/u/anon67236913)\
**Post date:** [July 29, 2024, 6:01am UTC](https://community.sonarsource.com/t/how-to-restrict-the-use-of-nosonar-and-suppresswarnings-in-sonarqube-9-9-2-community-edition/119764/2 "2024-07-29T06:01:04Z")

</div>

Hi,

here’s the solution for Java

> [@Disable NOSONAR comment](https://community.sonarsource.com/t/disable-nosonar-comment/78942/4):
>
> In fact, as Sonarqube admin you need to activate two rules. java:NoSonar ‘Track uses of “NOSONAR” comments’ to prevent the use of //NOSONAR for hiding issues call https://$yoursonarhost/coding\_rules?open=java%3ANoSonar&rule\_key=java%3ANoSonar for activation java:S1309 ‘Track uses of “@SuppressWarnings” annotations’ with an appropriate whitelist to prevent some clever developers using @SuppressWarnings("all") in all their classes see documentation =\> [Java](https://docs.sonarqube.org/latest/analyzing-source-code/languages/java/#turning-issues-off) call https:/…

See for which languages a `Track uses of "NOSONAR" comments` rule is available  
`https://<yoursonarhost>/coding_rules?q=nosonar`

Gilbert

---

<div class="post-metadata">

**Author:** ![jayakumari](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jayakumari/32/49610_2.png) [@jayakumari](https://community.sonarsource.com/u/jayakumari)\
**Post date:** [August 5, 2024, 12:15pm UTC](https://community.sonarsource.com/t/how-to-restrict-the-use-of-nosonar-and-suppresswarnings-in-sonarqube-9-9-2-community-edition/119764/3 "2024-08-05T12:15:30Z")

</div>

Thank you. But for Javascript, Typescript, etc.,
