Search code examples
eclipseintellij-ideasonarqubeeclipse-marssonarlint

SonarLint is not showing all records compared to referenced SonarQube server


We are using SonarQube server version 5.3 with SonarLint 2.0 in connected mode. As an IDE we use Eclipse Mars 2.0 and when we compare results found by SonarQube server with results found by SonarLint within IDE, the results differ (example file 274 errors in IDE, 826 issues in SonarQube!).

One of the usual differentiations is that "Variable could be declared final".

Also one of my colleagues who is using SonarLint for IntelliJIdea is having similar issues (Idea version 2016.1.1, SonarLint 2.0.2, example file - same as used for comparison in IDE 293 errors).

I wonder why there are such differentiations against the server and even between IDEs.

Could someone help me out on this? Thanks.


Solution

  • I'm facing a similar issue, illustrated by this example: SonarLint 2.0.2: 99 issues. SonarQube 5.4 UI: 116 issues. Differences caused by 2 rules which belong to the Checkstyle Plugin.

    As you are talking about "Variable could be declared final" I'm assuming the rule behind your missing issues is pmd:LocalVariableCouldBeFinal, which belongs to the PMD Plugin.

    Fabrice has commented on this topic in SonarQube Google Group they "won't add support for any external engine": SonarQube Google Group (this is true for PMD, Checkstyle, Findbugs and others...)

    So sadly we can only use rules mentioned in SonarLint rules list which are provided by SonarQube out of the box (i.e. their Java Plugin).