gograph_complexity
Report estimated cyclomatic complexity for Go functions, sorted highest to lowest with severity labels, to find functions needing decomposition or set CI complexity budgets.
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. Optional symbol substring filters to a specific function or set of functions; top limits the report (default: 20; 0 = all). 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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gograph_complexity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Number of results to return, highest first (default: 20, 0 = all) | |
| path | No | Keep functions in this repository-relative directory subtree | |
| root | No | Absolute path of your checkout or worktree (alias cwd). | |
| symbol | No | Optional Go function or method symbol name substring to filter the complexity report (e.g., 'Build') | |
| no_tests | No | Drop functions declared in _test.go files | |
| intention | No | Rationale; required with an active session. | |
| session_id | No | Session from session_create; omit for none. |