@eagleoutice/flowr 2.13.7 → 2.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/dataflow/graph/df-helper.d.ts +13 -0
- package/dataflow/graph/df-helper.js +21 -0
- package/linter/rules/undefined-symbol-util.d.ts +4 -1
- package/linter/rules/undefined-symbol-util.js +6 -3
- package/package.json +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -9
- package/util/version.js +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ It offers a wide variety of features, for example:
|
|
|
43
43
|
|
|
44
44
|
```shell
|
|
45
45
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
46
|
-
flowR repl v2.13.
|
|
46
|
+
flowR repl v2.13.7, R grammar v14 (tree-sitter engine)
|
|
47
47
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -52,7 +52,7 @@ It offers a wide variety of features, for example:
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
```text
|
|
55
|
-
Query: linter (
|
|
55
|
+
Query: linter (6 ms)
|
|
56
56
|
╰ Deprecated Functions (deprecated-functions): no findings
|
|
57
57
|
╰ File Path Validity (file-path-validity):
|
|
58
58
|
╰ certain:
|
|
@@ -62,7 +62,7 @@ It offers a wide variety of features, for example:
|
|
|
62
62
|
╰ Absolute Paths (absolute-file-paths):
|
|
63
63
|
╰ certain:
|
|
64
64
|
╰ Path `/root/x.txt` at 1.1-23
|
|
65
|
-
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
65
|
+
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0
|
|
66
66
|
╰ Unused Definitions (unused-definitions): no findings
|
|
67
67
|
╰ Network Functions (network-functions): no findings
|
|
68
68
|
╰ Dataframe Access Validation (dataframe-access-validation): no findings
|
|
@@ -73,7 +73,7 @@ It offers a wide variety of features, for example:
|
|
|
73
73
|
╰ Roxygen Arguments (roxygen-arguments): no findings
|
|
74
74
|
╰ No Leaked Credentials (no-leaked-credentials): no findings
|
|
75
75
|
╰ Undefined Symbol (undefined-symbol): no findings
|
|
76
|
-
All queries together required ≈
|
|
76
|
+
All queries together required ≈6 ms (1ms accuracy, total 6 ms)
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
|
|
@@ -95,7 +95,7 @@ It offers a wide variety of features, for example:
|
|
|
95
95
|
|
|
96
96
|
_Results (prettified and summarized):_
|
|
97
97
|
|
|
98
|
-
Query: **linter** (
|
|
98
|
+
Query: **linter** (8 ms)\
|
|
99
99
|
╰ **Deprecated Functions** (deprecated-functions): _no findings_\
|
|
100
100
|
╰ **File Path Validity** (file-path-validity):\
|
|
101
101
|
╰ certain:\
|
|
@@ -105,7 +105,7 @@ It offers a wide variety of features, for example:
|
|
|
105
105
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
106
106
|
╰ certain:\
|
|
107
107
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
108
|
-
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs:
|
|
108
|
+
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 1\
|
|
109
109
|
╰ **Unused Definitions** (unused-definitions): _no findings_\
|
|
110
110
|
╰ **Network Functions** (network-functions): _no findings_\
|
|
111
111
|
╰ **Dataframe Access Validation** (dataframe-access-validation): _no findings_\
|
|
@@ -116,11 +116,11 @@ It offers a wide variety of features, for example:
|
|
|
116
116
|
╰ **Roxygen Arguments** (roxygen-arguments): _no findings_\
|
|
117
117
|
╰ **No Leaked Credentials** (no-leaked-credentials): _no findings_\
|
|
118
118
|
╰ **Undefined Symbol** (undefined-symbol): _no findings_\
|
|
119
|
-
_All queries together required ≈
|
|
119
|
+
_All queries together required ≈8 ms (1ms accuracy, total 8 ms)_
|
|
120
120
|
|
|
121
121
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
122
122
|
|
|
123
|
-
The analysis required
|
|
123
|
+
The analysis required _8.4 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
124
124
|
|
|
125
125
|
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.
|
|
126
126
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -137,8 +137,8 @@ It offers a wide variety of features, for example:
|
|
|
137
137
|
".meta": {
|
|
138
138
|
"totalCalls": 0,
|
|
139
139
|
"totalFunctionDefinitions": 0,
|
|
140
|
-
"searchTimeMs":
|
|
141
|
-
"processTimeMs":
|
|
140
|
+
"searchTimeMs": 2,
|
|
141
|
+
"processTimeMs": 0
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
"file-path-validity": {
|
|
@@ -173,7 +173,7 @@ It offers a wide variety of features, for example:
|
|
|
173
173
|
"callsWithNonConstantProducers": 0,
|
|
174
174
|
"callsWithOtherBranchProducers": 0,
|
|
175
175
|
"searchTimeMs": 0,
|
|
176
|
-
"processTimeMs":
|
|
176
|
+
"processTimeMs": 0
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
"absolute-file-paths": {
|
|
@@ -193,7 +193,7 @@ It offers a wide variety of features, for example:
|
|
|
193
193
|
"totalConsidered": 1,
|
|
194
194
|
"totalUnknown": 0,
|
|
195
195
|
"searchTimeMs": 0,
|
|
196
|
-
"processTimeMs":
|
|
196
|
+
"processTimeMs": 1
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
"unused-definitions": {
|
|
@@ -209,7 +209,7 @@ It offers a wide variety of features, for example:
|
|
|
209
209
|
".meta": {
|
|
210
210
|
"totalCalls": 0,
|
|
211
211
|
"totalFunctionDefinitions": 0,
|
|
212
|
-
"searchTimeMs":
|
|
212
|
+
"searchTimeMs": 0,
|
|
213
213
|
"processTimeMs": 0
|
|
214
214
|
}
|
|
215
215
|
},
|
|
@@ -220,7 +220,7 @@ It offers a wide variety of features, for example:
|
|
|
220
220
|
"numAccesses": 0,
|
|
221
221
|
"totalAccessed": 0,
|
|
222
222
|
"searchTimeMs": 0,
|
|
223
|
-
"processTimeMs":
|
|
223
|
+
"processTimeMs": 0
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
226
|
"dead-code": {
|
|
@@ -256,7 +256,7 @@ It offers a wide variety of features, for example:
|
|
|
256
256
|
"roxygen-arguments": {
|
|
257
257
|
"results": [],
|
|
258
258
|
".meta": {
|
|
259
|
-
"searchTimeMs":
|
|
259
|
+
"searchTimeMs": 0,
|
|
260
260
|
"processTimeMs": 0
|
|
261
261
|
}
|
|
262
262
|
},
|
|
@@ -281,16 +281,16 @@ It offers a wide variety of features, for example:
|
|
|
281
281
|
"subscript": 0
|
|
282
282
|
},
|
|
283
283
|
"searchTimeMs": 0,
|
|
284
|
-
"processTimeMs":
|
|
284
|
+
"processTimeMs": 2
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
288
|
".meta": {
|
|
289
|
-
"timing":
|
|
289
|
+
"timing": 8
|
|
290
290
|
}
|
|
291
291
|
},
|
|
292
292
|
".meta": {
|
|
293
|
-
"timing":
|
|
293
|
+
"timing": 8
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
```
|
|
@@ -354,7 +354,7 @@ It offers a wide variety of features, for example:
|
|
|
354
354
|
|
|
355
355
|
```shell
|
|
356
356
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
357
|
-
flowR repl v2.13.
|
|
357
|
+
flowR repl v2.13.7, R grammar v14 (tree-sitter engine)
|
|
358
358
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
359
359
|
```
|
|
360
360
|
|
|
@@ -368,7 +368,7 @@ It offers a wide variety of features, for example:
|
|
|
368
368
|
N <- 10
|
|
369
369
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
370
370
|
sum
|
|
371
|
-
All queries together required ≈
|
|
371
|
+
All queries together required ≈4 ms (1ms accuracy, total 4 ms)
|
|
372
372
|
```
|
|
373
373
|
|
|
374
374
|
|
|
@@ -383,7 +383,7 @@ It offers a wide variety of features, for example:
|
|
|
383
383
|
</details>
|
|
384
384
|
|
|
385
385
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
386
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
386
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">105.1 ms</span></i> (as of Aug 1, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
387
387
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
388
388
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph#perspectives-cg).
|
|
389
389
|
|
|
@@ -419,7 +419,7 @@ It offers a wide variety of features, for example:
|
|
|
419
419
|
|
|
420
420
|
```shell
|
|
421
421
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
422
|
-
flowR repl v2.13.
|
|
422
|
+
flowR repl v2.13.7, R grammar v14 (tree-sitter engine)
|
|
423
423
|
R> :dataflow* test/testfiles/example.R
|
|
424
424
|
```
|
|
425
425
|
|
|
@@ -692,7 +692,7 @@ It offers a wide variety of features, for example:
|
|
|
692
692
|
```
|
|
693
693
|
|
|
694
694
|
|
|
695
|
-
(The analysis required
|
|
695
|
+
(The analysis required _2.0 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment. No [signature database](https://github.com/flowr-analysis/flowr/wiki/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`).)
|
|
696
696
|
|
|
697
697
|
|
|
698
698
|
|
|
@@ -119,6 +119,19 @@ export declare const Dataflow: {
|
|
|
119
119
|
* Use this when you need the reduced-and-inverted graph for a forward traversal within a restriction set.
|
|
120
120
|
*/
|
|
121
121
|
readonly reduceAndInvertGraph: <G extends DataflowGraph>(this: void, graph: G, select: ReadonlySet<NodeId>, cleanEnv: REnvironmentInformation) => G;
|
|
122
|
+
/**
|
|
123
|
+
* Whether the node is quoted, i.e., affected by a {@link EdgeType.NonStandardEvaluation} edge that actually
|
|
124
|
+
* keeps it from being evaluated (as `quote` and `substitute` do).
|
|
125
|
+
*
|
|
126
|
+
* Loops mark their body as non-standard-evaluated as well, yet that body really is evaluated (and its symbols
|
|
127
|
+
* really are read), so such an edge does not quote. Use this instead of testing for the edge type directly
|
|
128
|
+
* whenever you want to know whether something is evaluated at all.
|
|
129
|
+
* @param id - The id of the node to check
|
|
130
|
+
* @param graph - The graph the node is part of
|
|
131
|
+
* @param withOutgoing - Whether to also consider the outgoing edges of the node (i.e., whether the node itself
|
|
132
|
+
* quotes something), and not just the ingoing ones (i.e., whether it is quoted)
|
|
133
|
+
*/
|
|
134
|
+
readonly isQuoted: (this: void, id: NodeId, graph: DataflowGraph, withOutgoing?: boolean) => boolean;
|
|
122
135
|
/**
|
|
123
136
|
* Given the id of a vertex (usually a variable use),
|
|
124
137
|
* this returns a reachable provenance set by calculating a non-interprocedural and non-context sensitive backward slice, but stopping at the given ids!
|
|
@@ -10,6 +10,7 @@ const call_graph_1 = require("./call-graph");
|
|
|
10
10
|
const transitive_side_effects_1 = require("../internal/process/functions/call/built-in/transitive-side-effects");
|
|
11
11
|
const vertex_1 = require("./vertex");
|
|
12
12
|
const identifier_1 = require("../environments/identifier");
|
|
13
|
+
const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
|
|
13
14
|
/**
|
|
14
15
|
* This is the root helper object to work with the {@link DataflowGraph}.
|
|
15
16
|
*
|
|
@@ -147,6 +148,26 @@ exports.Dataflow = {
|
|
|
147
148
|
}
|
|
148
149
|
return df;
|
|
149
150
|
},
|
|
151
|
+
/**
|
|
152
|
+
* Whether the node is quoted, i.e., affected by a {@link EdgeType.NonStandardEvaluation} edge that actually
|
|
153
|
+
* keeps it from being evaluated (as `quote` and `substitute` do).
|
|
154
|
+
*
|
|
155
|
+
* Loops mark their body as non-standard-evaluated as well, yet that body really is evaluated (and its symbols
|
|
156
|
+
* really are read), so such an edge does not quote. Use this instead of testing for the edge type directly
|
|
157
|
+
* whenever you want to know whether something is evaluated at all.
|
|
158
|
+
* @param id - The id of the node to check
|
|
159
|
+
* @param graph - The graph the node is part of
|
|
160
|
+
* @param withOutgoing - Whether to also consider the outgoing edges of the node (i.e., whether the node itself
|
|
161
|
+
* quotes something), and not just the ingoing ones (i.e., whether it is quoted)
|
|
162
|
+
*/
|
|
163
|
+
isQuoted(id, graph, withOutgoing = false) {
|
|
164
|
+
/* an nse edge quotes iff it does not originate from a loop marking its body */
|
|
165
|
+
const quotes = (source, e) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.NonStandardEvaluation) && !model_1.RLoopConstructs.is(graph.idMap?.get(source));
|
|
166
|
+
if (graph.ingoingEdges(id)?.entries().some(([source, e]) => quotes(source, e))) {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
return withOutgoing && (graph.outgoingEdges(id)?.values().some(e => quotes(id, e)) ?? false);
|
|
170
|
+
},
|
|
150
171
|
/**
|
|
151
172
|
* Given the id of a vertex (usually a variable use),
|
|
152
173
|
* this returns a reachable provenance set by calculating a non-interprocedural and non-context sensitive backward slice, but stopping at the given ids!
|
|
@@ -10,7 +10,10 @@ export declare function isInstalledResourceFile(file: string | undefined): boole
|
|
|
10
10
|
* constant such as `T`, `pi`). Broader than `getOriginInDfg`, which misses built-in constants.
|
|
11
11
|
*/
|
|
12
12
|
export declare function useResolvesToDefinitionOrBuiltin(graph: DataflowGraph, id: NodeId): boolean;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Whether any edge incident to `id` marks it as non-standard-evaluated (quoted), e.g. `quote`/`substitute`.
|
|
15
|
+
* A loop body is marked as non-standard-evaluated too, but it is evaluated, so it does not count here.
|
|
16
|
+
*/
|
|
14
17
|
export declare function isNonStandardEvaluated(graph: DataflowGraph, id: NodeId): boolean;
|
|
15
18
|
/**
|
|
16
19
|
* Whether the use `id` sits inside a `[`/`[[` subscript (not the accessed object). `data.table`'s
|
|
@@ -7,6 +7,7 @@ exports.isInSubscript = isInSubscript;
|
|
|
7
7
|
exports.collectScopeDefinedNames = collectScopeDefinedNames;
|
|
8
8
|
exports.isDefinedInEnclosingScope = isDefinedInEnclosingScope;
|
|
9
9
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
10
|
+
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
10
11
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
11
12
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
12
13
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
@@ -37,10 +38,12 @@ function useResolvesToDefinitionOrBuiltin(graph, id) {
|
|
|
37
38
|
}
|
|
38
39
|
return false;
|
|
39
40
|
}
|
|
40
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Whether any edge incident to `id` marks it as non-standard-evaluated (quoted), e.g. `quote`/`substitute`.
|
|
43
|
+
* A loop body is marked as non-standard-evaluated too, but it is evaluated, so it does not count here.
|
|
44
|
+
*/
|
|
41
45
|
function isNonStandardEvaluated(graph, id) {
|
|
42
|
-
|
|
43
|
-
return (graph.outgoingEdges(id)?.values().some(nse) ?? false) || (graph.ingoingEdges(id)?.values().some(nse) ?? false);
|
|
46
|
+
return df_helper_1.Dataflow.isQuoted(id, graph, true);
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* Whether the use `id` sits inside a `[`/`[[` subscript (not the accessed object). `data.table`'s
|
package/package.json
CHANGED
|
@@ -15,14 +15,6 @@ const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
|
15
15
|
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
16
16
|
const queue_1 = require("../../../util/collections/queue");
|
|
17
17
|
const r_base_packages_1 = require("../../../util/r-base-packages");
|
|
18
|
-
/* if the node is effected by nse, we have an ingoing nse edge */
|
|
19
|
-
function isQuoted(node, graph) {
|
|
20
|
-
const vertex = graph.ingoingEdges(node);
|
|
21
|
-
if (vertex === undefined) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return vertex.values().some(e => edge_1.DfEdge.includesType(e, edge_1.EdgeType.NonStandardEvaluation));
|
|
25
|
-
}
|
|
26
18
|
function makeReport(collector) {
|
|
27
19
|
const result = {};
|
|
28
20
|
for (const [kind, collected] of collector.store) {
|
|
@@ -319,7 +311,7 @@ async function executeCallContextQueries({ analyzer }, queries) {
|
|
|
319
311
|
continue;
|
|
320
312
|
}
|
|
321
313
|
}
|
|
322
|
-
if (isQuoted(nodeId, dataflow.graph)) {
|
|
314
|
+
if (df_helper_1.Dataflow.isQuoted(nodeId, dataflow.graph)) {
|
|
323
315
|
/* if the call is quoted, we do not want to link to it */
|
|
324
316
|
continue;
|
|
325
317
|
}
|
package/util/version.js
CHANGED
|
@@ -42,7 +42,7 @@ const assert_1 = require("./assert");
|
|
|
42
42
|
const sigdb_download_1 = require("../project/sigdb/sigdb-download");
|
|
43
43
|
const doc_files_1 = require("../documentation/doc-util/doc-files");
|
|
44
44
|
// this is automatically replaced with the current version by release-it
|
|
45
|
-
const version = '2.13.
|
|
45
|
+
const version = '2.13.8';
|
|
46
46
|
// this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
|
|
47
47
|
const versionDate = '2026-07-15T07:13:44Z';
|
|
48
48
|
/**
|