タグ: #php
phpmd
if文のネスト階層数などの複雑さ、短すぎる、または長すぎる変数名や、使われていない変数の検出など様々な条件に応じて検出を行ってくれます。
$ phpmd /path/to/project text codesize,unusedcode,naming /path/to/project/hoge/huga/AAA.php:76 Avoid unused local variables such as '$foo'. /path/to/project/hoge/huga/AAA.php:129 Avoid unused local variables such as '$bar'. /path/to/project/hoge/huga/AAA.php:185 Avoid unused local variables such as '$foo'. /path/to/project/hoge/huga/BBB.class.php:29 Too many fields /path/to/project/hoge/huga/foo/CCC.php:20 Avoid variables with short names like $a /path/to/project/hoge/huga/foo/CCC.php:20 Avoid variables with short names like $b /path/to/project/hoge/huga/foo/EEE.php:5 The method create() has a Cyclomatic Complexity of 12. /path/to/project/hoge/huga/foo/EEE.php:5 The method create() has an NPath complexity of 288. /path/to/project/hoge/huga/foo/FFF.php:10 Avoid unused local variables such as '$type'. /path/to/project/hoge/huga/foo/GGG.php:7 Avoid unused private fields such as '$object'. /path/to/project/hoge/huga/bar/HHH.php:64 Avoid unused parameters such as '$status'. /path/to/project/hoge/huga/bar/HHH.php:74 Avoid unused private methods such as 'setStatus'. /path/to/project/hoge/huga/bar/JJJ.php:26 Avoid unused parameters such as '$status'. /path/to/project/hoge/huga/bar/KKK.php:3 This class has too many methods, consider refactoring it. /path/to/project/hoge/huga/bar/KKK.php:13 Avoid unused parameters such as '$status'. /path/to/project/hoge/huga/bar/LLL.php:44 Avoid unused parameters such as '$status'.
ウノウラボ by Zynga Japan: PHPで利用出来るテストと開発に便利なツール
テストや普段の開発に便利なツール
1年前 | 固定リンク | 2011年 3月 25日 | 
