@eagleoutice/flowr 2.4.1 → 2.4.2

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 CHANGED
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
24
24
 
25
25
  ```shell
26
26
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
27
- flowR repl using flowR v2.4.0, R v4.5.0 (r-shell engine)
27
+ flowR repl using flowR v2.4.1, R v4.5.0 (r-shell engine)
28
28
  R> :query @linter "read.csv(\"/root/x.txt\")"
29
29
  ```
30
30
 
@@ -33,7 +33,7 @@ It offers a wide variety of features, for example:
33
33
 
34
34
 
35
35
  ```text
36
- Query: linter (2 ms)
36
+ Query: linter (3 ms)
37
37
  ╰ **Deprecated Functions** (deprecated-functions):
38
38
  ╰ _Metadata_: <code>{"totalDeprecatedCalls":0,"totalDeprecatedFunctionDefinitions":0,"searchTimeMs":0,"processTimeMs":0}</code>
39
39
  ╰ **File Path Validity** (file-path-validity):
@@ -45,16 +45,16 @@ It offers a wide variety of features, for example:
45
45
  ╰ **Absolute Paths** (absolute-file-paths):
46
46
  ╰ certain:
47
47
  ╰ Path `/root/x.txt` at 1.1-23
48
- ╰ _Metadata_: <code>{"totalConsidered":1,"totalUnknown":0,"searchTimeMs":0,"processTimeMs":0}</code>
48
+ ╰ _Metadata_: <code>{"totalConsidered":1,"totalUnknown":0,"searchTimeMs":1,"processTimeMs":0}</code>
49
49
  ╰ **Unused Definitions** (unused-definitions):
50
50
  ╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":0}</code>
51
51
  ╰ **Naming Convention** (naming-convention):
52
- ╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":1,"processTimeMs":0}</code>
52
+ ╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":0}</code>
53
53
  ╰ **Dataframe Access Validation** (dataframe-access-validation):
54
- ╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":0}</code>
54
+ ╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":1}</code>
55
55
  ╰ **Dead Code** (dead-code):
56
56
  ╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":0,"processTimeMs":0}</code>
57
- All queries together required ≈2 ms (1ms accuracy, total 8 ms)
57
+ All queries together required ≈3 ms (1ms accuracy, total 9 ms)
58
58
  ```
59
59
 
60
60
 
@@ -76,9 +76,9 @@ It offers a wide variety of features, for example:
76
76
 
77
77
  _Results (prettified and summarized):_
78
78
 
79
- Query: **linter** (13 ms)\
79
+ Query: **linter** (14 ms)\
80
80
  &nbsp;&nbsp;&nbsp;╰ **Deprecated Functions** (deprecated-functions):\
81
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalDeprecatedCalls":0,"totalDeprecatedFunctionDefinitions":0,"searchTimeMs":2,"processTimeMs":0}</code>\
81
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalDeprecatedCalls":0,"totalDeprecatedFunctionDefinitions":0,"searchTimeMs":1,"processTimeMs":0}</code>\
82
82
  &nbsp;&nbsp;&nbsp;╰ **File Path Validity** (file-path-validity):\
83
83
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ certain:\
84
84
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ Path `/root/x.txt` at 1.1-23\
@@ -88,20 +88,20 @@ It offers a wide variety of features, for example:
88
88
  &nbsp;&nbsp;&nbsp;╰ **Absolute Paths** (absolute-file-paths):\
89
89
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ certain:\
90
90
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ Path `/root/x.txt` at 1.1-23\
91
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalConsidered":1,"totalUnknown":0,"searchTimeMs":1,"processTimeMs":0}</code>\
91
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalConsidered":1,"totalUnknown":0,"searchTimeMs":2,"processTimeMs":0}</code>\
92
92
  &nbsp;&nbsp;&nbsp;╰ **Unused Definitions** (unused-definitions):\
93
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":1,"processTimeMs":0}</code>\
93
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":1}</code>\
94
94
  &nbsp;&nbsp;&nbsp;╰ **Naming Convention** (naming-convention):\
