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

ProjectMaintenabilityReportRepositoryLast commit (master)
agavimaintainablityreportrepowithin 4 months
auramaintainablityreportrepowithin 1 week
cakephpmaintainablityreportrepowithin 1 week
codeignitermaintainablityreportrepowithin 1 week
deanomaintainablityreportrepowithin 10 months
fatfreemaintainablityreportrepowithin 1 month
flightmaintainablityreportrepowithin 2 weeks
fuelphpmaintainablityreportrepowithin 2 months
laravelmaintainablityreportrepowithin 2 weeks
limonademaintainablityreportrepowithin 2 months
nettemaintainablityreportrepowithin 1 week
phavourmaintainablityreportrepowithin 6 months
php-mvc (advanced)maintainablityreportrepowithin 2 weeks
phpixiemaintainablityreportrepowithin 5 months
popphp2maintainablityreportrepowithin 3 weeks
silexmaintainablityreportrepowithin 1 week
slimmaintainablityreportrepowithin 5 months
symfony1maintainablityreportrepowithin 2 years
symfony2maintainablityreportrepowithin 1 week
typo3maintainablityreportrepowithin 1 week
yii1maintainablityreportrepowithin 2 weeks
yii2maintainablityreportrepowithin 1 week
zf1maintainablityreportrepowithin 1 week
zf2maintainablityreportrepowithin 2 weeks

CMS

ProjectMaintenabilityReportRepositoryLast commit (master)
drupalmaintainablityreportrepowithin 1 week
joomlamaintainablityreportrepowithin 5 months
gravmaintainablityreportrepowithin 1 week
pagekitmaintainablityreportrepowithin 1 week
os webasyst projectsmaintainablityreportN/AN/A
wordpressmaintainablityreportrepowithin 1 week

E-commerce

ProjectMaintenabilityReportRepositoryLast commit (master)
magento1 (1.8 copy)maintainablityreportrepoN/A
magento2maintainablityreportrepowithin 1 week
opencartmaintainablityreportrepowithin 1 week
oscommercemaintainablityreportrepowithin 2 years
prestashopmaintainablityreportrepowithin 1 week
syliusmaintainablityreportrepowithin 10 months
virtuemartmaintainablityreportrepoN/A
zencartmaintainablityreportrepowithin 1 week

Development Tools

ProjectMaintenabilityReportRepositoryLast commit (master)
codeceptionmaintainablityreportrepowithin 1 week
phpunitmaintainablityreportrepowithin 1 week

Other

ProjectMaintenabilityReportRepositoryLast commit (master)
piwikmaintainablityreportrepowithin 1 week

Backfire

ProjectMaintenabilityReportRepositoryLast commit (master)
dm-mailermaintainablityreportrepowithin 7 months
phpmetricsmaintainablityreportrepowithin 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