SonarQube warnings display

Please provide

  • Operating system: MacOS 15.7.3
  • SonarQube for VS Code plugin version: 4.39
  • Programming language you’re coding in: C++
  • Is connected mode used: Yes, SonarQube Cloud.

And a thorough description of the problem / question:

Currently, the SonarQube warnings appear under 2 tabs: the general “PROBLEMS” tab, and the dedicated “SONARQUBE” tab.

Often, having the SonarQube diagnostics mix with all the others is distracting due to the high volume. This is especially an issue in teams that use SonarQube cloud and cannot disable some warnings locally without affecting the other team members.

Moreover, the warnings tend to stick around (or recur) even after the files are closed, so a developer is exposed to multiple warnings, unrelated to the code they are working on, and cannot fix due to drive-by refactoring being prohibited.

Since the warnings are already displayed in the SONARQUBE tab, a setting to allow/prevent exposing them in the PROBLEM tab will be very appreciated!

Hi @alexoren , thank you for the question. There are some nuances related to the fact that you see SonarQube issues in both SQ Tab and Problems.

Technically, it’s easy to add a config setting, but it has a significant UX trade-off. Since we use VS Code’s native diagnostic collection to populate the Problems tab, disabling it would also remove the squiggly line highlights and Quick Fix actions in the editor.

I am not sure that user experience would be better for developers, let us know what you think we are happy to explore more.

Could you give us more insights on following 2 insights for us to understand better if there is an alternative way to improve your devs experience:

  • Moreover, the warnings tend to stick around (or recur) even after the files are closed, so a developer is exposed to multiple warnings, unrelated to the code they are working on, and cannot fix due to drive-by refactoring being prohibited.
    • Is there specific type of issues where this happens?
  • This is especially an issue in teams that use SonarQube cloud and cannot disable some warnings locally without affecting the other team members.
    • Which warning are you referring to here?

That’s OK. The SONARQUBE tab will still show them, and re-enabling the setting should bring the editor options back.

A “live” toggle would be even better but I don’t want to sound greedy.

It would be better for those that need it and no worse for those that don’t (since it would be hidden behind an option).

Not sure.

I have noticed that sometimes when I close the file in the editor the warnings for that file disappear from the tab and other times they don’t. And even those that disappear suddenly reappear again without opening the file.

Haven’t noticed a clear pattern.

All of them?

Even if it’s acceptable or a false positive, I don’t get the option to “accept” or otherwise dismiss the warning:

Hi @alexoren,

Thanks a lot for these additional insights! :light_bulb:

For the “issues not disappearing” problem, we are aware of it. We rely on the IDE to send us the “file closed” event and we clear the diagnostics when the event is received. In some cases independent to us, these notifications are delayed. Similarly, we publish the new diagnostics when IDE sends us the notification that a file was opened. In some cases, we receive such events when file open was initiated in the background (maybe by some other extension or process). So unfortunately for now we cannot do much about this :frowning:

Even if it’s acceptable or a false positive, I don’t get the option to “accept” or otherwise dismiss the warning:

The SonarQube: Resolve issue violating rule... action is meant for that - to mark issue as accepted or false positive on the connected server. If you select the action, an additional QuickPick appear for you to select the desired status and add an optional comment. Would this workflow cover your use-case?

At the same time I am taking a note that maybe the wording of the action is not the best :slight_smile:

All the best,
Sophio

Actually you can, by ading the configuration option that I requested.

Possibly. I cannot check since the option does not appear anywhere.

Edit:

I believe we already touched on the subject before.

Our workflow makes it unfeasible to create a branch on SonarQube for every git branch we create locally or in bitbucket.

Thanks for the details @alexoren :person_bowing:

Actually you can, by ading the configuration option that I requested.

The issues would still stay in the SONARQUBE tab, but I guess it’s still better than having them in both places :smiley:

One last question, I just want to make sure that no existing option is “good enough” for your use-case. Have you tried using the Focus on new code feature?

When enabled, it will apply the New Code Definition from the corresponding SonarQube Cloud project, and only highlight issues (report in PROBLEMS) that are considered new (from last 30 days by default).

Thanks in advance,
Sophio :person_bowing:

I am trying to be realistic.

Local filtering will also be helpful, so I could at least ignore some categories, but this is a different discussion :slight_smile:

It would lower the number, but since several team members are currently doing refactoring, I’m afraid it would not help.

Though thank you for suggesting it!

Thanks @alexoren :person_bowing:

I’ve created a ticket to track this effort HERE. We just need to make sure that we get the UX part right, not to confuse anyone :smiley:

All the best,
Sophio

1 Like