crap-analysis

Analyze .NET code coverage and CRAP scores to identify high-risk code sections.

57|7|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/seiggy/lucia-dotnet --skill crap-analysis-seiggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crap-analysis
Source: https://github.com/seiggy/lucia-dotnet/tree/main/.github/skills/crap-analysis
Command: npx skills add https://github.com/seiggy/lucia-dotnet --skill crap-analysis-seiggy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify high-risk code sections by analyzing code coverage and CRAP (Change Risk Anti-Patterns) scores, enabling targeted refactoring and testing efforts.

Core Features & Use Cases

  • CRAP Score Calculation: Computes CRAP scores based on cyclomatic complexity and test coverage.
  • Risk Identification: Highlights code with high complexity and low coverage, indicating potential issues.
  • Coverage Reporting: Generates detailed HTML reports with "Risk Hotspots" and summary metrics.
  • Use Case: Before merging a pull request, run this Skill to ensure that complex new features have adequate test coverage, preventing the introduction of hard-to-maintain code.

Quick Start

Run the crap-analysis skill to generate a coverage report for your .NET project.

Frequently Asked Questions about crap-analysis

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

FAQPage Schema
How do I calculate CRAP scores for .NET code coverage?

CRAP scores help identify risky code by combining cyclomatic complexity and code coverage metrics to highlight sections that are both highly complex and poorly tested. This metric directly indicates areas requiring targeted refactoring and testing efforts.

How do I generate HTML reports with Risk Hotspots from OpenCover data?

You can generate HTML reports with Risk Hotspots from OpenCover data by using ReportGenerator to process the coverage files. The resulting reports detail cyclomatic complexity and untested code paths for comprehensive code quality assessment.

Can I use this skill to check .NET code coverage before merging a pull request?

Yes, you can run a CRAP score analysis before merging a pull request to ensure complex new features have adequate test coverage. This prevents the introduction of hard-to-maintain code by highlighting risk hotspots early.

What is a CRAP score in software engineering and how is it used for refactoring?

A CRAP score in software engineering measures Change Risk Anti-Patterns by evaluating cyclomatic complexity against test coverage. It prioritizes refactoring efforts by flagging code that is too complex and insufficiently tested for maintenance.

Does this CRAP score analysis tool require any specific dependencies?

No specific dependencies are required to run this CRAP score analysis tool. It operates standalone to process OpenCover format files and utilizes ReportGenerator to produce the final HTML coverage reports.