dotnet-complexity

Analyze .NET cyclomatic complexity and maintainability to configure editorconfig and CodeMetricsConfig.txt policies.

8|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill dotnet-complexity-postpartum-genushyacinthus29
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-complexity
Source: https://github.com/Postpartum-genushyacinthus29/dotnet-skills/tree/main/skills/dotnet-complexity
Command: npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill dotnet-complexity-postpartum-genushyacinthus29

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps teams identify, measure, and enforce maintainable code by surfacing cyclomatic complexity, maintainability index, and class coupling using built-in .NET analyzers.

Core Features & Use Cases

  • Automatic detection of high-complexity methods and tightly coupled types in a repository.
  • Guided policy formation with root-cause analysis and policy values (CA1502, CA1505, CA1506, CA1501) to guide refactoring decisions.
  • CI-ready configuration by providing threshold defaults and an easy bootstrap path aligned with AGENTS.md.

Quick Start

Initiate a complexity review by running the built-in analyzers and applying the configured CodeMetricsConfig and editorconfig thresholds to identify and gate refactoring opportunities.

Frequently Asked Questions about dotnet-complexity

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

FAQPage Schema
How do I measure cyclomatic complexity in a .NET repository to guide refactoring?

To measure cyclomatic complexity and guide refactoring, run built-in .NET analyzers to surface excessive values and low maintainability index, then establish concrete policy changes verifiable in the root editorconfig and CodeMetricsConfig.txt.

What .NET analyzer rules are used to enforce code maintainability and class coupling?

Code maintainability and class coupling are enforced using .NET analyzer rules CA1502, CA1505, CA1506, and CA1501, which provide root-cause analysis and threshold values to guide refactoring decisions within your repository.

How do I configure CI-ready complexity thresholds for dotnet code analysis?

Configuring CI-ready complexity thresholds for dotnet code analysis involves setting default values in CodeMetricsConfig.txt and the root editorconfig, creating a versioned policy that gates refactoring opportunities aligned with your AGENTS.md bootstrap path.

Can I detect tightly coupled types and low maintainability index using built-in .NET analyzers?

Yes, built-in .NET analyzers automatically detect tightly coupled types and low maintainability index in a repository, surfacing these metrics to help teams identify, measure, and enforce maintainable code through guided policy formation.

Do I need external dependencies to perform .NET code analysis for maintainability?

No external dependencies are required to perform .NET code analysis for maintainability; the process relies entirely on built-in .NET analyzers to detect high-complexity methods and tightly coupled types for establishing verifiable repository policies.