PHP code cleaning tools.

PHP LOC statistics:
1. wget --no-check-certificate https://phar.phpunit.de/phploc.phar
2. /opt/lampp/bin/php phploc.phar --exclude="lib" --exclude="Resources" /mnt/data/MyWebProject/ > loc.txt

PHP Mess Detector:
1. Download http://static.phpmd.org/php/2.1.1/phpmd.phar
2. /opt/lampp/bin/php phpmd.phar /mnt/data/MyWebProject/ text codesize --exclude lib,Resources --reportfile code_complexity.txt
[output format: text; available mess detectors: cleancode, codesize, controversial, design, naming, unusedcode]

PHP Code Sniffer (Enforces a coding standard):
1. Download http://download.pear.php.net/package/PHP_CodeSniffer-2.0.0RC1.tgz
2. /opt/lampp/bin/php PHP_CodeSniffer-2.0.0RC1/scripts/phpcs --report-file=code_sniff.txt --standard=Generic --extensions=php --ignore=*/lib/*,*/Resources/* /mnt/data/MyWebProject/

PHP Dead Code Detector:
1. wget --no-check-certificate https://phar.phpunit.de/phpdcd.phar
2. /opt/lampp/bin/php phpdcd.phar --recursive --exclude="lib" --exclude="Resources" /mnt/data/MyWebProject/ > dead_code.txt

PHP Copy Paste Detector
1. wget --no-check-certificate https://phar.phpunit.de/phpcpd.phar
2. /opt/lampp/bin/php phpcpd.phar --exclude="lib" --exclude="Resources" /mnt/data/MyWebProject/ > copy_paste.txt

No comments: