SonarQube is an open source quality management platform, dedicated to continuously analyse and measure technical quality. It provide us quality of our code in terms of Technical debt.
What is Developers' Seven Deadly Sins?
SonarQube measured code-quality, based on these Seven problem which occurs in code mostly.
1-Bugs and Potential Bugs - This sin represents things that are going wrong in your code today or that may go wrong tomorrow. An unconditional null pointer dereference is a prime example of a bug (hopefully the urgency is self-evident). Potential bugs are a bit more subtle, but no less important.
2-Coding Standards Breach
3-Duplications - copying and pasting
4-Lack of Unit Tests
5-Bad Distribution of Complexity - It's natural that a program will have some complex files and methods (just like it's okay to have dessert occasionally). but if you have too many of those, then what you may have done is code yourself a pot-full of spaghetti (to continue the food metaphor). Which means that the next coder who has to work on the application will have a hard time understanding what's going on in the code. And if she has a hard time understanding it, she'll have an even harder time successfully modifying it.
6-Spaghetti Design - Spaghetti Design is like having high complexity at the project architecture level, rather than in a single method or file. That shift from the micro to the macro makes it so much worse, because now instead of trying to take in a single large method and keep it all in your head, you've got to comprehend the convolutions of an entire project.
New developers on the team (and even some developers who've been on the project a while) will have a hard time understanding how the project is organized, and where new code should be put. And if they have a hard time understanding it, they'll have an even harder time successfully modifying it, and using its existing methods, structures, and utilities. Best case, they'll make a hash of any new code, which will quickly be caught in testing. Worst case, they'll perpetuate the madness by creating their own redundant structures and utilities.
7-Not Enough or too many Comments
What is Technical Debt?
When all these sins calculated, then Algorithm just measure error in your code using SQALE Method and provide us values in terms of Technical Debt.
The computation of technical debt is based on the SQALE (Software Quality Assessment based on Lifecycle Expectations) methodology.
What is SQALE Method?
The SQALE method is targeted for an automated implementation. It is generic and language and tool independent. The SQALE Method Definition Document lists all accepted tailoring rules while preserving the quality and benefits of the method. For more information visit SQALE
How to use it?
1 - Download SonarQube and SonarQube Runner
Links is - http://www.sonarqube.org/downloads/
2 - Unzip These folder in a directory.
3 - Set Environment Variable - SONAR_RUNNER_HOME as Sonar-Runner Folder.
4 - Add SonarRunner bin folder path in Path in Environment Variable.
5 - Start Server using SonarQube Directory.
6 - Write a Properties file in Root Directory.
7 - open Cmd and cd to your project folder.
8 - Now write sonar-runner as command and run it.
9 - and check your result with http://localhost:9000/