testing-crap-analysis

Analyze CRAP scores from OpenCover coverage reports for .NET projects.

3|Updated Jan 24, 2024
One-click install
npx skills add https://github.com/akoken/dotfiles --skill testing-crap-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-crap-analysis
Source: https://github.com/akoken/dotfiles/tree/main/config/.copilot/skills/testing-crap-analysis
Command: npx skills add https://github.com/akoken/dotfiles --skill testing-crap-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CRAP analysis helps teams identify high-risk code by combining cyclomatic complexity with test coverage to prioritize testing and refactoring efforts.

Core Features & Use Cases

  • CRAP score calculation using complexity and coverage to surface hotspots
  • Coverage-guided risk assessment for CI/CD gatekeeping and code reviews
  • OpenCover & ReportGenerator setup for .NET projects

Quick Start

Configure OpenCover and ReportGenerator on your .NET project; then run tests to generate coverage and CRAP metrics.

Frequently Asked Questions about testing-crap-analysis

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

FAQPage Schema
What is CRAP analysis in code quality measurement?

CRAP analysis identifies high-risk code by combining cyclomatic complexity with test coverage to calculate a CRAP score, helping teams prioritize refactoring and testing efforts effectively.

How do I calculate CRAP scores for a .NET project?

You can calculate CRAP scores for .NET projects by configuring OpenCover to collect coverage data and using ReportGenerator to produce Risk Hotspots reports, utilizing provided templates and run settings.

Can I use OpenCover and ReportGenerator for CI/CD gatekeeping?

Yes, OpenCover and ReportGenerator support CI/CD gatekeeping by generating coverage-guided risk assessments and CRAP metrics, with guidance on configuring thresholds for automated quality enforcement.

Does CRAP analysis work without OpenCover-compatible coverage data?

No, performing CRAP analysis requires OpenCover-compatible coverage data and ReportGenerator to correctly surface risk hotspots and calculate scores for your .NET project.

When should I use CRAP scoring during code reviews?

Use CRAP scoring during pre-refactor reviews and code maintenance to identify risk hotspots, ensuring teams focus testing and refactoring efforts on complex, poorly tested code areas.