crap-score

Calculate CRAP scores for .NET methods using cyclomatic complexity and Cobertura XML coverage data.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ojrojas/AgentsInstructions --skill crap-score-ojrojas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crap-score
Source: https://github.com/ojrojas/AgentsInstructions/tree/main/.claude/skills/dotnet-test/skills/crap-score
Command: npx skills add https://github.com/ojrojas/AgentsInstructions --skill crap-score-ojrojas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dotnet-test, coverlet.collector, Cobertura, and includes scripts (resource) and references (resource) components.

What problem does it solve?

The crap-score Skill identifies risky .NET code that is both complex and undertested, helping developers prioritize testing efforts.

Core Features & Use Cases

  • CRAP Score Calculation: Computes CRAP scores based on cyclomatic complexity and code coverage for .NET methods, classes, or files.
  • Risk Assessment: Determines the risk level of code based on CRAP scores, guiding developers on which code needs attention.
  • Use Case: When a developer wants to quickly assess the riskiness of a specific method, class, or file in a .NET project.

Quick Start

Run the crap-score skill with the target method or file, e.g., 'crap-score OrderService.ProcessOrder'.

Frequently Asked Questions about crap-score

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

FAQPage Schema
How do I calculate CRAP scores for .NET methods to find risky untested code?

To calculate CRAP scores for .NET methods, the Skill analyzes cyclomatic complexity and code coverage data. It identifies risky, undertested code that requires more testing attention by processing Cobertura XML from your test coverage data.

What is a CRAP score and how does it assess code risk?

A CRAP score, or Change Risk Anti-Patterns score, assesses code risk by combining cyclomatic complexity with code coverage metrics. It determines the risk level of .NET methods, helping developers prioritize testing efforts.

Do I need Cobertura XML to run a CRAP score analysis on my .NET project?

Yes, you need Cobertura XML to run a CRAP score analysis on your .NET project. The Skill requires test coverage data generated by dependencies like dotnet-test and coverlet.collector to perform the risk assessment.

Can I assess the risk of a specific class or file instead of the whole project?

Yes, you can assess the risk of a specific class or file instead of the whole project. You can run the analysis targeting a specific method, class, or file, such as 'OrderService.ProcessOrder' to get its CRAP score.

What's the best way to prioritize testing efforts in a complex .NET codebase?

The best way to prioritize testing efforts is by calculating CRAP scores to identify complex, undertested .NET methods. This risk assessment highlights exactly which code requires immediate testing attention based on coverage and complexity.