We started using Sonar with the IntelliJ plugin applying the Cleans as You Code strategy.
Not a major problem, but one thing somewhat bothered us – While writing code, all variables are unused so IntelliJ warnings necessarily show up.
That’s okay, but it makes it impossible to see at a glance if there are other warnings that should be fixed right away. Making this warning as a “weak warning” just as the default IntelliJ inspection would solve the issue.
The idea would be to allow a mapping of rules to IntelliJ warning levels.
Hello @Eizch and welcome to the Sonar community forum!
For what I see, both the SonarLint and IntelliJ inspection for unused variable report at warning level:
Also, if you use SonarLint in connected mode with SonarQube or SonarCloud, you can define a customized Quality Profile where you override the severity of a rule: if you change the Sonar severity from Minor (current level) to Info, then it will be mapped into a Weak Warning in IntelliJ.
Hello, thanks for the quick reply!
The suggestion was more to allow a custom mapping to dissociate the display in IntelliJ from the actual severity levels. But after consideration we think it’s a good solution to use after all to use the Info level.
At first we didn’t want to lose the actual severity level, but we want to fix them all anyway before passing a PR so it matters less than we thought.
For the IntelliJ inspection – you’re right, I confused “weak warning” with “unused variable”.
We do still have a small problem though, the Info does not display as weak warnings for us. We will check our setups and research more if there’s a misconfiguration somewhere or something.
Anyway, it’s a bit different than original topic so I’ll create a new thread if needed after more investigation on our end.
Thank you again for the help