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.
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).
Thank you for the formulas.
" The value of the cost to develop a line of code is 0.06 days "
I am intrested in the num 0.06d.Can you give me more information about it ? Why is 0.06d? Is there any paper or doc working on where 0.06 comes from?
The assumption is that some time will be lost to meetings, time keeping &etc.
To be honest, this was set so long ago, I don’t know where that exact number came from. At a guess, it’s either from Agile frameworks or from the SQALE method.
Thank you for your reply.
It seems that 0.06d is quite close to the default value of the LOC developing time in sonarqube configuration page -" 30min".