crap-analysis

Analyze .NET code quality metrics to identify high-risk CRAP score hotspots.

1.1k|101|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill crap-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crap-analysis
Source: https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/crap-analysis
Command: npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill crap-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill analyzes code quality metrics to identify high-risk code paths by evaluating CRAP scores and test coverage, enabling teams to target refactoring and testing efforts.

Core Features & Use Cases

  • CRAP score computation: combines complexity and coverage to surface risky methods.
  • OpenCover + ReportGenerator integration: uses standard OpenCover format and HTML/CSV reports to identify hotspots.
  • Use Case: Before deploying changes in a .NET project, run this skill to pinpoint risky modules that require tests or refactoring.

Quick Start

Run a CRAP analysis using your project's OpenCover results to generate a risk hotspot report.

Frequently Asked Questions about crap-analysis

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

FAQPage Schema
How do I identify high-risk code paths using CRAP scores in .NET?

CRAP scores combine code complexity and test coverage metrics to pinpoint methods with high risk. By evaluating OpenCover data and ReportGenerator outputs, this analysis identifies specific code paths in .NET projects that require immediate testing or refactoring.

What is a CRAP score and how does it indicate risk hotspots?

A CRAP score indicates risk hotspots by combining cyclomatic complexity with low code coverage. High scores reveal methods that are both difficult to test and heavily untested, guiding teams to prioritize specific modules for unit and integration tests.

How do I generate a risk hotspot report from OpenCover data?

Generating a risk hotspot report from OpenCover data requires using ReportGenerator to produce HTML or CSV outputs. The analysis processes these standard formats to deliver a CRAP score breakdown with actionable recommendations for targeted refactoring.

Do I need ReportGenerator outputs to perform a CRAP analysis?

Yes, performing a CRAP analysis requires OpenCover-compatible coverage data and a generated ReportGenerator report. These inputs provide the necessary test coverage metrics and complexity data to accurately compute CRAP scores and identify hotspots.

When should I run a CRAP analysis on my .NET project?

You should run a CRAP analysis on your .NET project before deploying changes to pinpoint risky modules. It evaluates unit and integration test coverage to guide targeted refactoring efforts, ensuring high-risk code paths are addressed early.