PHPLOC 是一个快速测量PHP项目大小和分析结构的工具。
此工具是以 PHPArchive(PHAR) 的形式分发的:
$wgethttps://phar.phpunit.de/phploc.phar$phpphploc.phar--version使用 Phive 是管理项目工具依赖项的推荐方式:
$phiveinstallphploc$./tools/phploc--version不建议使用Composer下载安装此工具。
示例:$phpphploc.pharsrcphploc7.0.0bySebastianBergmann.Directories3Files10SizeLinesofCode(LOC)1882CommentLinesofCode(CLOC)255(13.55%)Non-CommentLinesofCode(NCLOC)1627(86.45%)LogicalLinesofCode(LLOC)377(20.03%)Classes351(93.10%)AverageClassLength35MinimumClassLength0MaximumClassLength172AverageMethodLength2MinimumMethodLength1MaximumMethodLength117Functions0(0.00%)AverageFunctionLength0Notinclassesorfunctions26(6.90%)CyclomaticComplexityAverageComplexityperLLOC0.49AverageComplexityperClass19.60MinimumClassComplexity1.00MaximumClassComplexity139.00AverageComplexityperMethod2.43MinimumMethodComplexity1.00MaximumMethodComplexity96.00DependenciesGlobalAccesses0GlobalConstants0(0.00%)GlobalVariables0(0.00%)Super-GlobalVariables0(0.00%)AttributeAccesses85Non-Static85(100.00%)Static0(0.00%)MethodCalls280Non-Static276(98.57%)Static4(1.43%)StructureNamespaces3Interfaces1Traits0Classes9AbstractClasses0(0.00%)ConcreteClasses9(100.00%)Methods130ScopeNon-StaticMethods130(100.00%)StaticMethods0(0.00%)VisibilityPublicMethods103(79.23%)Non-PublicMethods27(20.77%)Functions0NamedFunctions0(0.00%)AnonymousFunctions0(0.00%)Constants0GlobalConstants0(0.00%)ClassConstants0(0.00%)
评论