@eagleoutice/flowr 2.8.10 → 2.8.11

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.8.9, R grammar v14 (tree-sitter engine)
27
+ flowR repl using flowR v2.8.10, R grammar v14 (tree-sitter engine)
28
28
  R> :query @linter "read.csv(\"/root/x.txt\")"
29
29
  ```
30
30
 
@@ -51,9 +51,9 @@ It offers a wide variety of features, for example:
51
51
  ╰ Naming Convention (naming-convention):
52
52
  ╰ Metadata: numMatches: 0, numBreak: 0, searchTimeMs: 0, processTimeMs: 0
53
53
  ╰ Network Functions (network-functions):
54
- ╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0
54
+ ╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
55
55
  ╰ Dataframe Access Validation (dataframe-access-validation):
56
- ╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0
56
+ ╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 1
57
57
  ╰ Dead Code (dead-code):
58
58
  ╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
59
59
  ╰ Useless Loops (useless-loop):
@@ -92,13 +92,13 @@ It offers a wide variety of features, for example:
92
92
     ╰ **Absolute Paths** (absolute-file-paths):\
93
93
         ╰ certain:\
94
94
             ╰ Path `/root/x.txt` at 1.1-23\
95
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0</code>\
95
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0</code>\
96
96
  &nbsp;&nbsp;&nbsp;╰ **Unused Definitions** (unused-definitions):\
97
97
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
98
98
  &nbsp;&nbsp;&nbsp;╰ **Naming Convention** (naming-convention):\
99
99
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>numMatches: 0, numBreak: 0, searchTimeMs: 0, processTimeMs: 0</code>\
100
100
  &nbsp;&nbsp;&nbsp;╰ **Network Functions** (network-functions):\
101
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0</code>\
101
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0</code>\
102
102
  &nbsp;&nbsp;&nbsp;╰ **Dataframe Access Validation** (dataframe-access-validation):\
103
103
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
104
104
  &nbsp;&nbsp;&nbsp;╰ **Dead Code** (dead-code):\
@@ -109,7 +109,7 @@ It offers a wide variety of features, for example:
109
109
 
110
110
  <details> <summary style="color:gray">Show Detailed Results as Json</summary>
111
111
 
112
- The analysis required _2.2 ms_ (including parsing and normalization and the query) within the generation environment.
112
+ The analysis required _2.3 ms_ (including parsing and normalization and the query) within the generation environment.
113
113
 
114
114
  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.
115
115
  Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
@@ -181,7 +181,7 @@ It offers a wide variety of features, for example:
181
181
  ".meta": {
182
182
  "totalConsidered": 1,
183
183
  "totalUnknown": 0,
184
- "searchTimeMs": 1,
184
+ "searchTimeMs": 0,
185
185
  "processTimeMs": 0
186
186
  }
187
187
  },
@@ -207,7 +207,7 @@ It offers a wide variety of features, for example:
207
207
  ".meta": {
208
208
  "totalCalls": 0,
209
209
  "totalFunctionDefinitions": 0,
210
- "searchTimeMs": 0,
210
+ "searchTimeMs": 1,
211
211
  "processTimeMs": 0
212
212
  }
213
213
  },
@@ -308,7 +308,7 @@ It offers a wide variety of features, for example:
308
308
 
309
309
  ```shell
310
310
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
311
- flowR repl using flowR v2.8.9, R grammar v14 (tree-sitter engine)
311
+ flowR repl using flowR v2.8.10, R grammar v14 (tree-sitter engine)
312
312
  R> :query @static-slice (11@sum) file://test/testfiles/example.R
313
313
  ```
314
314
 
@@ -322,7 +322,7 @@ It offers a wide variety of features, for example:
322
322
  N <- 10
323
323
  for(i in 1:(N-1)) sum <- sum + i + w
324
324
  sum
325
- All queries together required ≈3 ms (1ms accuracy, total 3 ms)
325
+ All queries together required ≈3 ms (1ms accuracy, total 4 ms)
326
326
  ```
327
327
 
328
328
 
@@ -356,7 +356,7 @@ It offers a wide variety of features, for example:
356
356
 
357
357
 
358
358
  * 🚀 **fast call-graph, data-, and control-flow graphs**\
359
- Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">117 ms</span></i> (as of Jan 18, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
359
+ Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">119.8 ms</span></i> (as of Jan 27, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
360
360
  _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,
361
361
  and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) for more details on the dataflow graphs as well as call graphs.
362
362
 
@@ -392,7 +392,7 @@ It offers a wide variety of features, for example:
392
392
 
393
393
  ```shell
394
394
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
395
- flowR repl using flowR v2.8.9, R grammar v14 (tree-sitter engine)
395
+ flowR repl using flowR v2.8.10, R grammar v14 (tree-sitter engine)
396
396
  R> :dataflow* test/testfiles/example.R
397
397
  ```
