01
Measure the function
Combine cyclomatic complexity with test coverage using the existing CRAP metric. Where coverage is unavailable, show complexity on its own rather than imply that testing was measured.
Open-source developer tool
Know where the code needs attention.
crapkit brings complexity, test coverage and change history together to help developers and coding agents decide what to improve next.
$ crapkit worklist
classifycalc/grade.py:7One function. Complexity and test coverage, in view.
The problem
Code can be easy to generate and hard to change with confidence. A passing test suite or a repository-wide coverage percentage does not tell you which functions combine complicated logic with gaps in testing.
I created crapkit to make that work visible at the function level, and to make the same evidence usable by people, coding agents and automated checks.
01
Combine cyclomatic complexity with test coverage using the existing CRAP metric. Where coverage is unavailable, show complexity on its own rather than imply that testing was measured.
02
Use change history to rank the work. A complicated function that changes often deserves a different level of attention from code that rarely moves.
03
Record existing debt as a baseline, then check changes against it. The ratchet allows recorded scores to improve but prevents them from rising.
Use it from the command line, connect a coding agent through MCP, or run it in a GitHub Actions workflow. Analysis and scoring run locally without telemetry; configured test and other commands retain their own behavior.
Behind the tools
My writing explores human agency, intent and accountability. crapkit addresses one practical part of building software: making the evidence for code changes easier to inspect.