get_complexity_report
Identify complex code by retrieving cyclomatic complexity, nesting depth, and parameter counts for symbols in a file or across the project. Use before refactoring.
Instructions
Get complexity metrics (cyclomatic, max nesting, param count) for symbols in a file or across the project. Use to identify complex code before refactoring. For historical trends use get_complexity_trend instead. Read-only. Returns JSON: { symbols: [{ symbol_id, name, kind, file, line, cyclomatic, max_nesting, param_count }], total }. Set output_format: "toon" for lossless TOON encoding — cheaper LLM tokens on tabular payloads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | File path to report on (omit for project-wide top complex symbols) | |
| min_cyclomatic | No | Min cyclomatic complexity to include (default: 1 for file, 5 for project) | |
| limit | No | Max results (default: 30) | |
| sort_by | No | Sort by metric (default: cyclomatic) | |
| output_format | No | Output format. "json" (default) returns JSON, "markdown" returns LLM-friendly fenced markdown (tool-specific), "toon" returns Token-Oriented Object Notation — 30-60% fewer tokens on tabular data, fully lossless. |