Why sonarlint and sonarqube result are different?

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
my version
sonarqube 7.1
—plugins :sonar-java-plugin-5.14.0.18788.jar(default version is sonar-java-plugin-5.2 if use this version sonarlint can’t find any issues)。
sonarlint 4.11.0.20867

picture 1 is sonarqube find 1 issues


picture 2 is sonarlint find
222222222225

if i use connected mode, SonarLint will use the exact same version of the analyzers as you have on the SonarQube server

i see this issues Sonarqube and sonarlint issues result is different but i don’t know the meaning?

Hello, welcome to the community!

Could you please check that:

  • Your project in IntelliJ is bound to the correct project on server (same project key)

image

  • Your server binding is up-to-date

image

Additionally, could you please check whether file exclusion patterns are defined on the server? For performance reasons, these won’t be applied when the analysis is triggered from the “Project > Right Click > SonarLint > Analyze with SonarLint” action, which can result in differences between the issues detected by SonarQube and SonarLint.

thanks for your reply。
This is my configuration, the same as your request



thanks for your reply

One possible problem is that my java project is built by maven, the project name is example, and the project name I created in sonarqube is develop. Does it have anything to do with this?

Is the version 4.11.0.20867 of sonarlint and sonar-java-plugin-5.14.0.18788.jar mismatched? If yes, please specify which version should be used?

this is my verbose log Hope it can be useful to you

Trigger: ACTION
[Action] 134 file(s) submitted
Configuring analysis with org.sonarlint.intellij.analysis.JavaAnalysisConfigurator
Using configuration of ‘develop’ in server ‘localhost’
Analysing 134 files…
Starting analysis with configuration:
[
projectKey: develop
baseDir: E:\MyWorkspace-idea\example
extraProperties: {sonar.java.target=8, sonar.java.libraries=D:\software\jdk8}
inputFiles: [ Omit
file:///E:/…/body/LeaveBody.java (UTF-8)
file:///E:/…/Leave.java (UTF-8)

]
]

Done in 10453ms

Processed 0 issues in 0 ms
Found 0 issues

I have to admit I am a bit lost: in your initial post you mentioned 96 issues, and the SonarLint log says Found 0 issues

I notice that your server seems to have a quite old version of the Java analyzer - 5.14.0.18788 is more than one year old, so I would advise that you update your plugins on the server, if possible.

However, I don’t think this is the root cause for the difference you observe between SonarQube and SonarLint.

Could you please send a log of your SonarQube analysis (e.g extracted from your CI system) and the full verbose log of your SonarLint analysis? You can send them to me using the private messaging system of this forum, for confidentiality. Maybe there is something odd in the way the project is imported in the IDE, and the Java analyzer has issues resolving some types - this is a common cause of discrepancy between SonarQube and SonarLint.