roslyn:get_complexity_metrics
Analyze code complexity metrics for C# methods or files to identify maintainability issues. Provides cyclomatic complexity, nesting depth, lines of code, parameter count, and cognitive complexity measurements.
Instructions
Get complexity metrics for a method or entire file.
METRICS: cyclomatic (decision points), nesting (max depth), loc (lines), parameters (count), cognitive (Sonar-style) USAGE: get_complexity_metrics(filePath) for file, or add line/column for specific method OUTPUT: Per-method breakdown with all requested metrics IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute path to source file | |
| line | No | Optional: zero-based line for specific method | |
| column | No | Optional: zero-based column | |
| metrics | No | Optional: specific metrics [cyclomatic, nesting, loc, parameters, cognitive] |