Repository navigation
Conversation
CRAP (Change Risk Anti-Patterns) combines cyclomatic complexity with test coverage: cc^2 * (1 - cov)^3 + cc. It is computed at output time from the existing complexity and coverage data, so no analysis types change. - JSON: metrics.crap is a number with coverage data and null without it, so consumers can parse the key unconditionally. - Terminal and LLM markdown output show it next to coverage. - [crap].coverage_source selects direct (default) or transitive coverage.
This was referenced Oct 12, 2026
This was referenced Oct 13, 2026
V3 schemas reject the new field. The terminal coverage line and the LLM markdown section now show a score when one is present.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
complexity² × (1 − coverage)³ + complexity) per function.metrics.crap), the terminal COVERAGE section, and LLM markdown.[crap].This is PR 1 of 3. Next: LLM editability (#149, stacked on this PR).
Test plan
risk::crapoutput_validation_test, library tests for output, formatters and configNot yet done
[crap]section (coverage source) and the CRAP score in the output formats.How to stack these
These pull requests target
master. From a clone ofiepathos/debtmap, link them bottom to top, then merge the stack:gh stack linkrecords the stack on GitHub.gh stack mergemerges that stack in one step. Pass a pull request number to stop at that pull request. Order: CRAP scores (#148), editability (#149), churn (#150), topics (#151), content reverts (#152).