What shows the evolution of the code quality of a PHP project? SensioLabsInsight medals are a good indicator of the overall quality. But they don't change very often. A project can see its entire codebase rewritten without switching from bronze to silver. We needed a new way to score the quality of all projects analyzed on Insight. We've just added it to all projects: it's called the Insight Score.
You will see the score under the medal, written on a ribbon:
Each project now has a score on 100, based both on the remediation cost and the number of lines of code. Here is the score we computed on of a few public projects:
We're still tweaking our grading algorithm, but that already gives you an idea of where your project might be.
We first thought about using exclusively the remediation cost to compute the grade. But it turns out that large projects often have a heavy remediation cost, even though their codebase isn't necessarily of worse quality. It's just that the more you write code, the more chances you have to write bad code. Using only the remediation cost would make large projects have a lower score, and that would not be fair. We needed a scoring system to grade a project relative to projects of the same size.
Going further, we made a few statistics on all the analyses computed by Insight. On average, the remediation cost increases by one hour each time a projects gets bigger by about 60 lines of code. That means that the average remediation cost computed by Insight on the thousands of projects already analyzed is of one minute per line of code.
Whether a project is above or below that average is a great sign of its quality. That's why the Insight score is based on a remediation cost / lines of code ratio. The best projects get a 100, the worst get a 20, because we don't want to give a zero!
We hope that this new score will help you assess your quality progression in a fine-grained way. Do you think it's fair for your project? Do you think it's not? Send us your feedback about this new feature!comments powered by Disqus