After migration to sonarlint 7.1, multiple warnings appear which are not in the quality profile

  • Operating system:
    Window 11
  • SonarLint plugin version:
    7.1.0.75242
  • Programming language you’re coding in:
    C#
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version):
      Yes, SonarQube version 10.0

After installing the latest version (and having the connection migrated) the following warnings appear in Visual Studio:
S3966, S6562, S6580, S6601, S6603, S6605, S6608
These warnings are not part of the quality profile “Sonar way” and should not appear.
The large amount of unwanted warnings hides the real important ones.

Hi,

It looks like those rules actually are in Sonar way.

Perhaps you didn’t expect to see them because they’re not in your custom profile? And perhaps connected mode has become… disconnected?

 
Ann

S3966 is indeed in the Sonar Way Quality Profile, but for the others, I can’t find S6562, S6580, S6601, S6603, S6605, S6608 there.
Also, these warnings do not appear on the build server, nor on the Sonar Portal. They appear only in Visual Studio, which is not consistent. And yes, the connection mode is still connected, the connection shows up as “bound” in Visual Studio. All other rules in the Profile seems to work correctly on all environments.
So it is still a bit of a mystery.

Hi,

I’ve just checked each of these rule IDs against our dogfooding instance. I’m definitely seeing S6562, S6580, S6603, S6605 and S6608 in Sonar way.

S6601 doesn’t seem to exist.

Can you give me a screenshot of an issue raised in SonarLInt by S6601?

 
Ann

Hi,

Thank you for your time. I’ve looked into your link and this solves one part of the mystery. The rules are indeed the link you provided, and also in Sonar way - Quality Profiles - SonarQube, the profile our profile is based on. S6601 was probably a typo, and should be S6602.

Our SonarQube instance is on-prem, and apparently the profile is not updated for four months. I suppose the rules S6562, S6580, S6602, S6603, S6605, S6608 are rather new and not included yet on our on-prem server.

That explains the part that we don’t get these warnings on the build server and in the portal.

Still, why does the plug-in show these warnings? Could it be the plugin gets the rules from next.sonarqube.com and then puts the rules from our on-prem server on top?

Hi,

It sounds like you’re not using connected mode.

You can’t pull rules from next.sonarqube.com into your instance. It sounds like they do exist in your instance, so you’ll just need to update your profile.

 
HTH,
Ann

I am using connected mode. To be sure, I removed in the folder “AppData\Roaming\SonarLint for Visual Studio” all files and folders, and reconnected.
sonar-connection

Alas, still the same result.

For now I’ve solved the issue by putting those rules in the section of the Directory.Props.props file of the solution.

Wilfried