Right now, having 1 code smell still gives an A grade, I want it to give a B grade instead, but I can’t find any way to do that.
Also, how do I trigger a code-wide analysis in SonarLint for VSCode ? If you close a file, the warnings from SonarLint disappear. I can’t even trigger an analysis from a Husky hook before commits… This is so much more limited than ESLint.
Hey there
Maintainability ratings work a bit different than other ratings. As defined here:
Maintainability Rating (
sqale_rating
) (Formerly the SQALE rating.) Rating given to your project related to the value of your technical debt ratio. The default maintainability rating grid is:A=0-0.05, B=0.06-0.1, C=0.11-0.20, D=0.21-0.5, E=0.51-1
The maintainability rating scale can be alternately stated by saying that if the outstanding remediation cost is:
- <=5% of the time that has already gone into the application, the rating is A
- between 6 to 10% the rating is a B
- between 11 to 20% the rating is a C
- between 21 to 50% the rating is a D
- anything over 50% is an E
So there’s no way to make it so that 1 code smell automatically means a B.
You can, however, decide to add conditions to your Quality Gate like “0 Code Smells” or “0 New Code Smells” if you want to fail the Quality Gate on the existence of any code smells.
The goal of SonarLint is to help developers fix issues as they code (emphasizing the Clean as You Code approach, not issue a full-project report.
The goal of SonarLint is to help developers fix issues as they code (emphasizing the Clean as You Code approach, not issue a full-project report.
I understand that, but even in that regard, I would at least expect the analysis to run on all uncommitted changes, not just the opened window. Because right now SonarLint won’t even show a warning if you have uncommitted issues in closed files. Uncommited changes ARE new code, whether the window is opened or not.
You can, however, decide to add conditions to your Quality Gate like “0 Code Smells” or “0 New Code Smells” if you want to fail the Quality Gate on the existence of any code smells.
That worked, thanks!
Hello @mickael-h, reviewing new issues since the last commit is indeed something we’re considering adding in the future. I feel that makes sense as it will help ensure the new code you’re going to push is as clean as possible. Here is a roadmap card you can follow if you want to receive updates about this topic (please note that card mentions Eclipse and IntelliJ because there is already an option to scan uncommitted files, but plans are not limited to those two IDEs and VS Code is also a candidate).
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.