Skill page Metrics v1.0.0

.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

  1. Start with the built-in maintainability analyzers before reaching for non-standard tooling.
  2. 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

  1. Keep rule severity in the root .editorconfig.
  2. Keep metric thresholds in a checked-in CodeMetricsConfig.txt added as AdditionalFiles.
  3. 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

Related skills

v1.0.0

Use the open-source free `Asynkron.Profiler` dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

dotnet skills install asynkron-profiler