analyze_data_flow
Analyze data flow within a Java method to track variable reads, writes, and declarations. Optionally follow calls to detect null and taint facts across methods.
Instructions
Analyze data flow within a method.
USAGE: analyze_data_flow(filePath="path/to/File.java", line=10, column=5) OUTPUT: Variables with read/write/declaration info
Reports for each variable:
name and type
whether it is declared, read, written
whether it is a parameter, local variable, or field
return statement count and types
Useful for understanding side effects before extracting methods.
Options:
followCalls: opt-in interprocedural mode (default false). Tracks two fact kinds across argument-to-parameter hops into project callees and reports interproceduralFlows:
null facts - locals assigned null; sink = a dereference of the tracked value in a callee (potential NPE)
taint facts - this method's parameters, propagated through aliases and expressions; sink = the value escaping into a non-project (binary) callee May-analysis: reassignments do not kill facts. Returned values are not tracked back into callers.
maxCallDepth: call-edge bound for followCalls (default 2)
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | File containing the method | |
| line | Yes | Zero-based line number within the method | |
| column | Yes | Zero-based column number | |
| followCalls | No | Track null/taint facts across method calls (default false) | |
| maxCallDepth | No | Call-edge bound for followCalls (default 2, min 1) |