26 Jun 2014

Introducing the Insight Score

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:

20 is Bad, 95 is Excellent

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:

  • Silex: 94/100
  • Symfony2: 86/100
  • Faker: 77/100
  • SwiftMailer: 46/100
  • Doctrine ORM: 45/100
  • Twig: 27/100
  • Joomla: 27/100

We're still tweaking our grading algorithm, but that already gives you an idea of where your project might be.

How We Compute The Insight Score

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!

Try It And Send Us Your Feedback

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