crap-analysis

Analyze .NET code for CRAP scores and generate coverage reports.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill crap-analysis-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crap-analysis
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/crap-analysis
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill crap-analysis-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps identify high-risk code by analyzing complexity and test coverage, allowing developers to prioritize refactoring and testing efforts effectively.

Core Features & Use Cases

  • CRAP Score Calculation: Computes the Change Risk Anti-Patterns score (Complexity x (1 - Coverage)^2).
  • Risk Hotspot Identification: Pinpoints methods with high complexity and low test coverage.
  • Coverage Setup: Guides users on configuring coverage.runsettings for OpenCover format.
  • Report Generation: Uses ReportGenerator to create HTML, text, and Markdown summaries.
  • CI/CD Integration: Provides examples for GitHub Actions and Azure Pipelines.

Quick Start

Run the provided bash command to collect coverage, generate a report, and view the summary.

Frequently Asked Questions about crap-analysis

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

FAQPage Schema
What is a CRAP score in code quality analysis?

The CRAP score formula combines complexity and coverage to pinpoint methods needing immediate testing and refactoring to reduce maintenance risks.

How do I calculate CRAP scores for .NET code?

This process identifies risk hotspots by evaluating methods with high complexity and low test coverage to guide your refactoring strategy.

Can I integrate CRAP score analysis into CI/CD pipelines?

Automating this reporting ensures continuous monitoring of risky code sections throughout your software development lifecycle.

What formats does ReportGenerator output for code coverage summaries?

These formats facilitate easy integration into documentation and CI/CD reporting dashboards for ongoing code quality monitoring.

How do I identify risk hotspots in my codebase before refactoring?

Pinpointing these high-risk sections allows you to effectively prioritize testing and refactoring efforts where they are needed most.

Does this CRAP analysis skill work outside of .NET environments?

Using it outside .NET would require adapting the coverage setup and CI/CD integration examples to fit a different tech stack.