// the find
unclebob/crap4java
Crap analyzer for my java projects.
A standalone CRAP (Change Risk Anti-Patterns) metric calculator for Java, combining cyclomatic complexity with JaCoCo coverage to flag methods that are both complex and undertested. It's aimed at teams already on Maven who want a CI gate on code quality beyond raw coverage percentages.
The class breakdown (parser, analyzer, coverage runner, formatter all separate) maps cleanly to the pipeline stages and each has its own test file, which is a good sign for a metrics tool where correctness of the math actually matters. Exit code 2 on threshold breach makes it trivial to wire into a CI build step without extra scripting. Handles missing JaCoCo XML gracefully by reporting N/A instead of crashing or reporting misleading zero coverage.
Maven-only — the coverage runner shells out to a hardcoded mvn/jacoco-maven-plugin command, so Gradle projects are out of luck entirely. It deletes and regenerates coverage artifacts on every single invocation, meaning every run pays the full test-suite cost even if you just want to recheck one file with --changed. The CRAP threshold (8.0) is hardcoded rather than configurable via CLI flag or config file, so teams with different risk tolerances have to fork it. It's a 0.1.0-SNAPSHOT with no published artifact — you're building the jar yourself, not pulling from Maven Central.