get_control_flow
Build a Control Flow Graph of a function to visualize branching logic, loops, and exception paths. Understand code behavior before making changes.
Instructions
Build a Control Flow Graph (CFG) for a function/method: if/else branches, loops, try/catch, returns, throws. Shows logical paths through the code. Outputs Mermaid diagram, ASCII, or JSON. Use to understand branching logic before modifying complex functions. For call-level graph (who calls whom) use get_call_graph instead. Read-only. Returns Mermaid/ASCII/JSON: { nodes, edges, entryPoint, exitPoints }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol_id | Yes | Symbol ID of the function/method | |
| fqn | Yes | Fully qualified name of the function/method | |
| format | No | Output format (default: mermaid) | |
| simplify | No | Collapse sequential statements (default: true) |