SonarQube Cloud and IDE integration

  • Operating system: MacOS 15
  • SonarQube for VS Code plugin version: 4.23.0
  • Programming language you’re coding in: C++
  • Is connected mode used: SonarQube Cloud

In connected mode, SonarQube marks “issues”.
Many of them are deemed acceptable and I want to mark them as either “accept” or “false positive”.
I understand that I cannot do it from within the IDE, but I don’t even see a way to quickly navigate to the relevant location in the web interface. Is there a way to do it?

Hello @alexoren , welcome to Sonar Community! :waving_hand: :sonar:

Did I understand correctly that you expect to navigate to a server issue from the IDE so that you can mark the issue as accepted or false positive? :thinking: If so, this action is available only for a “special subset” of issues such as Security Hotspots & Injection Vulnerabilities.

But fear not! I think you will find this articles about investigating issues and marking issues helpful. In short, you don’t need to navigate to the server in order to mark the issues as accepted or False Positive - you have an interface directly in the IDE to do that.

Hope that helps, and please don’t hesitate to follow up if not!

Sophio

Hi Sophio, thank you for your reply!

We are using SonarQube Cloud, not SonarQube Server, and the documentation you pointed me to states:

Requirements for marking issues

  • SonarQube for VS Code 3.21 or newer.
  • Running in connected mode with SonarQube Server 10.2 or newer (Marking issues while bound to a project in SonarQube Cloud is not supported by SonarQube for VS Code 3.21).

Hi @alexoren :waving_hand:

Marking and investigating issues is possible with SonarQube Cloud & SonarQube for IDE: VS Code v4.23. Can you clarify what is your expected outcome vs what you are seeing?

All the best,
Sophio

Marking and investigating issues is possible with SonarQube Cloud & SonarQube for IDE: VS Code v4.23

After manually killing all the Java processes started by SonarLint (there were some 6-7 of them), and restarting VsCode, I can now see the option.

1 Like

My mistake. It still does not work:

The issue seems to be that SonarLint does not pick the correct branch:

image

Killing the java processes is a different issue (which I will make another thread for) and it appeared to work because I tried it on the master branch.

1 Like

Hey, that’s a great observation!!

Does the same branch exist on SonarQube Cloud? With the same issues as you have locally? Could you please share verbose logs with us? I will also try to reproduce the issue in the meantime.

All the best,
Sophio

Does the same branch exist on SonarQube Cloud?

Unfortunately, it is not feasible for us to create every branch we’re working on on SQC.

Edit: For that particular branch, the admin created a branch in SQC for me to test. It is named differently but it seems to be tracking the correct commits:

VsCode still says “master” on that branch, but it seems to allow resolving.

I was too quick to comment.

It does allow me to choose a “Resolve” action, and it pops up message saying that I accepted the issue, and removes it from the list.

But when I close the file and reopen it, the issue is displayed again in all its unresolved glory.

1 Like

I understand…

When connected to SonarQube Cloud, SonarQube for IDE will

  • try to match locally detected issues with those detected on the server.
  • If a match is found, the resolve issue as... action will be available in the IDE.
  • If your local branch has issues that do not exist on the server, you will not be able to mark them as resolved “in advance”.

Is this what you would like to do? This feature exists when connecting to SonarQube Server but not with SonarQube Cloud. Your insights could help us prioritise the work.

As for the “seemingly resolved issue coming back after restart”, I was not able to reproduce the scenario. I selected resolve issue as... action, and saw the success notification issue status was changed. Then restarted the window and the issue was still gone.

We would still need verbose logs to investigate further. You should be seeing something like POST 200 https://sonarcloud.io/api/issues/do_transition if the issue resolution really works.

I hope that helps,
Sophio