If I run phploc
against one of my PHP project (open source) I see this output.
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
With this static analysis how do tell if this code-base is good or bad? Or how well or badly written?
- Is cyclomatic complexity good if its too low or high ?
- Having
3.57%
abstract class is good or bad ? 14.09%
static methods. Should it be lower on OOP code-base?- There is no namespace used, is it good or bad ?
The final question How do you analyse a code-base with phploc's output?