Complexity Report
complexity_reportReport structural complexity of a source file, function by function. FREE.
Measures per-function length, max nesting depth, and a cyclomatic-style branch count (if/for/while/case/&&/||/except), flagging functions too long or too deeply nested to review confidently. Typical input {"code": ""} returns {"functions": N, "detail": [{"name": ..., "start": N, "lines": N, "branches": N, "max_depth": N}], "flags": ["..."], "note": "..."}.
Use when structure rather than correctness is the question. Not for vulnerabilities (security_deep_dive). Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""}. Every call is read-only and idempotent, so after correcting the input it is always safe to retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Full source text to analyze, pasted as a single string. | |
| language | No | Optional language hint, e.g. "python" or "javascript"; "auto" (default) detects from syntax. | auto |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||