398
398
 
@@ -697,7 +697,7 @@ It offers a wide variety of features, for example:
697
697
  ```
698
698
 
699
699
 
700
- (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.)
700
+ (The analysis required _4.5 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
701
701
 
702
702
 
703
703
 
@@ -62,10 +62,8 @@ function toBasicBlocks(cfg, _info) {
62
62
  * @param cfg - The control flow graph whose reachable nodes to find.
63
63
  */
64
64
  function cfgFindAllReachable(cfg) {
65
- const reachable = new Set();
66
- (0, simple_visitor_1.visitCfgInOrder)(cfg.graph, cfg.entryPoints, node => {
67
- reachable.add(node);
65
+ return (0, simple_visitor_1.visitCfgInOrder)(cfg.graph, cfg.entryPoints, () => {
66
+ /* do nothing */
68
67
  });
69
- return reachable;
70
68
  }
71
69
  //# sourceMappingURL=cfg-simplification.js.map
@@ -0,0 +1,5 @@
1
+ import { ControlFlowGraph } from './control-flow-graph';
2
+ /**
3
+ * Inverts the given dataflow graph by reversing all edges.
4
+ */
5
+ export declare function invertCfg(graph: ControlFlowGraph): ControlFlowGraph;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.invertCfg = invertCfg;
4
+ const control_flow_graph_1 = require("./control-flow-graph");
5
+ /**
6
+ * Inverts the given dataflow graph by reversing all edges.
7
+ */
8
+ function invertCfg(graph) {
9
+ const invertedGraph = new control_flow_graph_1.ControlFlowGraph();
10
+ for (const [, v] of graph.vertices(true)) {
11
+ invertedGraph.addVertex(v);
12
+ }
13
+ for (const [from, targets] of graph.edges()) {
14
+ for (const [to, t] of targets) {
15
+ invertedGraph.addEdge(to, from, t);
16
+ }
17
+ }
18
+ return invertedGraph;
19
+ }
20
+ //# sourceMappingURL=invert-cfg.js.map
@@ -20,7 +20,7 @@ export declare function visitCfgInReverseOrder(graph: ControlFlowGraph, startNod
20
20
  * This function is of type {@link SimpleCfgVisitor}.
21
21
  * @see {@link visitCfgInReverseOrder} for a traversal in reversed order
22
22
  */
23
- export declare function visitCfgInOrder(graph: ControlFlowGraph, startNodes: readonly NodeId[], visitor: (node: NodeId) => boolean | void): void;
23
+ export declare function visitCfgInOrder(graph: ControlFlowGraph, startNodes: readonly NodeId[], visitor: (node: NodeId) => boolean | void): Set<NodeId>;
24
24
  /**
25
25
  * Check if a node can reach another node in the control flow graph.
26
26
  */
@@ -4,6 +4,7 @@ exports.visitCfgInReverseOrder = visitCfgInReverseOrder;
4
4
  exports.visitCfgInOrder = visitCfgInOrder;
5
5
  exports.canReach = canReach;
6
6
  const control_flow_graph_1 = require("./control-flow-graph");
7
+ const invert_cfg_1 = require("./invert-cfg");
7
8
  /**
8
9
  * Visit all nodes reachable from the start node in the control flow graph, traversing the dependencies but ignoring cycles.
9
10
  * @param graph - The control flow graph.
@@ -55,6 +56,7 @@ visitor) {
55
56
  const visited = new Set();
56
57
  let queue = startNodes.slice();
57
58
  const hasBb = graph.mayHaveBasicBlocks();
59
+ const g = (0, invert_cfg_1.invertCfg)(graph);
58
60
  while (queue.length > 0) {
59
61
  const current = queue.shift();
60
62
  if (visited.has(current)) {
@@ -65,16 +67,17 @@ visitor) {
65
67
  continue;
66
68
  }
67
69
  else if (hasBb) {
68
- const get = graph.getVertex(current);
70
+ const get = g.getVertex(current);
69
71
  if (get?.type === control_flow_graph_1.CfgVertexType.Block) {
70
72
  queue = queue.concat(get.elems.map(e => e.id));
71
73
  }
72
74
  }
73
- const outgoing = graph.ingoingEdges(current) ?? [];
75
+ const outgoing = g.outgoingEdges(current) ?? [];
74
76
  for (const [to] of outgoing) {
75
77
  queue.push(to);
76
78
  }
77
79
  }
80
+ return visited;
78
81
  }
79
82
  /**
80
83
  * Check if a node can reach another node in the control flow graph.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.8.10",
3
+ "version": "2.8.11",
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": {
package/util/version.js CHANGED
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
8
  // this is automatically replaced with the current version by release-it
9
- const version = '2.8.10';
9
+ const version = '2.8.11';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */