如果我运行phploc
对我的PHP项目(开源)之一,我看到这个输出。
phploc 1.6.4 by Sebastian Bergmann.
Directories: 3
Files: 33
Lines of Code (LOC): 2358
Cyclomatic Complexity / Lines of Code: 0.08
Comment Lines of Code (CLOC): 903
Non-Comment Lines of Code (NCLOC): 1455
Namespaces: 0
Interfaces: 3
Classes: 28
Abstract: 1 (3.57%)
Concrete: 27 (96.43%)
Average Class Length (NCLOC): 49
Methods: 149
Scope:
Non-Static: 128 (85.91%)
Static: 21 (14.09%)
Visibility:
Public: 103 (69.13%)
Non-Public: 46 (30.87%)
Average Method Length (NCLOC): 9
Cyclomatic Complexity / Number of Methods: 1.69
Anonymous Functions: 0
Functions: 3
Constants: 9
Global constants: 0
Class constants: 9
有了这个静态分析如何判断是否该代码库是好还是坏? 或如何好或不好写?
- 是圈复杂度好,如果它太低或太高?
- 有
3.57%
抽象类是好还是坏? -
14.09%
的静态方法。 它应该是对OOP代码库低? - 有没有使用命名空间,是好还是坏?
最后一个问题你如何分析一个代码库与phploc的输出?