gograph_complexity
Analyze Go functions' cyclomatic complexity, sort by highest risk with severity labels, and filter by symbol to identify code needing decomposition.
Instructions
Report estimated cyclomatic complexity for Go functions, sorted highest-to-lowest with severity labels (LOW/MEDIUM/HIGH/VERY HIGH). A function whose repository source cannot be read or parsed safely is retained as UNKNOWN with score -1. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. Optional symbol substring filters to a specific function or set of functions. WHEN TO USE: During code quality audits, identifying functions that need decomposition, or setting complexity budgets in CI. NOT TO USE: For import dependency metrics (use gograph_coupling or gograph_deps); for God Object detection (use gograph_godobj). RETURNS: Structured list of functions with complexity score and severity label; empty when no functions match the filter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No | Optional Go function or method symbol name substring to filter the complexity report (e.g., 'Build') |