PhpMetrics is a static analysis tool for PHP. It provides tons of metrics:
- Complexity: Cyclomatic complexity, Myer's interval, Relative system complexity
- Volume: Vocabulary, Data complexity, Lines of code, Readability...
- Object Oriented: Lack of cohesion of methods, Coupling, Abstraction...
- Maintainability: Maintainability index, Halstead's metrics, Effort...
- And more !
Basic usage using current user.
docker run --rm \
--user $(id -u):$(id -g) \
--volume /local/path:/project \
herloct/phpmetrics[:tag] [<options>]
For example, to generate metrics of our src
directory.
docker run --rm \
--user $(id -u):$(id -g) \
--volume /local/path:/project \
herloct/phpmetrics --report-html=build/metrics src
- /project: Your PHP project directory.