analyze_control_flow
Analyze the control flow structure of a Java method, reporting branching points, loops, returns, throws, and maximum nesting depth for debugging or refactoring.
Instructions
Analyze the control flow structure of a method.
USAGE: analyze_control_flow(filePath="path/to/File.java", line=10, column=5) OUTPUT: Branching points, loops, returns, throws, and nesting depth
Reports:
Branch count (if/switch/ternary)
Loop count and types (for/while/do-while/enhanced-for)
Return points with line numbers
Throw points with exception types and line numbers
Try-catch blocks with caught exception types
Maximum nesting depth
Requires load_project to be called first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filePath": "<filePath>",
"line": "<line>",
"column": "<column>"
},
"name": "analyze_control_flow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number within the method | |
| column | Yes | Zero-based column number | |
| filePath | Yes | File containing the method |