-
Notifications
You must be signed in to change notification settings - Fork 14
[Query] Does Call
This document was generated from 'src/documentation/wiki-query.ts' on 2026-07-20, 17:48:26 UTC presenting an overview of flowR's query API (v2.12.3). Please do not edit this file/wiki page directly.
Does-Call Query [overview]
Checks whether a function calls another function matching given constraints.
This query is requested with the type does-call.
Run in the REPL: :query @does-call (<criterion>:$<id>|"<name>") <code | file://path>
This query checks whether a function calls another function matching given constraints.
Using the example code:
f <- function(x) { eval(x) };
f("1 + 1")the following query checks whether the call to f calls eval:
[
{
"type": "does-call",
"queryId": "calls-eval",
"call": "2@f",
"calls": {
"type": "name",
"name": "eval",
"nameExact": true
}
}
](This can be shortened to @does-call (2@f:"eval") when used with the REPL command :query).
Results (prettified and summarized):
Query: does-call (11ms)
- calls-eval found:
- Call with id 15 (2.1)
All queries together required ≈12 ms (1ms accuracy, total 13 ms)
Show Detailed Results as Json
The analysis required 13.1 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.
{
"does-call": {
".meta": {
"timing": 11
},
"results": {
"calls-eval": {
"call": 15
}
}
},
".meta": {
"timing": 12
}
}Original Code
f <- function(x) { eval(x) };
f("1 + 1")Dataflow Graph of the R Code
The analysis required 68.6 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 unknown side effects (with ids: 8) during the analysis.
flowchart LR
10["`*#91;RFunctionDefinition#93;* **function**
*1.6-28* (**id: 10**)`"]
subgraph "flow-10" [function 10]
1["`*#91;RSymbol#93;* **x**
*1.15* (**id: 1**, v: )`"]
6(["`*#91;RSymbol#93;* **x**
*1.25* (**id: 6**)`"])
8[["`*#91;RFunctionCall#93;* base#58;#58;**eval**
*1.20-26* (**id: 8**)
arg: (6)`"]]
style 8 stroke:red,stroke-width:5px;
built-in:eval["`Built-In:
eval`"]
style built-in:eval stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
9[["`*#91;RExpressionList#93;* base#58;#58;**#123;**
*1.18* (**id: 9**)
arg: (8)`"]]
built-in:_["`Built-In:
#123;`"]
style built-in:_ stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
end
%% No edges found for 10
0["`*#91;RSymbol#93;* **f**
*1.1* (**id: 0**, v: 10)`"]
11[["`*#91;RBinaryOp#93;* base#58;#58;**#60;#45;**
*1.1-28* (**id: 11**)
arg: (0, 10)`"]]
built-in:_-["`Built-In:
#60;#45;`"]
style built-in:_- stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
13{{"`*#91;RString#93;* **#34;1 #43; 1#34;**
*2.3-9* (**id: 13**)`"}}
%% Environment of 15 [level: 0]:
%% Built-in
%% 1----------------------------------------
%% f: {**f** (id: 0, type: Function, def. @11)}
15[["`*#91;RFunctionCall#93;* **f**
*2.1-10* (**id: 15**)
arg: (13)`"]]
1 -->|"def-by-on-call"| 13
6 -->|"reads"| 1
8 -->|"reads, returns, arg"| 6
8 -.->|"reads, calls"| built-in:eval
linkStyle 3 stroke:gray;
9 -->|"returns, arg"| 8
9 -.->|"reads, calls"| built-in:_
linkStyle 5 stroke:gray;
10 -.-|function| flow-10
0 -->|"defined-by"| 10
0 -->|"defined-by"| 11
11 -->|"reads, arg"| 10
11 -->|"returns, arg"| 0
11 -.->|"reads, calls"| built-in:_-
linkStyle 11 stroke:gray;
13 -->|"def-on-call"| 1
15 -->|"reads, arg"| 13
15 -->|"reads"| 0
15 -->|"returns"| 8
15 -->|"calls"| 10
Implementation Details
Responsible for the execution of the Does-Call Query query is executeDoesCallQuery in ./src/queries/catalog/does-call-query/does-call-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