New technical debt ratio

New Remediation time : 10 mins
Cost for each line of code : 30 mins

Line of code : 11

The new technical debt ratio what I get is different from the one shown in SonarQube

Where can I find the new line of code

Hello @Bhuvaneshwari_Kannan

We will unfortunately not be able to help you on this if you don’t elaborate a minimum on the problem.
Please provide a better description of your environment (SonarQube version, language, some screenshots of where you see or miss something or see (tech debt) discrepancy) and we’ll be glad to review


New Remediation time: 10 mins
Cost for each line of code: 30 mins

Line of code: 11
The new technical debt ratio is remediation cost/(cost for one new lines of code development*new line of code)

how can I get the new line of code for finding the new technical debt

I am able to get nloc through API .i,e the total line of code. How can I get the new line of code due to a new change in code

The remediation cost for new code: 10 mins ( as per SonarQube rule)
Total remediation cost: 20 mins
The cost for one line of code development: 30 mins
Total line of code is : 11

Total technical Ratio : 20/(11*30)= 0.06- Maintainability: B
Now how can I get new code technical debt ration

You don’t have to calculate anything yourself.
The metric is already calculated in SonarQube and you can fetch it with api/measures/component?component=<yourProjectKey>&metricKeys=new_sqale_debt_ratio

PS/ You can get the list of all metrics potentially available in SonarQube with api/metrics/search?ps=500 (:warning: paginaged API, not all metric may come on the 1st page). “Potentially” because not necessarily all metrics are equally available in all projects (it depends on the languages etc…) even though a large majority is available for ALL projects.

Thanks a lot