Is there a way that Sonar would ignore if IntelliJ warning suppresed

java
sonarqube

(Ter) #1

So there is an issue. We have some warning suppressed in IntelliJ, like
@SuppressWarnings(“ConstantConditions”)
If method does not check possible nullPointer, but code checks before calling that method. Now Sonar still marks that method line as possible nullpointer squid:2259
For one warning maybe it’s not and issue, but we have a lot such suppress warnings and we would want to be able to say somehow that sonar would ignore it if there already a java suppress warning present.
Is it even possible?


(Duarte Meneses) #2

Hi,
We don’t support that annotation. We think that it’s not ideal to mute code quality checks in the code.
The best way to accomplish this is to connect SonarLint to SonarQube. In SonarQube, mark the issue as ‘wont fix’ and then update the SonarLint binding to that SonarQube instance.


(Julien Henry) #3

@TerTerro Maybe if you could share a reproducer we could have a better understanding on the overall problem, and the rule(s) could be improved to not report issue when some @SuppressWarnings are there.