PHP Mess Detector¶
[PHPMD] is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly and easy to configure frontend for the raw metrics measured by PHP Depend.
http://phpmd.org/
While you can run PHP Mess Detector, most of its checks are redundant with the code rating that PHP Scrutinizer does.
In particular for design issues, we believe a rating gives a better idea of the state and progression of a project than having a hard issue once a certain threshold is reached.
For example, if you compare two methods one with a complexity of 10 and another one with a complexity of 100, PHP Mess Detector would still raise a single issue for both. However, the method with higher complexity is likely to need more attention than the method with just 10 complexity.
This is not a fault of PHP Mess Detector, but a limitation in most build systems. Hence, Scrutinizer has special handling for these design issues through its code rating.
Configuration¶
build:
nodes:
analysis:
# This is only needed if you do not already have phpmd in your composer dependencies.
dependencies:
after:
- composer require phpmd/phpmd
tests:
override:
- command: vendor/bin/phpmd --reportfile /tmp/phpmd.xml
analysis:
file: /tmp/phpmd.xml
format: general-checkstyle