squid:S1172 cannot recoganize my parameter used in lamda function

java
sonarjava

(Heyouxian) #1

My code below, then sonar report [true] New: squid:S1172 Severity: MAJOR, Message: Remove this unused method parameter "context".

private static void handleLoops(Condition condition, final AbstractContext context) {
        Optional.ofNullable(condition.getLoops()).ifPresent(loops -> loops.forEach(loop -> handleLoop(loop, context)));
 }


(Elena Vilchik) #2

Hello,

I can not reproduce with latest version of Java analyzer. So I need to know which version are you using.

Are you using connected mode in SonarLint (your SonarLint is connected to SonarQube)? If no, tell the version of SonarLint and IDE you are using. If yes, you should check version of “SonarJava” in Marketplace.

Regards,
Elena


(Heyouxian) #3

Hello,
It’s reported by SonarQube to our gerrit by Jenkins Devops mode. Our company used SonarQube 5.6.6

I don’t know why I cannot reply, so have to edit here: SonarJava plugin is 4.15.0.12310.


(Elena Vilchik) #4

I need version of SonarJava (java analyzer), not SonarQube.
You can know it through marketplace in SonarQube.