dotnet-techne-crap-analysis

Solid

Use when you need CRAP score and coverage risk analysis to find high-risk code before refactoring or release. Keywords: CRAP score, risk hotspots, cyclomatic complexity, test coverage gaps, coverage threshold.

AI & Automation 12 stars 1 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
37
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# CRAP Score Analysis ## When to Use This Skill Use this skill when: - Evaluating code quality and test coverage before changes - Identifying high-risk code that needs refactoring or testing - Setting up coverage collection for a .NET project - Prioritizing which code to test based on risk - Establishing coverage thresholds for CI/CD pipelines --- ## What is CRAP? **CRAP Score = Complexity x (1 - Coverage)^2** The CRAP (Change Risk Anti-Patterns) score combines cyclomatic complexity with test coverage to identify risky code. | CRAP Score | Risk Level | Action Required | |------------|------------|-----------------| | **< 5** | Low | Well-tested, maintainable code | | **5-30** | Medium | Acceptable but watch complexity | | **> 30** | High | Needs tests or refactoring | ### Why CRAP Matters - **High complexity + low coverage = danger**: Code that's hard to understand AND untested is risky to modify - **Complexity alone isn't enough**: A complex method with 100% coverage is safer than a simple method with 0% - **Focuses effort**: Prioritize testing on complex code, not simple getters/setters ### CRAP Score Examples | Method | Complexity | Coverage | Calculation | CRAP | |--------|------------|----------|-------------|------| | `GetUserId()` | 1 | 0% | 1 x (1 - 0)^2 | **1** | | `ParseToken()` | 54 | 52% | 54 x (1 - 0.52)^2 | **12.4** | | `ValidateForm()` | 20 | 0% | 20 x (1 - 0)^2 | **20** | | `ProcessOrder()` | 45 | 20% | 45 x (1 - 0.20)^2 | **28.8** | | `ImportData()...

Details

Author
Metalnib
Repository
Metalnib/dotnet-episteme-skills
Created
6 months ago
Last Updated
2 days ago
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category