Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonar not respecting //NOSONAR for duplication

When a line of code is decorated with a //NOSONAR comment, Sonar seems to correctly ignore specific code quality rules (eg non conforming naming standards).

However, code duplication problems are still detected for lines so decorated.

Is there a simple way to make Sonar ignore duplication?

Note: I don't want to create a special exception on the sonar server, because every dev had their own local sonar instance, so it has to work "everywhere".

like image 342
Bohemian Avatar asked Nov 24 '25 20:11

Bohemian


1 Answers

//NOSONAR only work on issues. But the root cause of your issue is "every dev had their own local sonar instance". This goes against the SonarQube philosophy and prevent you from settings exclusions. The question then would be: Why don't you have a single central SonarQube server?

like image 87
David RACODON - QA Consultant Avatar answered Nov 27 '25 02:11

David RACODON - QA Consultant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!