Sonarqube and sonarlint issues result is different


(Fanny Tan) #1


I am using sonarqube 6.7.5 and sonarlint 3.6 in eclipse mars.
I got different result in both of them. My sonarqube always got more. I have bind my sonarlint to my sonarqube server. Is there any other configuration?

I read some topics which has same problem but I still have not get answer. Please help. Thank you

Why java plugin in sonarlint is different?
(Julien Henry) #2


Can you provide an example of a rule that is raising issue on SonarQube and not on SonarLint?


(Fanny Tan) #3

Hello, Here is attachment of example project.

In first picture, as you can see, my result on sonarqube is 656 but on my sonarlint is 644

(Fanny Tan) #4

On second picture, is result of one file. There are 3 rules which is not included in my sonarlint

(Julien Henry) #5

The missing rules are from the “common rules” repository. These rules are kind of “meta rules”. They are creating issues based on other measures computed by SonarQube/SonarCloud.
We don’t evaluate those rules in SonarLint. For example, computing the coverage is both time consuming, and usually requires a good integration with the build process. This is not practical in the IDE.
Computing cross-project duplication can only be executed on server side, since it requires to access all code of all projects.

Long story short: this is expected behavior :slight_smile:

(Fanny Tan) #6

I still has some question. In this project, it shows that sonarlint has 133 result, but on sonarqube overall is 685 while the leak preiod is 140.Is sonarlint scan leak period?

(Fanny Tan) #7

And I found that some issues is not scanned in sonar but it is scanned in sonarlint
Here on of the example: (I also have updated my binding)

(Julien Henry) #8

No. SonarLint will report all issues, whatever is their date. Another common reason of difference is that the list of analyzed files can be different.

Regarding issues found in SonarLint but not in SonarQube, can you check that the file is correctly analyzed in both tools, and that is is not classified differently (as a test file only in one tool for example).
Test files have different rules applied.

(Fanny Tan) #9

Thank you, it helps much. :smile: