Is it possible to change the sqale_rating metric to make it useful?

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Languages of the repositories: Java, Typescript
  • Steps to reproduce: Check out public repositories on sonarcloud. Is there any three projects getting the grade “B”?

The sqale_rating documented here:

almost always gives an “A”-grad to a project.
Is there a way to change the maintainability rating?
The documentation under the link above states the “default 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”. How can I change this default?

We have projects in our organization with varying degrees of maintainability, but all get an A grade for maintainability. As a consequence from every project getting an A, we cannot compare the maintainability of projects.

Hey there.

This is something that’s been on my mind for years, so thanks for bringing it up here. :pray:

It’s not possible to change the Maintainability Rating Grid on SonarCloud.

Personally, I think the Maintainability Rating is useful in the context of Pull Request Analysis or focusing on New Code, but on a sufficiently large project, it’s very hard to get anything but an A rating when looking at the overall code.

I’ve moved your post to the right category to generate some discussion on this.

The worst monolithic and regarding to code quality “out of control” project I ever saw has a dept ratio of 2.2%.
The worst project from the microservice area has a dept ratio of 1.2%.

Good but also big projects have dept ratio of 0.2 up to 0.4%.

From my point of view only projects lower than 0.3 should get an A. 0.3 to 0.6 % an B, 0.6 to 0.9% an C, 0.9 to 1.2 % an D and above an E.