Warning

This post is more than 5 years old. It may not fully represent my current thoughts on this topic. Please keep that in mind while reading.

Story

I came across a new tool called phpmetrics. It can be used for, what a surprise, calculating and displaying metrics for php. I fell in love with the tool in an instance and decided to run it on some php projects that I consider important. I’m aware of the fact that the list is far from complete, but it’s probably still worth a look. I especially love the “maintenability” (sic!) reports, I find those big red spots just as disgusting as I find ugly code the same.

The tool seems to be a bit buggy, but I’ll do my best to contribute to this project by fixing those asap.

Some important notes

  • I have been unable to get reports for Cakephp and Typo3 for the moment being, but I’ll investigate a bit further soon.
  • I ran the tool against the complete repositories/downloads. this means that in some cases it was run against external dependencies and in some it won’t. I might change that later, but it isn’t currently planned.
  • Some projects have many repositories and I wasn’t always sure if I tested the right one. Joomla is especially suspicious in this regard.
  • Some projects aren’t necessarily well known, but trending on github
  • dm-mailer is in not important at all, but my latest php hobby project. I put it in the Backfire section along with the phpmetrics project.
  • Note that php-yaf and phalcon are both very interesting php frameworks, but mostly C-based, therefore they are not included
<ul>
    <li>More dots simply mean more classes.</li>
    <li>Red means not maintainable, yellow is acceptable and green indicates good, maintainable code.</li>
</ul>

Results

Frameworks

Project Maintenability Report Repository Last commit (master)
agavi maintainablity report repo within 4 months
aura maintainablity report repo within 1 week
cakephp maintainablity report repo within 1 week
codeigniter maintainablity report repo within 1 week
deano maintainablity report repo within 10 months
fatfree maintainablity report repo within 1 month
flight maintainablity report repo within 2 weeks
fuelphp maintainablity report repo within 2 months
laravel maintainablity report repo within 2 weeks
limonade maintainablity report repo within 2 months
nette maintainablity report repo within 1 week
phavour maintainablity report repo within 6 months
php-mvc (advanced) maintainablity report repo within 2 weeks
phpixie maintainablity report repo within 5 months
popphp2 maintainablity report repo within 3 weeks
silex maintainablity report repo within 1 week
slim maintainablity report repo within 5 months
symfony1 maintainablity report repo within 2 years
symfony2 maintainablity report repo within 1 week
typo3 maintainablity report repo within 1 week
yii1 maintainablity report repo within 2 weeks
yii2 maintainablity report repo within 1 week
zf1 maintainablity report repo within 1 week
zf2 maintainablity report repo within 2 weeks

CMS

Project Maintenability Report Repository Last commit (master)
drupal maintainablity report repo within 1 week
joomla maintainablity report repo within 5 months
grav maintainablity report repo within 1 week
pagekit maintainablity report repo within 1 week
os webasyst projects maintainablity report N/A N/A
wordpress maintainablity report repo within 1 week

E-commerce

Project Maintenability Report Repository Last commit (master)
magento1 (1.8 copy) maintainablity report repo N/A
magento2 maintainablity report repo within 1 week
opencart maintainablity report repo within 1 week
oscommerce maintainablity report repo within 2 years
prestashop maintainablity report repo within 1 week
sylius maintainablity report repo within 10 months
virtuemart maintainablity report repo N/A
zencart maintainablity report repo within 1 week

Development Tools

Project Maintenability Report Repository Last commit (master)
codeception maintainablity report repo within 1 week
phpunit maintainablity report repo within 1 week

Other

Project Maintenability Report Repository Last commit (master)
piwik maintainablity report repo within 1 week

Backfire

Project Maintenability Report Repository Last commit (master)
dm-mailer maintainablity report repo within 7 months
phpmetrics maintainablity report repo within 1 week

Issues

Cakephp

594/666 [========================>---]  89%
                                  
[Exception]                         
Closure detected instead of method             

Deano

2/9 [======>---------------------]  22%file /home/peter/dev/php/opensource/deano/views/layout/layout.php is not valid and has been skipped
9/9 [============================] 100%file /home/peter/dev/php/opensource/deano/deano.php is not valid and has been skipped

Limonade

 9/16 [===============>------------]  56%file /home/peter/dev/php/opensource/limonade/examples/example02/index.php is not valid and has been skipped
16/16 [============================] 100%file /home/peter/dev/php/opensource/limonade/examples/example06/index.php is not valid and has been skipped

Magento

3361/9868 [=========>------------------]  34%file ../../opensource/magento2/lib/internal/Zend/Mail/Protocol/Pop3.php is not valid and has been skipped

Pagekit

102/215 [=============>--------------]  47%file /home/peter/dev/php/opensource/pagekit/extensions/system/src/System/Console/skeleton/extension/src/Controller/SiteController.php is not valid and has been skipped
103/215 [=============>--------------]  47%file /home/peter/dev/php/opensource/pagekit/extensions/system/src/System/Console/skeleton/extension/src/DefaultExtension.php is not valid and has been skipped
105/215 [=============>--------------]  48%file /home/peter/dev/php/opensource/pagekit/extensions/system/src/System/Console/skeleton/theme/src/DefaultTheme.php is not valid and has been skipped

Symfony 1

199/1320 [====>-----------------------]  15%file /home/peter/dev/php/opensource/symfony1/lib/task/generator/skeleton/module/module/actions/actions.class.php is not valid and has been skipped
205/1320 [====>-----------------------]  15%file /home/peter/dev/php/opensource/symfony1/lib/task/generator/skeleton/app/web/index.php is not valid and has been skipped
206/1320 [====>-----------------------]  15%file /home/peter/dev/php/opensource/symfony1/lib/task/generator/skeleton/app/app/config/ApplicationConfiguration.class.php is not valid and has been skipped
397/1320 [========>-------------------]  30%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/skeleton/lib/helper.php is not valid and has been skipped
398/1320 [========>-------------------]  30%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/skeleton/lib/configuration.php is not valid and has been skipped
399/1320 [========>-------------------]  30%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/skeleton/actions/actions.class.php is not valid and has been skipped
445/1320 [=========>------------------]  33%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/default/skeleton/actions/actions.class.php is not valid and has been skipped
652/1320 [=============>--------------]  49%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/skeleton/lib/helper.php is not valid and has been skipped
653/1320 [=============>--------------]  49%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/skeleton/lib/configuration.php is not valid and has been skipped
654/1320 [=============>--------------]  49%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/skeleton/actions/actions.class.php is not valid and has been skipped
700/1320 [==============>-------------]  53%file /home/peter/dev/php/opensource/symfony1/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/skeleton/actions/actions.class.php is not valid and has been skipped

Typo3

76/2583 [>---------------------------]   2%
                                  
[Exception]                         
Closure detected instead of method