Code analyze result is different between IDE and SQ Community Server

Please provide

  • Operating system: Win 10 Pro.
  • Visual Studio version: Microsoft Visual Studio Community 2022 (2) (64-bit) - Current
    Version 17.13.4
  • SonarQube for Visual Studio plugin version: SonarQube for VS V8.16
  • Programming language you’re coding in: C#
  • Is connected mode used:
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):
      Use Sonar Qube Community Build v24.12.0.100206

And a thorough description of the problem / question:

I have a Sonar Qube Community analyzing remote repo but I want to have a local code analyze before I submit to cloud. So I add the SonarQube for VS extension. Then I create a Project token from SQ community and bind the project using this token.
And then I restart my VS and the analyze worked but not as expected. The code analyzing result have more validation errors then I summit it to remote.

Why do local plugin have different analyze report from server after I already bind it to server? And how can I do to make the local plugin use same analyze rule with server.

Hello @Ike,

Welcome to our Community! :sonar:

I could reproduce the behavior you are mentioning and it is not intended. We will try to address this issue as soon as possible and to include a fix in our next release (most probably next week).

Thank you for reporting this problem!

2 Likes

Hello @Ike,

We released a new version, 8.17, that includes a fix for your problem. Can you, please, update to the latest version and let us know if you still experience the issue?

To enforce that the quality profile information from your SonarQube Server is the same with the one from the IDE, please re-bind your project in the “Manage Project Binding” window from Visual Studio (you will have to “Unbind” first and then bind again to your server project).

1 Like

Thanks Gabriela.
I have tested it on my local machine. Rules sync successfully and results are same now. I haven’t tested all rules but only C# and JS rules.
I will report here if I meet any issues but so far so good.

Thanks for so such a quickly response and fix, it helps a lot.

1 Like

I am glad to hear that, @Ike! Happy coding! :sonarlint:

1 Like