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.
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:
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
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
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
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).