coverage-analysis

Analyzes .NET code coverage and computes CRAP scores to rank risk hotspots.

1|Updated Jul 27, 2026
One-click install
npx skills add https://github.com/FittyAr/Cardscape --skill coverage-analysis-fittyar
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coverage-analysis
Source: https://github.com/FittyAr/Cardscape/tree/main/.agents/skills/coverage-analysis
Command: npx skills add https://github.com/FittyAr/Cardscape --skill coverage-analysis-fittyar

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Raw coverage percentages tell you what code was executed but not which uncovered code is risky, why coverage has plateaued, or which methods are dangerous to refactor. This Skill turns a .NET solution or existing Cobertura XML into a prioritized risk-hotspot report. ## Core Features & Use Cases - CRAP Score Analysis: Computes Change Risk Anti-Patterns scores per method (complexity² × (1 − coverage)³ + complexity) and ranks the top risk hotspots. - Automated Coverage Collection: Detects Coverlet vs Microsoft CodeCoverage providers per test project, adds a provider when missing, and runs dotnet test with Cobertura output. - Coverage Gap Reporting: Produces a markdown report with coverage gaps by file, priority levels, and quantified test recommendations; optionally generates ReportGenerator HTML/CSV reports. - Use Case: Your solution is stuck at 62% line coverage. Run this Skill to discover that three methods with complexity above 15 and zero coverage account for most of the risk, and get a ranked list of which tests to write first. ## Quick Start Analyze the code coverage and CRAP risk hotspots for the .NET solution in the current directory.

Frequently Asked Questions about coverage-analysis

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

FAQPage Schema
How do I analyze code coverage and CRAP scores in a .NET project?▼

Run this Skill against your solution path. It detects the coverage provider, runs dotnet test with Cobertura output, computes CRAP scores per method with the bundled PowerShell scripts, and returns a ranked risk-hotspot report.

What is a CRAP score and how is it calculated?▼

CRAP (Change Risk Anti-Patterns) combines cyclomatic complexity and coverage: complexity² × (1 − coverage)³ + complexity. Scores above 30 need immediate attention, 15–30 are moderate, and 5 or below is generally safe.

Can I analyze existing Cobertura XML without running tests?▼

Yes. Provide a path to an existing coverage.cobertura.xml file and the Skill skips test execution entirely, running only the analysis scripts and producing the CRAP hotspot summary from your existing data.

Does it work with both Coverlet and Microsoft CodeCoverage?▼

Yes. The Skill detects which provider each test project uses, defaults to Coverlet when none is found, and runs per-project commands in mixed-provider solutions to avoid dual-provider conflicts.

Why did coverage collection produce no Cobertura XML?▼

Usually the test project lacks a coverage provider or dotnet add package failed offline. The Skill auto-adds coverlet.collector or Microsoft.Testing.Extensions.CodeCoverage, and warns if only binary .coverage files were produced.

When should I not use this coverage analysis Skill?▼

Avoid it for targeted single-method CRAP analysis, writing or generating tests, or general test execution unrelated to coverage. It identifies where tests are needed but does not write them.