SonarQube Version: 6.7
Is there any REST API for getting Code smells (Technical Debt) from SonarQube, I have searched many forums but I couldn't able to find.
I need rest API where we can pass the project key to get the days count of code smells.
SonarQube Version: 6.7
Is there any REST API for getting Code smells (Technical Debt) from SonarQube, I have searched many forums but I couldn't able to find.
I need rest API where we can pass the project key to get the days count of code smells.
Finally, I got the specific API for Technical Debt count for Code Smells type.
Use the below API which gives debtTotal count, take this figure and divide with mins configured in sonar Number of working hours in a day
Sample Response:
For Example, if 8 Hrs configured divide with 480 Mins
There is web api for measures: https://sonar.instance/api/measures/component
Metric for Technical debt is "sqale_index" https://docs.sonarqube.org/7.4/user-guide/metric-definitions/
Query to search technical debt is:
https://sonar.instance/api/measures/component?component=project_key&metricKeys=sqale_index
If I am not missing something, the following Web API should be the one you are looking for: https://sonarcloud.io/web_api/api/issues?query=issues%2Fsearch
Look for effort
in the Response Example tab and you will find the estimated time to fix each issue. The format is a bit unusual, but still it should not be difficult to parse.