crap-score

Installation
SKILL.md

CRAP Score Analysis

Calculate CRAP (Change Risk Anti-Patterns) scores for .NET methods to identify code that is both complex and undertested.

Background

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:

  • $\text{comp}(m)$ = cyclomatic complexity of method $m$
  • $\text{cov}(m)$ = code coverage ratio (0.0 to 1.0) of method $m$
CRAP Score Risk Level Interpretation
< 5 Low Simple and well-tested
5-15 Moderate Acceptable for most code
Related skills
Installs
3
GitHub Stars
371
First Seen
Apr 11, 2026