code_complexity
Analyze Python code complexity by cyclomatic metric, revealing decision points and per-function ranks. Pinpoints complex functions needing refactoring to improve maintainability.
Instructions
Cyclomatic complexity per function, with rank and decision-point breakdown.
Counts if/elif, for, while, except, comprehension fors and ifs, boolean
operators, ternaries, and match cases other than the irrefutable one.
Scores match radon cc --no-assert.
with and assert are deliberately not counted: neither branches. with
still adds nesting depth.
Args: path: Path to a .py file. function: Optional single function to analyse in detail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| function | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |