1、phpmd环境安装:https://phpmd.org/download/index.html
文件存放在~/phpmd
curl -s http://getcomposer.org/installer | php
composer.json:{ "require-dev": { "jaeger/querylist":"^3.2.1", "phpmd/phpmd" : "@stable" } }
php composer.phar install
2、检测语法
phpmd/vendor/bin/phpmd ~src/name/actions/ xml cleancode,codesize,design,naming,unusedcode --suffixes php --reportfile ret.xml