crap-score

Compute CRAP scores from cyclomatic complexity and Cobertura XML coverage.

2|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/sayedihashimi/copilot-skill-eval --skill crap-score
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crap-score
Source: https://github.com/sayedihashimi/copilot-skill-eval/tree/main/examples/aspnet-razor-pages/plugins/dotnet-skills/dotnet-test/skills/crap-score
Command: npx skills add https://github.com/sayedihashimi/copilot-skill-eval --skill crap-score

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CRAP score analysis helps identify code that is both complex and undertested by combining cyclomatic complexity with test coverage data, enabling teams to focus testing and refactoring efforts where they matter most.

Core Features & Use Cases

  • Compute per-method, per-class, or per-file CRAP scores using cyclomatic complexity and Cobertura XML coverage data.
  • Generate a sorted report of methods by CRAP score with risk levels and actionable recommendations for test improvements or refactoring.
  • Provide a coverage target calculation to bring high-CRAP methods under a desired threshold, guiding test strategy.

Quick Start

Run an initial CRAP analysis on your .NET project to surface high-risk areas and prioritize testing.

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 a .NET codebase to prioritize testing?

You can calculate CRAP scores for a .NET codebase by combining cyclomatic complexity data with Cobertura XML test coverage data. This analysis identifies complex, undertested methods to help prioritize testing and refactoring efforts where they matter most.

What is a CRAP score and how does it identify risky code?

A CRAP score quantifies code risk by combining cyclomatic complexity with test coverage data. It identifies high-risk areas that are both highly complex and undertested, enabling teams to focus their test improvements and refactoring strategies effectively.

Can I analyze CRAP scores at the method, class, or file level?

Yes, you can compute CRAP scores at the method, class, or file scope. The analysis parses source code to determine complexity and outputs a sorted report of top offenders with risk levels and actionable remediation guidance.

How do I use Cobertura XML coverage data to find untested complex code?

The tool reads Cobertura XML coverage data and combines it with cyclomatic complexity metrics parsed from your source code. It generates a sorted report highlighting high-risk, complex, and undertested methods alongside calculated coverage targets to guide your test strategy.

Does the CRAP score analysis tool provide refactoring recommendations?

Yes, the tool provides actionable recommendations for test improvements or refactoring. It outputs a sorted report of methods by CRAP score, includes risk levels, and calculates the coverage target needed to bring high-CRAP methods under your desired threshold.

What is the best way to guide test strategy for complex .NET projects?

The best way to guide test strategy is to compute CRAP scores using cyclomatic complexity and test coverage data. This surfaces high-risk areas in your .NET projects and provides coverage target calculations to bring complex, undertested code under control.