In one of the books DeMarco was given an interesting story. Imagine that a representative of the World Famous Organization for Quality Measurement comes to the project manager and reports that the project team is in the Top 10 of all teams in the world in terms of coding quality.
What does the manager think? His heart is filled with warmth and slips thoughts “Here are young! And I always suspected ... ". After that, the representative suddenly returns and apologizes - an error has occurred, the project is actually 10th from the end. The mood of the head is changing dramatically and he is already cursing his team.
What is the manager's mistake? It does not measure code quality.
And this is done quickly and painlessly with the help of automated tools for collecting code metrics. In our project we use
Sonar . This is how the Dashboard project page looks like:
')

Sonar supports Java, it is also possible to support the languages Flex, PHP, PL / SQL, Cobol, Visual Basic 6 using plug-ins. A full description of the metrics can be found
here .
Recommended values for some metrics:
- Comments - the recommended range is 20% - 40% of the total number of lines.
- Line repetitions - the smaller the better.
- The average complexity of the methods is no more than 5.
- Code coverage tests - from 80% and more.
- Rules compliance (conformance to Sonar rules) - the more the better.
- LCOM4 (component separation) - the closer to 1, the better.
We have problems with unit tests. And you?