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
CMS
E-commerce
Other
Project | Maintenability | Report | Repository | Last commit (master) |
---|
piwik | | report | repo | within 1 week |
Backfire
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