@eagleoutice/flowr 2.4.3 → 2.4.5
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 +21 -21
- package/benchmark/summarizer/first-phase/process.js +1 -1
- package/linter/rules/absolute-path.js +2 -1
- package/linter/rules/dataframe-access-validation.js +1 -3
- package/linter/rules/unused-definition.js +1 -1
- package/package.json +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
- package/queries/query.js +3 -1
- package/util/version.js +1 -1
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.
|
|
27
|
+
flowR repl using flowR v2.4.4, R v4.5.0 (r-shell engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -33,19 +33,19 @@ It offers a wide variety of features, for example:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
Query: [;1mlinter[0m (
|
|
36
|
+
Query: [;1mlinter[0m (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):
|
|
40
40
|
╰ certain:
|
|
41
41
|
╰ Path `/root/x.txt` at 1.1-23
|
|
42
|
-
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":
|
|
42
|
+
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":1,"processTimeMs":0}</code>
|
|
43
43
|
╰ **Seeded Randomness** (seeded-randomness):
|
|
44
44
|
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
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":
|
|
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):
|
|
@@ -56,7 +56,7 @@ It offers a wide variety of features, for example:
|
|
|
56
56
|
╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
57
57
|
╰ **Useless Loops** (useless-loop):
|
|
58
58
|
╰ _Metadata_: <code>{"numOfUselessLoops":0,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
59
|
-
[;3mAll queries together required ≈
|
|
59
|
+
[;3mAll queries together required ≈3 ms (1ms accuracy, total 10 ms)[0m[0m
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
|
|
@@ -84,9 +84,9 @@ It offers a wide variety of features, for example:
|
|
|
84
84
|
╰ **File Path Validity** (file-path-validity):\
|
|
85
85
|
╰ certain:\
|
|
86
86
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
87
|
-
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":
|
|
87
|
+
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":5,"processTimeMs":0}</code>\
|
|
88
88
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
89
|
-
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":
|
|
89
|
+
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":1,"processTimeMs":0}</code>\
|
|
90
90
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
91
91
|
╰ certain:\
|
|
92
92
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
@@ -94,18 +94,18 @@ It offers a wide variety of features, for example:
|
|
|
94
94
|
╰ **Unused Definitions** (unused-definitions):\
|
|
95
95
|
╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":0}</code>\
|
|
96
96
|
╰ **Naming Convention** (naming-convention):\
|
|
97
|
-
╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":
|
|
97
|
+
╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":1}</code>\
|
|
98
98
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
99
|
-
╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":
|
|
99
|
+
╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":2}</code>\
|
|
100
100
|
╰ **Dead Code** (dead-code):\
|
|
101
101
|
╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":1,"processTimeMs":0}</code>\
|
|
102
102
|
╰ **Useless Loops** (useless-loop):\
|
|
103
103
|
╰ _Metadata_: <code>{"numOfUselessLoops":0,"searchTimeMs":0,"processTimeMs":0}</code>\
|
|
104
|
-
_All queries together required ≈14 ms (1ms accuracy, total
|
|
104
|
+
_All queries together required ≈14 ms (1ms accuracy, total 226 ms)_
|
|
105
105
|
|
|
106
106
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
107
107
|
|
|
108
|
-
The analysis required
|
|
108
|
+
The analysis required _226.4 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
109
109
|
|
|
110
110
|
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.
|
|
111
111
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -144,8 +144,8 @@ It offers a wide variety of features, for example:
|
|
|
144
144
|
"totalUnknown": 0,
|
|
145
145
|
"totalWritesBeforeAlways": 0,
|
|
146
146
|
"totalValid": 0,
|
|
147
|
-
"searchTimeMs":
|
|
148
|
-
"processTimeMs":
|
|
147
|
+
"searchTimeMs": 5,
|
|
148
|
+
"processTimeMs": 0
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
151
|
"seeded-randomness": {
|
|
@@ -155,8 +155,8 @@ It offers a wide variety of features, for example:
|
|
|
155
155
|
"callsWithFunctionProducers": 0,
|
|
156
156
|
"callsWithAssignmentProducers": 0,
|
|
157
157
|
"callsWithNonConstantProducers": 0,
|
|
158
|
-
"searchTimeMs":
|
|
159
|
-
"processTimeMs":
|
|
158
|
+
"searchTimeMs": 1,
|
|
159
|
+
"processTimeMs": 0
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
162
|
"absolute-file-paths": {
|
|
@@ -193,7 +193,7 @@ It offers a wide variety of features, for example:
|
|
|
193
193
|
"numMatches": 0,
|
|
194
194
|
"numBreak": 0,
|
|
195
195
|
"searchTimeMs": 0,
|
|
196
|
-
"processTimeMs":
|
|
196
|
+
"processTimeMs": 1
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
"dataframe-access-validation": {
|
|
@@ -203,7 +203,7 @@ It offers a wide variety of features, for example:
|
|
|
203
203
|
"numAccesses": 0,
|
|
204
204
|
"totalAccessed": 0,
|
|
205
205
|
"searchTimeMs": 0,
|
|
206
|
-
"processTimeMs":
|
|
206
|
+
"processTimeMs": 2
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
209
|
"dead-code": {
|
|
@@ -295,7 +295,7 @@ It offers a wide variety of features, for example:
|
|
|
295
295
|
|
|
296
296
|
```shell
|
|
297
297
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
298
|
-
flowR repl using flowR v2.4.
|
|
298
|
+
flowR repl using flowR v2.4.4, R v4.5.0 (r-shell engine)
|
|
299
299
|
R> :slicer test/testfiles/example.R --criterion "11@sum"
|
|
300
300
|
```
|
|
301
301
|
|
|
@@ -342,7 +342,7 @@ It offers a wide variety of features, for example:
|
|
|
342
342
|
|
|
343
343
|
|
|
344
344
|
* 🚀 **fast data- and control-flow graphs**\
|
|
345
|
-
Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
345
|
+
Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">136.3 ms</span></i> (as of Aug 20, 2025),
|
|
346
346
|
_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,
|
|
347
347
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the dataflow graph.
|
|
348
348
|
|
|
@@ -378,7 +378,7 @@ It offers a wide variety of features, for example:
|
|
|
378
378
|
|
|
379
379
|
```shell
|
|
380
380
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
381
|
-
flowR repl using flowR v2.4.
|
|
381
|
+
flowR repl using flowR v2.4.4, R v4.5.0 (r-shell engine)
|
|
382
382
|
R> :dataflow* test/testfiles/example.R
|
|
383
383
|
```
|
|
384
384
|
|
|
@@ -679,7 +679,7 @@ It offers a wide variety of features, for example:
|
|
|
679
679
|
```
|
|
680
680
|
|
|
681
681
|
|
|
682
|
-
(The analysis required _14.
|
|
682
|
+
(The analysis required _14.9 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
683
683
|
|
|
684
684
|
|
|
685
685
|
|
|
@@ -256,7 +256,7 @@ async function summarizeSlicerStats(stats, report = () => {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
function summarizeDfShapeStats({ perNodeStats, ...stats }) {
|
|
259
|
-
const nodeStats = perNodeStats.values()
|
|
259
|
+
const nodeStats = [...perNodeStats.values()];
|
|
260
260
|
const isTop = (value) => value === 'top';
|
|
261
261
|
const isInfinite = (value) => value === 'infinite';
|
|
262
262
|
const isBottom = (value) => value === 'bottom';
|
|
@@ -52,7 +52,8 @@ const PathFunctions = {
|
|
|
52
52
|
'file.path': (df, vtx, config) => {
|
|
53
53
|
const fsep = (0, resolve_argument_1.getArgumentStringValue)(config.solver.variables, df, vtx, undefined, 'fsep', true);
|
|
54
54
|
// in the future we can access `.Platform$file.sep` here
|
|
55
|
-
const
|
|
55
|
+
const v = fsep?.values();
|
|
56
|
+
const sepValues = v ? [...v].flatMap(s => [...s].filter(assert_1.isNotUndefined)) : [path_1.default.sep];
|
|
56
57
|
if (sepValues.some(s => s === dependencies_query_format_1.Unknown || (0, assert_1.isUndefined)(s))) {
|
|
57
58
|
// if we have no fsep, we cannot construct a path
|
|
58
59
|
return undefined;
|
|
@@ -13,8 +13,6 @@ const dfg_1 = require("../../util/mermaid/dfg");
|
|
|
13
13
|
const range_1 = require("../../util/range");
|
|
14
14
|
const linter_format_1 = require("../linter-format");
|
|
15
15
|
const linter_tags_1 = require("../linter-tags");
|
|
16
|
-
;
|
|
17
|
-
;
|
|
18
16
|
exports.DATA_FRAME_ACCESS_VALIDATION = {
|
|
19
17
|
createSearch: () => flowr_search_builder_1.Q.all().with(search_enrichers_1.Enrichment.CallTargets, { onlyBuiltin: true }),
|
|
20
18
|
processSearchResult: (elements, config, data) => {
|
|
@@ -44,7 +42,7 @@ exports.DATA_FRAME_ACCESS_VALIDATION = {
|
|
|
44
42
|
}
|
|
45
43
|
accesses.push(access);
|
|
46
44
|
}
|
|
47
|
-
const operations = accessOperations.entries().flatMap(([, operations]) => operations)
|
|
45
|
+
const operations = [...accessOperations.entries()].flatMap(([, operations]) => operations);
|
|
48
46
|
const metadata = {
|
|
49
47
|
numOperations: accessOperations.size,
|
|
50
48
|
numAccesses: operations.length,
|
|
@@ -73,7 +73,7 @@ exports.UNUSED_DEFINITION = {
|
|
|
73
73
|
}
|
|
74
74
|
const ingoingEdges = data.dataflow.graph.ingoingEdges(dfgVertex.id);
|
|
75
75
|
const interestedIn = (0, vertex_1.isVariableDefinitionVertex)(dfgVertex) ? InterestingEdgesVariable : InterestingEdgesFunction;
|
|
76
|
-
const ingoingInteresting = ingoingEdges?.values().some(e => (0, edge_1.edgeIncludesType)(e.types, interestedIn));
|
|
76
|
+
const ingoingInteresting = [...ingoingEdges?.values() ?? []].some(e => (0, edge_1.edgeIncludesType)(e.types, interestedIn));
|
|
77
77
|
if (ingoingInteresting) {
|
|
78
78
|
return undefined;
|
|
79
79
|
}
|
package/package.json
CHANGED
|
@@ -136,7 +136,7 @@ function getResults(data, results, kind, functions, makeInfo) {
|
|
|
136
136
|
const margs = info.additionalArgs?.mode;
|
|
137
137
|
(0, assert_1.guard)(margs, 'Need additional argument mode when checking for mode');
|
|
138
138
|
const modeArgs = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vertex, margs.argIdx, margs.argName, margs.resolveValue);
|
|
139
|
-
const modeValues = modeArgs?.values().flatMap(v => [...v]) ?? [];
|
|
139
|
+
const modeValues = [...modeArgs?.values() ?? []].flatMap(v => [...v]) ?? [];
|
|
140
140
|
if (info.ignoreIf === 'mode-only-read' && modeValues.every(m => m && readOnlyModes.has(m))) {
|
|
141
141
|
// all modes are read-only, so we can ignore this
|
|
142
142
|
return [];
|
package/queries/query.js
CHANGED
|
@@ -103,7 +103,9 @@ function executeQueries(data, queries) {
|
|
|
103
103
|
};
|
|
104
104
|
return r;
|
|
105
105
|
}
|
|
106
|
-
return Promise.all(results.map(([type, result]) => Promise.resolve(result).then(resolvedResult => [type, resolvedResult])
|
|
106
|
+
return Promise.all(results.map(([type, result]) => Promise.resolve(result).then(resolvedResult => [type, resolvedResult]).catch(() => {
|
|
107
|
+
return [type, undefined];
|
|
108
|
+
}))).then(resultsArray => {
|
|
107
109
|
const results = Object.fromEntries(resultsArray);
|
|
108
110
|
results['.meta'] = {
|
|
109
111
|
timing: Date.now() - now
|
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.
|
|
6
|
+
const version = '2.4.5';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|