Start with the big red circles.
A class that is both complex and hard to maintain is where bugs hide and estimates slip. The report shows you which ones, and tells you why: cyclomatic complexity, lack of cohesion, coupling, the probable number of bugs.
Large and red. Complex, hard to change. Look here first.
Amber. Worth watching.
Small and green. Leave it alone.
searches:
Repository calling a service:
type: class
nameMatches: ".*Repository.*"
usesClasses: [".*Service"]
failIfFound: true
Class too complex:
type: class
ccn: ">=10"
failIfFound: true
Then make sure it stays fixed.
Write down the rules your architecture should follow. When a pull request breaks one, the build fails and says which class did it.
Violations are also written in the PMD format, which your CI already knows how to read.
Your code stays home.
No account, no upload, no server to trust. PhpMetrics reads your code on your machine and writes a folder of plain HTML that opens without a connection.
The one request it makes asks Packagist whether your Composer dependencies are up to date. A single flag turns it off.
# nothing leaves this machine
vendor/bin/phpmetrics \
--composer=false \
--report-html=report src