roslyn:get_complexity_metrics
Get cyclomatic, nesting, LOC, parameter, and cognitive complexity metrics for a method or file. Provide an absolute file path and optionally line/column to target a specific method.
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 |
|---|---|---|---|
| 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] | |
| filePath | Yes | Absolute path to source file |