Control Flow Analysis¶
This guide explains how CloudAEye analyzes changes to the control flow of a pull request.
Overview¶
CloudAEye shows how a code change affects the order in which functions and services are called when you comment @cloudaeye /control_flow in the PR timeline.
The report includes before-and-after sequence diagrams and highlights calls that were added, removed, redirected, or moved. It also identifies affected callers in other connected repositories.
Prerequisites¶
Step 1: Register¶
Sign up with CloudAEye SaaS.
Step 2: Setup Code Review¶
Setup Code Review by following the Getting Started guide.
Analyze Control Flow¶
To analyze the control flow of your pull request, comment the following in the PR timeline:
@cloudaeye /control_flow
CloudAEye analyzes the code changes and adds a control flow report to the pull request.
Control Flow Report¶
The report includes:
- A summary of how the code change affects the flow.
- The selected flow and its call sequence.
- Before-and-after sequence diagrams.
- Calls that moved to a different branch or into a loop.
- Changes in other flows that are not shown in the diagrams.
- Affected callers and search coverage across connected repositories.

Call Markers¶
The diagrams use the following markers to identify changes:
| Marker | Description |
|---|---|
+ |
Added call |
- |
Removed call |
~ |
Call redirected to a different target |
! |
Call moved to a different place |
| Dashed arrow | A call whose target could not be resolved |
A moved call can change when or how often code runs. For example, moving a call inside a loop makes it run for each iteration.
The diagrams show the code's structure, not a runtime trace. Use Review Code to check whether the code changes are correct.
Use in a Coding Agent¶
CloudAEye's control-flow analysis skill enables AI coding agents to understand how code changes affect the sequence of function and service calls. It generates before-and-after sequence diagrams to highlight calls that were added, removed, redirected, or moved, helping developers identify unintended behavioral changes that may not be obvious from a code diff.
Run Control-Flow Analysis¶
Use the command in a supported coding agent, such as Claude Code:
/cloudaeye:control-flow
This analyzes all uncommitted changes in your working tree.
To analyze changes in a specific directory:
/cloudaeye:control-flow src/auth/
To analyze a specific pull request:
/cloudaeye:control-flow #405
Replace 405 with the pull request number.
What the Analysis Covers¶
- Call sequence changes: Compares the order of function calls before and after a change, highlighting added, removed, redirected, or relocated calls.
- Control-flow changes: Identifies calls moved into loops or conditional branches, where they may execute more frequently or follow a different execution path.
- Sequence diagrams: Generates before-and-after diagrams showing the affected functions and their call relationships.
- Change coverage: Reports how many calls and changed functions are represented in the diagrams, making it easier to identify changes outside the illustrated flows.
- Cross-repository impact: Identifies callers in other connected repositories that may be affected when a function signature changes, a function is removed, or an HTTP endpoint is deleted or moved.
When to Use Control-Flow Analysis¶
Run control-flow analysis before opening a pull request, particularly when a change modifies function call sequences, introduces conditional logic, changes API behavior, or affects interactions between services.
Use the results to understand the impact of a change, investigate unexpected call sequences, and identify potential cross-repository breakages before merging.
Note: Control-flow diagrams represent code structure, not runtime execution. They do not establish whether the new call sequence is correct or intended. Use CloudAEye's code review capability to evaluate correctness and identify potential bugs.
For detailed examples, supported options, and guidance on interpreting sequence diagrams and cross-repository findings, see the Coding Agent: Skills & Commands reference.