Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Calculates CRAP scores for a named .NET method, class, or file from its complexity and test coverage.
64% 91%+27 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 14 of 22 without it.
We are evaluating a legacy non-SDK .NET Framework project (`MyLegacyApp.csproj` using `ToolsVersion="14.0"` and `packages.config`). We want to calculate CRAP scores, but no coverage XML exists. Should we install Coverlet NuGet package into the csproj or upgrade it to SDK style?
Requests a user-provided Cobertura XML report or repository-provided coverage tool execution
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 to < 15 | Moderate | Acceptable for most code |
| 15 to 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)code-testing)coverage-analysis)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.