How to suppress a warning for a specific method with the Intellij SonarLint plugin

I want to suppress the Sonar lint plugin warning for some methods, this question is not what I want Intellij SonarLint 2.3 - ignore the rule .

Currently, I have to annotate the method with a help @SuppressWarnings("all")that suppresses all warnings.

+4
source share
1 answer

You can use //NOSONARor @SuppressWarnings(), but you need to specify a rule.

From the SonarQube document:

//NOSONAR ( ) . @SuppressWarnings("all") SonarQube.

SINCE 2.8 Java, @SuppressWarnings :

@SuppressWarnings("squid:S2078") @SuppressWarnings({"squid:S2078", "squid:S2076"}).

+4

Source: https://habr.com/ru/post/1689509/


All Articles