SonarQube seemingly ignoring issue

Hello!

SonarQube 8.9
SonarLint 5.3.0.36775

Code snippet:

dimensions.stream()
.map(dim → listDimensions.add(dim.getId()))
.collect(Collectors.toList());

Issue:
If we have our sonarlint connected to our sonarqube then it will not detect any issue but if its not connected it will complain that its against rule java:S2201. This would be all fine if it was not for the fact that this particular rule is enabled in sonarqube and sonarqube does not find it. I also checked and its not in resolved (wont fix, fixed, false positive) either.

Anyone got any idea on what could be wrong here and possible solution?

Hello @Jack-Polystar,

Thanks for your feedback and welcome to the community.

You are using latest version of SonarLint :sonarlint: and LTS version of SonarQube :sonarqube:.
For Java in connected mode :sonarlint: uses analyzer from server and in standalone mode it use embedded analyzer. In latest :sonarlint: we use latest version of Java analyzer as embedded. And since :sonarqube: LTS was released some time ago - analyzer version is older there. This is explanation of behavior you described.
Speaking about solution - maybe easiest one is to update :sonarqube: to more recent version.

Have a good day!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.