coverage-analysis

Analyzes .NET code coverage and computes CRAP scores to rank risky, under-tested methods.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/Netcodr81/kinetic-reports --skill coverage-analysis-netcodr81
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coverage-analysis
Source: https://github.com/Netcodr81/kinetic-reports/tree/main/.github/skills/coverage-analysis
Command: npx skills add https://github.com/Netcodr81/kinetic-reports --skill coverage-analysis-netcodr81

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Raw coverage percentages tell you what code ran, but not which uncovered code is dangerous to change. This Skill combines line/branch coverage with cyclomatic complexity to compute CRAP (Change Risk Anti-Patterns) scores per method, surfacing the complex, under-tested hotspots that block coverage improvement and make refactoring risky. ## Core Features & Use Cases - CRAP Score Hotspot Ranking: Parses Cobertura XML and applies the formula comp² × (1 − cov)³ + comp per method, returning a ranked table of the riskiest methods. - Automated Coverage Collection: Detects the coverage provider (Coverlet or Microsoft CodeCoverage) per test project, adds a provider package when missing, and runs dotnet test with the correct arguments — including mixed-provider solutions. - Coverage Gap and Plateau Diagnosis: Extracts per-method coverage below configurable thresholds and prioritizes gaps as HIGH/MED/LOW to explain why coverage is stuck. - Use Case: A developer's solution sits at 72% coverage and won't move. Run this Skill to discover that three methods with complexity above 15 and zero coverage account for most of the risk, and get a prioritized list of which tests to write next. ## Quick Start Analyze the coverage of my .NET solution in the current directory and show me the top CRAP score risk hotspots.

Frequently Asked Questions about coverage-analysis

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

FAQPage Schema
How do I find which methods are blocking my code coverage from increasing?▼

Run a coverage analysis that computes CRAP scores per method from Cobertura XML. Methods with high cyclomatic complexity and low coverage rank highest, showing exactly which methods to test next for the largest coverage and risk improvement.

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

CRAP (Change Risk Anti-Patterns) combines cyclomatic complexity and code coverage using the formula comp² × (1 − cov)³ + comp. Scores above 30 indicate code needing immediate attention, while scores of 5 or below are generally considered safe.

Does this work with both Coverlet and Microsoft CodeCoverage?▼

Yes, the workflow auto-detects the coverage provider per test project and uses the matching dotnet test arguments. For mixed solutions containing both providers, it runs tests per project to avoid dual-provider conflicts.

Can I analyze existing Cobertura XML without running tests again?▼

Yes, if you supply a path to an existing coverage.cobertura.xml file or one is found under TestResults/, the test execution phase is skipped entirely. The analysis scripts parse the existing XML directly and produce the CRAP hotspot report.

Why did my coverage run produce no Cobertura XML output?▼

This usually happens when the test project lacks a coverage provider package or when Visual Studio's collector produced binary .coverage files instead. Adding coverlet.collector or Microsoft.Testing.Extensions.CodeCoverage and requesting cobertura format resolves it.

When should I not use project-wide coverage analysis?▼

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.