VS Error List shows different severity than SonarQube


SonarQube and SonarLint both find 37 issues in my project but I don’t understand how the categorization corresponds:

In SonarQube I have 0 Blocker, 4 Critical, 18 Major, 15 Minor and 1 Info.
In the Error List of Visual Studio I have 13 Errors, 5 Warnings and 19 Info.

Can someone explain?


Hi @dyedwiper, welcome to the community :wave:

Please take a look at our wiki “Rule severities”. I hope that answers your question, feel free to ask for any further information.

Hi Rita,

thanks for the link! That generally answers the question how the mapping is done, but somehow the mapping seems to be different in my case. According to the standard mapping there should be e.g. no errors in my project. Could it be, that the mapping is changed somehow?

Best Max

Hi Max,

In general, the mapping can indeed be changed in a few ways:

  1. You can manually override the severity in the ruleset file
  2. You can reference a different ruleset that overrides the severity
  3. You can enable “treat warnings as errors” VS feature (Project properties --> build --> treat warnings as errors)

The numbers that you provided don’t seem to match the “treat warnings as errors”, so something else is causing the discrepancy.
To rule out that it’s not due to manual change, please try to re-bind your project and see if that helps.

If it still happens after the binding, please check the following:

  1. Does the generated ruleset file (under .sonarlint folder in your solution) contain the correct mapping?
  2. Does your project reference that ruleset, or some other ruleset? (check the CodeAnalysisRuleSet property in your csproj)

Hi Rita,

I found the reason: There are a few projects in the solution and some of them are configured to “Treat warnings as errors” and some of them not. That’s why the numbers are so messed up.

Thanks for your help!

Best Max

Great, I’m glad it worked out!