Sqale_debt_ratio (Debt Ratio) shows 0.0% in Sonarqube UI after analysis in LTS version

Hi everyone

After doing some project analysis in my company Sonarqube instance (7.9.4), the Debt Ratio measure always shows me 0.0% in projects with lot of technical debt like this:

image

This problem appears in large and shot projects, with SonarScanner and Sonar Maven analysis and all the projects have the sonar.scm.disabled = false property and all projects have git as SCM provider. In addition, all the analysis are running through Bamboo server and all git clone operations previous Sonarqube analysis are unshallowed clone operations.

In all the projects that have the 0.0% Debt Ratio value, in the analysis log appears the “Missing blame information” typical warning, but in other projects appears too this message but the Debt Ratio is calculated OK. An example of analysis log for a project with 0.0% Debt Ratio value is shown below:

Anybody knows what could be the bug or the problem in these analysis?? I would appreciate your answers.

Thanks in advance.

Hi,

I suspect you’ll find that this occurs in very large projects with relatively low debt and that what you’re seeing is essentially a rounding error. According to the docs:

Ratio between the cost to develop the software and the cost to fix it. The Technical Debt Ratio formula is:
Remediation cost / Development cost
Which can be restated as:
Remediation cost / (Cost to develop 1 line of code * Number of lines of code)
The value of the cost to develop a line of code is 0.06 days.

So I suspect you’re looking at a very large Development cost on these projects.

 
HTH,
Ann

Hi Ann,

Thank you for your answer. But, although the 0.0% value is due to a rounding error because of a large development cost in some projects, when somebody checks the Sonarqube measures project menu out, and looks, as in my first example, that has 0,0% debt ratio value with 8519 days of debt cost, he/she could think about if that measure works well or, in the other hand, shows something wrong.

So, ¿how can I explain to anyone how is it possible to have a 0% value in debt ratio having more than 8000 days of theorically work to fix all the code smells in the project?

Thank you.