Use a repo-root `.editorconfig` to configure free .NET analyzer and style rules.
.NET Complexity Review
Use free built-in .NET maintainability analyzers and code metrics configuration to find overly complex methods and coupled code. Use when a repo needs cyclomatic complexity checks, maintainability thresholds, or complexity-driven refactoring gates.
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
Workflow
- Start with the built-in maintainability analyzers before reaching for non-standard tooling.
- Use these rules deliberately:
- CA1502 for excessive cyclomatic complexity in methods - CA1505 for low maintainability index - CA1506 for excessive class coupling - CA1501 when inheritance depth is also part of the design problem
- Keep rule severity in the root
.editorconfig. - Keep metric thresholds in a checked-in
CodeMetricsConfig.txtadded asAdditionalFiles. - Pair analyzer findings with MCAF maintainability limits in
AGENTS.md.
Deliver
- explicit complexity and maintainability policy
- checked-in metric thresholds
- CI commands that surface complex methods early
Validate
- method-complexity checks are enabled where the repo wants them
- thresholds are versioned in repo, not held in IDE memory
- complexity findings map to real refactoring decisions
Load References
references/complexity.mdreferences/metrics.mdreferences/config.md
Related skills
Use the open-source free `CSharpier` formatter for C# and XML.
CSharpier
Use Chous in .NET repositories that ship sizeable frontend codebases and want file-structure linting, naming convention enforcement, and folder-layout policy as a CLI gate.
Chous