95
95
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":0}</code>\
96
96
  &nbsp;&nbsp;&nbsp;╰ **Dataframe Access Validation** (dataframe-access-validation):\
97
97
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":2}</code>\
98
98
  &nbsp;&nbsp;&nbsp;╰ **Dead Code** (dead-code):\
99
99
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":1,"processTimeMs":0}</code>\
100
- _All queries together required ≈13 ms (1ms accuracy, total 215 ms)_
100
+ _All queries together required ≈14 ms (1ms accuracy, total 226 ms)_
101
101
 
102
102
  <details> <summary style="color:gray">Show Detailed Results as Json</summary>
103
103
 
104
- The analysis required _214.5 ms_ (including parsing and normalization and the query) within the generation environment.
104
+ The analysis required _225.5 ms_ (including parsing and normalization and the query) within the generation environment.
105
105
 
106
106
  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.
107
107
  Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
@@ -118,7 +118,7 @@ It offers a wide variety of features, for example:
118
118
  ".meta": {
119
119
  "totalDeprecatedCalls": 0,
120
120
  "totalDeprecatedFunctionDefinitions": 0,
121
- "searchTimeMs": 2,
121
+ "searchTimeMs": 1,
122
122
  "processTimeMs": 0
123
123
  }
124
124
  },
@@ -171,7 +171,7 @@ It offers a wide variety of features, for example:
171
171
  ".meta": {
172
172
  "totalConsidered": 1,
173
173
  "totalUnknown": 0,
174
- "searchTimeMs": 1,
174
+ "searchTimeMs": 2,
175
175
  "processTimeMs": 0
176
176
  }
177
177
  },
@@ -179,8 +179,8 @@ It offers a wide variety of features, for example:
179
179
  "results": [],
180
180
  ".meta": {
181
181
  "totalConsidered": 0,
182
- "searchTimeMs": 1,
183
- "processTimeMs": 0
182
+ "searchTimeMs": 0,
183
+ "processTimeMs": 1
184
184
  }
185
185
  },
186
186
  "naming-convention": {
@@ -212,11 +212,11 @@ It offers a wide variety of features, for example:
212
212
  }
213
213
  },
214
214
  ".meta": {
215
- "timing": 13
215
+ "timing": 14
216
216
  }
217
217
  },
218
218
  ".meta": {
219
- "timing": 13
219
+ "timing": 14
220
220
  }
221
221
  }
222
222
  ```
@@ -283,7 +283,7 @@ It offers a wide variety of features, for example:
283
283
 
284
284
  ```shell
285
285
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
286
- flowR repl using flowR v2.4.0, R v4.5.0 (r-shell engine)
286
+ flowR repl using flowR v2.4.1, R v4.5.0 (r-shell engine)
287
287
  R> :slicer test/testfiles/example.R --criterion "11@sum"
288
288
  ```
289
289
 
@@ -330,7 +330,7 @@ It offers a wide variety of features, for example:
330
330
 
331
331
 
332
332
  * 🚀 **fast data- and control-flow graphs**\
333
- Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">139.1 ms</span></i> (as of Aug 6, 2025),
333
+ Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">134.8 ms</span></i> (as of Aug 18, 2025),
334
334
  _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,
335
335
  and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the dataflow graph.
336
336
 
@@ -366,7 +366,7 @@ It offers a wide variety of features, for example:
366
366
 
367
367
  ```shell
368
368
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
369
- flowR repl using flowR v2.4.0, R v4.5.0 (r-shell engine)
369
+ flowR repl using flowR v2.4.1, R v4.5.0 (r-shell engine)
370
370
  R> :dataflow* test/testfiles/example.R
371
371
  ```
372
372
 
@@ -667,7 +667,7 @@ It offers a wide variety of features, for example:
667
667
  ```
668
668
 
669
669
 
