PHP Metrics : Static analysis tool for PHP

0
2696

Quality assurance is a key element to make your PHP code clean, simple, easy to maintain, secure and free of bugs ! One of the great tools that you can use to analyse the quality of your PHP code is : PHP Metrics.  An open source static analysis tool for PHP,  providing a bunch of metrics in one single tool :

  • maintainability Index
  • Cyclomatic complexity
  • Halstead’s metrics
  • Lack of cohesion of methods
  • Abstraction/Instability
  • and more…

PhpMetrics_report_-_by_Jean-François_Lépine_-_2014-12-23_08.38.22

A plugin is available to use PHP metrics with PHPStorm IDE, but also it’s easy to integrate it with the open-source continuous integration server Jenkins.

PHP metrics is released under a MIT License, you can get it from github :
wget https://github.com/Halleck45/PhpMetrics/raw/master/build/phpmetrics.phar
chmod +x phpmetrics.phar
mv phpmetrics.phar /usr/local/bin/phpmetrics

Overall it’s a great and neat tool that can help you make high quality code.

NO COMMENTS

LEAVE A REPLY