crap-analysis

Evaluate .NET methods by CRAP score using OpenCover coverage data.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/MudraMartin/dotlight-skillset --skill crap-analysis-mudramartin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crap-analysis
Source: https://github.com/MudraMartin/dotlight-skillset/tree/main/dotnet/crap-analysis
Command: npx skills add https://github.com/MudraMartin/dotlight-skillset --skill crap-analysis-mudramartin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill uses the CRAP (Change Risk Anti-Patterns) quality gate to flag high-complexity, untested .NET code, helping to prioritize refactoring or testing efforts.

Core Features & Use Cases

  • CRAP Score Calculation: Combines cyclomatic complexity and test coverage to generate a risk score.
  • Risk Assessment: Identifies methods that require refactoring or testing.
  • Integration: Works with coverage collection tools like OpenCover and ReportGenerator.

Quick Start

Analyze your code coverage by running 'crap-analysis analyze'.

Frequently Asked Questions about crap-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate the CRAP score for my .NET code?

To calculate the CRAP score for .NET code, the Skill combines cyclomatic complexity and test coverage metrics to generate a risk score. It evaluates C# applications to identify methods that require refactoring or additional testing.

What is the CRAP quality gate in software engineering?

The CRAP quality gate flags high-complexity, untested .NET code to help prioritize refactoring or testing efforts. It uses the Change Risk Anti-Patterns metric to assess risk based on code complexity and coverage.

Does this CRAP analysis tool work with OpenCover for .NET test coverage?

Yes, this CRAP analysis tool is compatible with OpenCover for coverage analysis and integrates with ReportGenerator. It uses the collected coverage data to evaluate C# methods and categorize them by risk.

How do I identify risky .NET code for refactoring?

You identify risky .NET code for refactoring by running the 'crap-analysis analyze' command. This evaluates your codebase for high complexity and low test coverage, categorizing methods by their CRAP score to target refactoring efforts.

What are the limitations of using the CRAP score for risk assessment?

The CRAP score risk assessment is limited to evaluating .NET code based strictly on cyclomatic complexity and test coverage. It identifies risky methods for potential refactoring but does not evaluate architectural design flaws or runtime performance issues.