How to get most of SonarQube for Visual Studio and C#?

Hello, I use SonarQube Cloud to analyze pullrequest builds (C#). Lets say this build with Sonar analysis takes 15 minutes. So after 15 minutes I can see issues caused by my new code.

That’s a lot of time, so I am interested in SonarQube extension for Visual Studio - if I understand it correctly, when I use it in Connected Mode, I can see the analysis results as I code. I want to see the same new issues as SonarQube Cloud would detect. But instead of this, I have to look into Errors window in Visual Studio and search for Sxxxx messages/warnings/errors which is not very convenient, because we have many other entries there (legacy code).

So I open Sonar Issue Visualization, but it is empty.

I also noticed, that in Errors window I see only Sxxxx messages for files, that are currently open. I want to see messages for all changed files. And there is maybe a bug - in an open file, the issue is marked with green dots for a while, and then the dots disappear and also the entry from Error window disapears on it’s own.

So my question is: How can I simply show only issues introduced by my changes and see them well-arranged in a single place?

Thanks,
Jozef

Hi Jozef,

Welcome to the community!

Could you provide the information prompted for in the topic template, as well as your logs?

  • Operating system:
  • Visual Studio version:
  • SonarQube for Visual Studio plugin version:
  • Programming language you’re coding in:
  • Is connected mode used:
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):

 
Thx,
Ann

Oh, sorry, here is the info:

  • Operating system: Windows 11
  • Visual Studio version: Professional 2022, 17.14.0
  • SonarQube for Visual Studio plugin version: 8.18.0.13071
  • Programming language you’re coding in: C#
  • Is connected mode used: Yes, SonarQube Cloud

I do not have logs for case when error disappeared - now it looks like it is working, so I see it in the currently open file underlined/squiggled (but I do not see whether the issue is from Visual Studio analyzer or ReSharper or Sonar). It just says Compiler Warning: ‘S1135: …’

My question is, how can I see all Sonar issues generated by my new changes (let say 15 files in Git Changes), as if I would see them when I create GitHub pullrequest with SonarQube Cloud.
I do not want to scroll and search for Sxxxx messages/warnings/errors in Error List in Visual studio, because we have many other messages and warnings there.

Hi,

The idea is to show the issues in the file(s) you’re working in, so I suppose you would open them all and tab through them to see what shows up before commit/push.

 
HTH,
Ann

Hi Jozef,
Thank you for your feedback. Currently, you can run the analysis on the entire solution through the analysis settings of C#, see below screenshot:


And you can filter the issues with the following filters

We hope this can already help.
We’re also exploring a few options to have similar results in the IDE and SonarQube Cloud. I’ll keep you updated on our progress.
Best regards,
Farah.