Monday, February 13, 2012

Interesting tools for PHP code metrics, detectors

http://stackoverflow.com/questions/5611736/calculate-software-metrics-for-php-projects

PHP Depend generates some nice metrics for you.

Here are those I can think about :

phpcpd -- copy-paste detector
phploc -- to do many kind of counts (lines, classes, ...)
PHP_CodeSniffer -- to check if your code respects your coding standards.
phpmd -- mess detector
phpDocumentor / DocBlox to generate documentation (and detect what is not properly documented)

In PHP, those tools are generally not used from Eclipse, but integrated in some Continuous Integration Plateform.

About those, you can take a look at :

phpUnderControl -- was used a lot a couple of years ago -- it has less success now
Jenkins (More or less a fork of Hudson)
And, for that one, see Template for Jenkins Jobs for PHP Projects
Still, if you want to integrate some of those tools with Eclipse PDT, you might want to take a look at PHP Tool Integration.





See our PHP CloneDR for a tool that computes the amount and the precise location of duplicated code. It will find duplicates in spite of reformatting the text, modification of comments, and modifications (up to a degree of [dis]similarity.

There's an example of Joomla processed by the PHP CloneDR at the link.

Digital Inspiration Technology Guide

Change the world with your passion