-
Notifications
You must be signed in to change notification settings - Fork 14
[Query] Call Graph
This document was generated from 'src/documentation/wiki-query.ts' on 2026-07-20, 13:05:03 UTC presenting an overview of flowR's query API (v2.12.3). Please do not edit this file/wiki page directly.
Call-Graph Query [overview]
Returns the call graph of the given code.
This query is requested with the type call-graph.
This query calculates and returns the call graph of the given code.
Using the example code x + 1, the following query returns the dataflow graph of the code:
[ { "type": "call-graph" } ](This can be shortened to @call-graph when used with the REPL command :query).
Results (prettified and summarized):
Query: call-graph (9 ms)
╰ Call Graph
All queries together required ≈9 ms (1ms accuracy, total 9 ms)
Show Detailed Results as Json
The analysis required 9.2 ms (including parsing and normalization and the query) within the generation environment.
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR. Please consult the Interface wiki page for more information on how to get those.
{
"call-graph": {
".meta": {
"timing": 9
},
"graph": {
"rootVertices": [
2
],
"vertexInformation": [
[
2,
{
"tag": "fcall",
"id": 2,
"name": "+",
"onlyBuiltin": true,
"args": [
{
"nodeId": 0,
"type": 32
},
{
"nodeId": 1,
"type": 32
}
],
"origin": [
"builtin:d"
]
}
]
],
"edgeInformation": [
[
2,
[
[
"built-in:d",
{
"types": 4
}
]
]
]
],
"_unknownSideEffects": []
}
},
".meta": {
"timing": 9
}
}Original Code
x + 1Dataflow Graph of the R Code
The analysis required 2.0 ms (including parse and normalize, using the r-shell engine) within the generation environment. No signature database is mounted for these generated graphs, so library() calls attach no package exports; base-R names are still qualified via the generated base-package store (e.g. acf as stats::acf).
We encountered no unknown side effects during the analysis.
flowchart LR
0(["`*#91;RSymbol#93;* **x**
*1.1* (**id: 0**)`"])
%% No edges found for 0
1{{"`*#91;RNumber#93;* **1**
*1.5* (**id: 1**)`"}}
%% No edges found for 1
2[["`*#91;RBinaryOp#93;* base#58;#58;**#43;**
*1.1-5* (**id: 2**)
arg: (0, 1)`"]]
built-in:_["`Built-In:
#43;`"]
style built-in:_ stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
2 -->|"reads, arg"| 0
2 -->|"reads, arg"| 1
2 -.->|"reads, calls"| built-in:_
linkStyle 2 stroke:gray;
Implementation Details
Responsible for the execution of the Call-Graph Query query is executeCallGraphQuery in ./src/queries/catalog/call-graph-query/call-graph-query-executor.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information