670
- (The analysis required _13.9 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
670
+ (The analysis required _14.5 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
671
671
 
672
672
 
673
673
 
@@ -35,9 +35,9 @@ visitor) {
35
35
  queue = queue.concat(get.elems.toReversed().map(e => e.id));
36
36
  }
37
37
  }
38
- const incoming = graph.outgoingEdges(current) ?? [];
39
- for (const [from] of incoming) {
40
- queue.push(from);
38
+ const incoming = graph.outgoingEdges(current);
39
+ if (incoming) {
40
+ queue.push(...incoming.keys());
41
41
  }
42
42
  }
43
43
  }
@@ -160,7 +160,7 @@ export declare class DataflowGraph<Vertex extends DataflowGraphVertexInfo = Data
160
160
  *
161
161
  * @see #edges
162
162
  */
163
- vertices(includeDefinedFunctions: boolean): MapIterator<[NodeId, Vertex]>;
163
+ vertices(includeDefinedFunctions: boolean): IterableIterator<[NodeId, Vertex]>;
164
164
  /**
165
165
  * @returns the ids of all edges in the graph together with their edge information
166
166
  *
@@ -25,7 +25,7 @@ const built_in_1 = require("../environments/built-in");
25
25
  const prefix_1 = require("../../util/prefix");
26
26
  function findNonLocalReads(graph, ignore) {
27
27
  const ignores = new Set(ignore.map(i => i.nodeId));
28
- const ids = new Set(graph.vertices(true)
28
+ const ids = new Set([...graph.vertices(true)]
29
29
  .filter(([_, info]) => info.tag === vertex_1.VertexType.Use || info.tag === vertex_1.VertexType.FunctionCall)
30
30
  .map(([id, _]) => id));
31
31
  /* find all variable use ids which do not link to a given id */
@@ -189,11 +189,11 @@ function linkFunctionCall(graph, id, info, idMap, thisGraph, calledFunctionDefin
189
189
  * @param thisGraph - The graph to search for function calls in
190
190
  */
191
191
  function linkFunctionCalls(graph, idMap, thisGraph) {
192
- const functionCalls = thisGraph.vertices(true)
193
- .filter(([_, info]) => info.tag === vertex_1.VertexType.FunctionCall);
194
192
  const calledFunctionDefinitions = [];
195
- for (const [id, info] of functionCalls) {
196
- linkFunctionCall(graph, id, info, idMap, thisGraph, calledFunctionDefinitions);
193
+ for (const [id, info] of thisGraph.vertices(true)) {
194
+ if (info.tag === vertex_1.VertexType.FunctionCall) {
195
+ linkFunctionCall(graph, id, info, idMap, thisGraph, calledFunctionDefinitions);
196
+ }
197
197
  }
198
198
  return calledFunctionDefinitions;
199
199
  }
@@ -150,7 +150,7 @@ function processExpressionList(name, args, rootId, data) {
150
150
  controlDependencies: data.controlDependencies
151
151
  });
152
152
  }
153
- const ingoing = [...remainingRead.values().flatMap(v => v)];
153
+ const ingoing = [...remainingRead.values()].flat();
154
154
  const rootNode = data.completeAst.idMap.get(rootId);
155
155
  const withGroup = rootNode?.grouping;
156
156
  if (withGroup) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
@@ -108,7 +108,7 @@ function getValueOfArgument(graph, call, argument, additionalAllowedTypes) {
108
108
  }
109
109
  }
110
110
  function identifyLinkToLastCallRelation(from, cfg, graph, { callName, ignoreIf, cascadeIf }) {
111
- if (ignoreIf && ignoreIf(from, graph)) {
111
+ if (ignoreIf?.(from, graph)) {
112
112
  return [];
113
113
  }
114
114
  const found = [];
package/util/version.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.flowrVersion = flowrVersion;
4
4
  const semver_1 = require("semver");
5
5
  // this is automatically replaced with the current version by release-it
6
- const version = '2.4.1';
6
+ const version = '2.4.2';
7
7
  function flowrVersion() {
8
8
  return new semver_1.SemVer(version);
9
9
  }