Technical debt ratio on new code
What you will learn here about SonarQube
- Technical debt ratio on new code
Technical debt ratio on new code
Technical debt ratio on new code issue on SonarQube is very easy to solve. Please follow the following steps to know how to solve technical debt ratio on new code
1)First go to SonarQube
2)Click on Technical debt ratio on new code which is shown below
3)Now you can see new code Smells, Debt and Debt Ratio which is shown below
According to SonarQube, Debt ratio should be less than 3%, Since Debt ratio on new code is more than 3% we are getting Technical debt ratio on new code issue and this causes build becomes unstable
4)The solution is very simple, We have to solve all the code smells or new SonarQube issues which occured in new code which is shown below
Commonly Occured Code Smells solution
NOT COVERED BY TESTS SONARQUBE
REFACTOR THIS METHOD TO REDUCE ITS COGNITIVE COMPLEXITY
FORMAT SPECIFIERS SHOULD BE USED INSTEAD OF CONCATENATION
DEFINE A CONSTANT INSTEAD OF DUPLICATING THIS LITERAL
MERGE THIS IF STATEMENT WITH THE ENCLOSING ONE
THIS BLOCK OF COMMENTED OUT LINES OF CODE SHOULD BE REMOVED
USE PRIMITIVE BOOLEAN EXPRESSION HERE
ADD A PRIVATE CONSTRUCTOR TO HIDE THE IMPLICIT ONE
REMOVE THIS EXPRESSION WHICH ALWAYS EVALUATES TO TRUE