How to SupressWarnings for Sonar Security Hotspots?

How to SupressWarnings for Sonar Security Hotspots?

Sonarlint/SonarQube allows you to use comments for disabling analysis in specific lines. In order to do this, you can just add a comment with the text NOSONAR in the same line:

Random rand=new Random();//NOSONAR not used in secure contexts

Aside from this, you can mark Security Hotspots as resolved in the web Dashboard of SonarQube. In order to do this, you need to navigate to the Security Hotspot and mark it as not an issue. You might even want to disable that specific type of Security Hotspot entirely if it is generally not applicable for your project.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章