complexity
complexity sets up .NET's built-in maintainability analyzers to enforce cyclomatic complexity and coupling limits across your codebase. It configures CA1502, CA1505, and CA1506 rules in .editorconfig and CodeMetricsConfig.txt, then validates thresholds through the build pipeline.
complexity configures cyclomatic complexity thresholds and maintainability analyzers for .NET projects using built-in CA rules.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-25
complexity configures cyclomatic complexity thresholds and maintainability analyzers for .NET projects using built-in CA rules. complexity sets up .NET's built-in maintainability analyzers to enforce cyclomatic complexity and coupling limits across your codebase. It configures CA1502, CA1505, and CA1506 rules in .editorconfig and CodeMetricsConfig.txt, then validates thresholds through the build pipeline.
Use it when
- complexity manages cyclomatic complexity thresholds through .editorconfig and CodeMetricsConfig.txt.
- complexity configures .NET's maintainability analyzers by adding rules to your .editorconfig file.
Verify before relying
Read SKILL.md below before installing (5 files). Open directory: indexed for reading, not audited.
Install
managedcode/dotnet-skills/complexity · repository language: C#
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to find overly complex methods in .NET?
complexity enables .NET's built-in maintainability analyzers to automatically detect methods exceeding your cyclomatic complexity thresholds. Configure rule CA1502 in your .editorconfig file to flag methods that are too complex, then run your build to surface violations. The analyzer scans your entire C# codebase and reports problematic methods by file and line number, helping you prioritize refactoring efforts.
What are cyclomatic complexity thresholds and how do I set them in C#?
complexity manages cyclomatic complexity thresholds through .editorconfig and CodeMetricsConfig.txt. Rule CA1502 controls method complexity limits, CA1505 tracks maintainability index, and CA1506 monitors class coupling. Set your desired thresholds in .editorconfig (e.g., `dotnet_diagnostic.CA1502.severity = warning`), then validate them in your CI pipeline to enforce code quality gates across your .NET project.
How do I configure code complexity analyzers for dotnet?
complexity configures .NET's maintainability analyzers by adding rules to your .editorconfig file. Enable CA1502 (cyclomatic complexity), CA1505 (maintainability index), and CA1506 (class coupling), then set severity levels and thresholds. You can also use CodeMetricsConfig.txt for advanced configuration. Once configured, the analyzers run automatically during build and report violations in your IDE and build logs.
How can I set up code metrics gates in my CI pipeline?
complexity enforces complexity policies in CI by configuring your .editorconfig to treat analyzer violations as errors or warnings. Set rule severities to `error` to fail the build when thresholds are exceeded. Integrate the build step into your pipeline so that any commit violating your cyclomatic complexity, maintainability index, or coupling limits is caught before merge, maintaining consistent code quality standards.
What's the best way to reduce method complexity in a C# project?
complexity identifies complex methods so you can refactor them systematically. Use CA1502 violations to pinpoint high-complexity methods, then break them into smaller, focused functions. Address CA1506 class coupling warnings by extracting dependencies and applying dependency injection. Monitor CA1505 maintainability index trends as you refactor, and validate improvements by re-running the analyzers to confirm thresholds are met.
How do I bootstrap missing complexity rules and thresholds in editorconfig?
complexity helps you add complexity rules to .editorconfig by defining CA1502, CA1505, and CA1506 with appropriate severity and threshold settings. Start with recommended defaults, then tune thresholds based on your team's standards. Use CodeMetricsConfig.txt for granular per-project configuration. Once rules are in place, the analyzers activate automatically on next build, surfacing any existing violations for remediation.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
.NET Complexity Review
Trigger On
- the team wants to find overly complex methods
- cyclomatic complexity thresholds are needed in CI
- maintainability metrics or coupling thresholds need to be configured
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not Use For
- formatting-only
(truncated - see the full file via the links below)
File tree — 5 files
catalog/Tools/Complexity/skills/complexity/SKILL.md
catalog/Tools/Complexity/skills/complexity/manifest.json
catalog/Tools/Complexity/skills/complexity/references/complexity.md
catalog/Tools/Complexity/skills/complexity/references/config.md
catalog/Tools/Complexity/skills/complexity/references/metrics.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Configure cyclomatic complexity thresholds and maintainability analyzers for a .NET project”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
cloc delivers line-count, language composition, and branch-diff statistics for .NET codebases through repeatable, configurable commands. Use it to measure solution footprint, compare code deltas across refs, and track codebase composition—not to assess developer productivity or replace design review.
stylecop-analyzers sets up the StyleCop.Analyzers package in .NET repositories, establishing clear ownership between root .editorconfig and stylecop.json configuration. It detects existing state, adds the package where needed, and prevents rule overlap with other analyzer packs. Use it when your team requires stronger style conventions than SDK analyzers alone provide.
Roslynator equips .NET projects with open-source static analysis and code-cleanup capabilities through NuGet analyzer packages and an optional command-line tool. Configure rule severity in `.editorconfig`, run analysis and fix workflows, or detect unused code—all while respecting your repo's existing analyzer setup.
This skill establishes a single source of truth for .NET analyzer severity and code-style rules by creating or normalizing a repo-root .editorconfig file. It detects your current configuration state, structures rule ownership explicitly, and validates that settings are reproducible across local and CI builds.
This skill installs and configures Meziantou.Analyzer, a comprehensive rule set for .NET codebases covering design, usage, security, performance, and style concerns. It manages package setup, severity configuration in `.editorconfig`, and avoids duplication with SDK or Roslynator analyzers. Use it when your team wants broader diagnostic coverage without managing multiple analyzer packages.
format configures the SDK-provided dotnet format tool for .NET projects, enabling reproducible code formatting and analyzer fixes across local and CI environments. It respects .editorconfig as the source of truth for style preferences and helps avoid formatter conflicts by clarifying ownership when multiple tools are in use.
More skills code-analysis (MIT) · csharpier (MIT) · modern-csharp (MIT) · resharper-clt (MIT) · chous (MIT)