Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Calculates CRAP (Change Risk Anti-Patterns) scores for .NET methods, classes, or files using Cobertura coverage and cyclomatic complexity.
73% 82%+9 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 16 of 22 without it.
How should methods with CRAP scores of 4.5, 12.0, 22.5, and 35.0 be categorized in terms of risk level?
Classifies a CRAP score of 35.0 as Critical
3 of 3 safety checks passed
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 |
Published skills whose descriptions closely match this one, with their benchmark result.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.