Debt Ratio calculation

Hello ,

I am comparatively new to Sonarqube and currently using Sonarqube version 7.9.3. I am considering the formula mentioned below to calculate debt ratio for new code.
Remediation cost / (Development cost)

Remediation cost = technical debt in days * 8 * 60(total minutes)
Development Cost = lines of new code * 30

But the debt ratio percentage I get is different than the one Sonarqube shows me. Could anybody please let me know if I am wrong anywhere.Thanks in Advance.

Regards
Ranjan

Hi Ranjan,

Welcome to the community!

From the docs (emphasis added):

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 think the formulas vary in the calculation of the development cost. My math says that it should be lines of new code * 28.8 (I.e. 8 hours * 60 min * .06 days/line of code).

 
HTH,
Ann