mcaf-dotnet-complexity

Analyze .NET codebases for cyclomatic complexity and maintainability issues.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/managedcode/MCPGateway --skill mcaf-dotnet-complexity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcaf-dotnet-complexity
Source: https://github.com/managedcode/MCPGateway/tree/main/.codex/skills/mcaf-dotnet-complexity
Command: npx skills add https://github.com/managedcode/MCPGateway --skill mcaf-dotnet-complexity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps identify and manage overly complex methods and code coupling within .NET repositories, ensuring maintainability and adherence to quality standards.

Core Features & Use Cases

  • Complexity Analysis: Detects methods with high cyclomatic complexity and classes with excessive coupling.
  • Maintainability Thresholds: Enforces configurable maintainability index limits.
  • CI Integration: Provides commands to integrate complexity checks into the CI pipeline.
  • Use Case: A development team wants to ensure new code contributions do not introduce overly complex logic that would be difficult to maintain or test.

Quick Start

Use the mcaf-dotnet-complexity skill to find overly complex methods in the current .NET repository.

Frequently Asked Questions about mcaf-dotnet-complexity

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

FAQPage Schema
How do I check cyclomatic complexity in a .NET codebase?

You can analyze .NET codebases for excessive cyclomatic complexity, low maintainability index, and high class coupling using built-in .NET analyzers. It targets repositories requiring complexity-driven refactoring gates and enforces rules like CA1502, CA1505, and CA1506.

How do I enforce maintainability index limits in .NET?

You can enforce maintainability index limits in .NET by configuring maintainability thresholds using CodeMetricsConfig.txt and .editorconfig. This setup ensures code contributions meet your defined quality standards before merging.

Can I integrate code complexity checks into a .NET CI pipeline?

Yes, you can integrate code complexity checks into a .NET CI pipeline using provided commands. This allows development teams to automatically prevent new code contributions from introducing overly complex logic that is difficult to maintain or test.

What .NET analyzer rules are used to detect high class coupling and complexity?

The .NET analyzer rules used to detect high class coupling and complexity include CA1501, CA1502, CA1505, and CA1506. These rules are enforced through .editorconfig and CodeMetricsConfig.txt to manage code coupling and maintainability.

Does this code complexity analysis require any external dependencies?

No external dependencies are required for this code complexity analysis. It operates using built-in .NET analyzers to identify overly complex methods and excessive coupling directly within your .NET repositories.

Why should I use built-in .NET analyzers for code refactoring gates instead of other tools?

Using built-in .NET analyzers for code refactoring gates provides direct enforcement of rules like CA1502 and CA1506 without external dependencies. It targets repositories requiring maintainability thresholds and complexity checks natively within the .NET ecosystem.