SonarQube and SonarLint scan results are different

Our company is currently using SonarQube and SonarLint, and there are some issues that we hope to receive help with. Thank you.
The results of scanning locally using SonarLint do not match those of SonarQue. The specific information is as follows:

  1. Connection mode has been used and Update local storage has been used
  2. The scanned project is a Java project, and the quality configuration used is the built-in Sonar Way
  3. The version information is as follows:
    SonarQube version: Community Edition version 9.9
    SonarLint version: 8.2.0.68615
    IntelliJ IDEA version: IntelliJ IDEA 2022.3.2 (Community Edition)

The screenshot is as follows:

  1. Connection mode has been configured and Update local storage has been executed

  2. Scan the report of all files in the project, with 59 issues
    image

  3. On the Sonarqube platform, there is a problem where the scan result is 242
    image

Can you give some examples of specific issues that aren’t raised in SonarLint, but that are raised by SonarQube?

Also keep in mind this entry in the FAQ.

1.This result is that sonarqube was scanned, but local sonarlint was not scanned

2.This blocker was scanned by sonarlint, but sonarqube did not

Thanks, and sorry for the late update.

I would suggest making sure you are using the latest version of SonarLint for IntelliJ (v8.5.1) – if you still have an issue being raised in SonarQube that isn’t being raised by SonarLint (while using connected mode), I suggest trying to put together a minimal reproducer so that we can try and debug it on our end.

It would also be useful to know what steps you follow when you analyze your code with SonarQube (such as: which scanner are you using? SonarScanner CLI? Maven? Gradle?)

It looks like this rule is related to tests – and will only be turned on if IntelliJ says that it’s a test (for SonarLint) or if SonarQube is told via the sonar.tests parameter. Which comes back to the question about how you preform your analysis.