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

You can use //NOSONAR or @SuppressWarnings() but you need to specify the rule.

From the SonarQube documentation:

The //NOSONAR tag is useful to deactivate all rules at a given line
but is not suitable to deactivate all rules (or only a given rule) for
all the lines of a method or a class. This is why support for
@SuppressWarnings("all") has been added to SonarQube.

SINCE 2.8 of Java Plugin, you can also use @SuppressWarnings
annotation with a list of rule keys:

@SuppressWarnings("squid:S2078")

or

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)