Install any skill in seconds. Free to start, no credit card required.
Get Started Free →managedcode/crap-score
Calculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET method, class, or single source file.
Passed 15 of 18 test cases with the skill, and 13 of 18 without it.
2 fixed16 passed either way4 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
How should methods with CRAP scores of 4.5, 12.0, 22.5, and 35.0 be categorized in terms of risk level?
| Checked | Without skill | With skill |
|---|---|---|
| Classifies a CRAP score of 35.0 as Critical | Missed | Passed |
| Classifies a CRAP score of 4.5 as Low | Passed | Passed |
The instructions your model reads when the skill loads.
Calculate CRAP (Change Risk Anti-Patterns) scores for .NET methods to identify code that is both complex and undertested.
The CRAP score combines cyclomatic complexity and code coverage into a single metric:
$$\text{CRAP}(m) = \text{comp}(m)^2 \times (1 - \text{cov}(m))^3 + \text{comp}(m)$$
Where:
| CRAP Score | Risk Level | Interpretation |
|---|---|---|
| < 5 | Low | Simple and well-tested |
| 5-15 | Moderate | Acceptable for most code |
| 15-30 | High | Needs more tests or simplification |
| > 30 | Critical | Refactor and add coverage urgently |
A method with 100% coverage has CRAP = complexity (the minimum). A method with 0% coverage has CRAP = complexity^2 + complexity.
run-tests skill)writing-mstest-tests skill or general coding assistance)| Input | Required | Description |
test cases passed, vs 13 / 18 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.