@eagleoutice/flowr 2.13.1 → 2.13.3
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 +46 -44
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +1 -0
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +3 -0
- package/abstract-interpretation/domains/state-domain-like.d.ts +1 -1
- package/cli/flowr.js +21 -5
- package/cli/repl/commands/repl-commands.js +11 -9
- package/cli/repl/commands/repl-query.js +1 -1
- package/cli/repl/commands/repl-signature.js +8 -1
- package/cli/repl/core.js +13 -10
- package/cli/repl/print-version.js +1 -1
- package/cli/repl/server/connection.d.ts +1 -1
- package/cli/repl/server/net.js +15 -0
- package/config.d.ts +37 -0
- package/config.js +63 -3
- package/control-flow/control-flow-graph.js +2 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +1 -1
- package/data/sigdb/sigdb.remote.json +1 -1
- package/dataflow/environments/append.d.ts +1 -1
- package/dataflow/environments/clone.d.ts +1 -1
- package/dataflow/environments/environment.d.ts +28 -4
- package/dataflow/environments/environment.js +66 -11
- package/dataflow/environments/identifier.d.ts +9 -8
- package/dataflow/environments/identifier.js +21 -13
- package/dataflow/environments/overwrite.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-working-directory.d.ts +29 -0
- package/dataflow/eval/resolve/resolve-working-directory.js +168 -0
- package/dataflow/extractor.js +2 -1
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/df-helper.d.ts +3 -2
- package/dataflow/graph/df-helper.js +11 -15
- package/dataflow/graph/diff-dataflow-graph.js +1 -1
- package/dataflow/graph/graph-helper.js +2 -6
- package/dataflow/graph/graph.d.ts +24 -0
- package/dataflow/graph/graph.js +25 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +51 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +15 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +9 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +1 -1
- package/documentation/doc-readme.js +14 -12
- package/documentation/doc-util/doc-normalized-ast.d.ts +1 -1
- package/documentation/wiki-dataflow-graph.js +4 -24
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-mk/doc-context.d.ts +10 -0
- package/documentation/wiki-mk/doc-context.js +3 -0
- package/documentation/wiki-query.js +47 -0
- package/documentation/wiki-signature-database.js +18 -7
- package/linter/linter-rules.d.ts +24 -2
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +4 -4
- package/linter/rules/absolute-path.js +7 -5
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/file-path-validity.js +48 -8
- package/linter/rules/function-finder-util.d.ts +2 -1
- package/linter/rules/syntactically-valid.d.ts +58 -0
- package/linter/rules/syntactically-valid.js +203 -0
- package/linter/rules/undefined-symbol-util.js +3 -1
- package/linter/rules/undefined-symbol.js +6 -6
- package/package.json +25 -12
- package/project/context/classify-project-kind.d.ts +40 -0
- package/project/context/classify-project-kind.js +76 -0
- package/project/context/flowr-analyzer-context.d.ts +4 -4
- package/project/context/flowr-analyzer-context.js +3 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +34 -9
- package/project/context/flowr-analyzer-dependencies-context.js +30 -3
- package/project/context/flowr-analyzer-files-context.d.ts +10 -8
- package/project/context/flowr-analyzer-files-context.js +26 -67
- package/project/context/flowr-analyzer-meta-context.d.ts +1 -0
- package/project/context/flowr-file.d.ts +5 -0
- package/project/context/flowr-file.js +5 -0
- package/project/dependency-version-space.d.ts +118 -26
- package/project/dependency-version-space.js +343 -87
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +8 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +27 -25
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +12 -4
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +25 -10
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +2 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +4 -4
- package/project/plugins/package-version-plugins/package.d.ts +27 -10
- package/project/plugins/package-version-plugins/package.js +50 -25
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +4 -1
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +57 -2
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +150 -28
- package/project/sigdb/decompress.d.ts +1 -1
- package/project/sigdb/decompress.js +4 -1
- package/project/sigdb/manifest.js +60 -26
- package/project/sigdb/reader.d.ts +26 -16
- package/project/sigdb/reader.js +52 -21
- package/project/sigdb/sigdb-download.d.ts +6 -7
- package/project/sigdb/sigdb-download.js +30 -9
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.js +2 -108
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +39 -77
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +12 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +54 -24
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +13 -0
- package/queries/catalog/input-sources-query/input-source-functions.js +96 -1
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +40 -4
- package/queries/catalog/input-sources-query/input-sources-query-format.js +21 -3
- package/queries/catalog/input-sources-query/input-types.d.ts +58 -0
- package/queries/catalog/input-sources-query/input-types.js +64 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +62 -52
- package/queries/catalog/input-sources-query/simple-input-classifier.js +334 -101
- package/queries/catalog/linter-query/linter-query-format.js +9 -2
- package/queries/catalog/project-query/project-query-executor.js +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +7 -1
- package/queries/catalog/signature-query/signature-query-executor.js +115 -39
- package/queries/catalog/signature-query/signature-query-format.d.ts +5 -1
- package/queries/catalog/signature-query/signature-query-format.js +1 -1
- package/queries/catalog/signature-query/signature-query-render.js +12 -7
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
- package/r-bridge/retriever.d.ts +1 -1
- package/r-bridge/retriever.js +6 -1
- package/r-bridge/shell.js +5 -0
- package/search/flowr-search-filters.d.ts +2 -1
- package/search/flowr-search-printer.js +10 -8
- package/slicing/static/static-slicer.d.ts +2 -2
- package/util/files.d.ts +6 -4
- package/util/files.js +30 -8
- package/util/mermaid/dfg.js +1 -1
- package/util/objects.js +6 -4
- package/util/r-base-packages.d.ts +2 -0
- package/util/r-base-packages.js +3 -0
- package/util/r-license.js +1 -4
- package/util/r-version.d.ts +12 -0
- package/util/r-version.js +16 -0
- package/util/range.d.ts +6 -2
- package/util/range.js +33 -15
- package/util/text/ansi.d.ts +7 -3
- package/util/text/ansi.js +8 -5
- package/util/version.js +4 -4
package/README.md
CHANGED
|
@@ -12,6 +12,25 @@ available for [VSCode](https://marketplace.visualstudio.com/items?itemName=code-
|
|
|
12
12
|
and [Docker](https://hub.docker.com/r/eagleoutice/flowr).
|
|
13
13
|
It offers a wide variety of features, for example:
|
|
14
14
|
|
|
15
|
+
* 📚 **dependency analysis**\
|
|
16
|
+
Given your analysis project, flowR offers a plethora of so-called [queries](https://github.com/flowr-analysis/flowr/wiki/query-api) to get more information about your code.
|
|
17
|
+
An important query is the [dependencies query](https://github.com/flowr-analysis/flowr/wiki/%5BQuery%5D-Dependencies), which shows you the library your project needs,
|
|
18
|
+
the data files it reads, the scripts it sources, and the data it outputs.
|
|
19
|
+
Building on it, the [guess dependency versions query](https://github.com/flowr-analysis/flowr/wiki/%5BQuery%5D-Guess-Dependency-Versions) narrows down the version range each
|
|
20
|
+
of these libraries has to have, by combining the constraints your project declares with the functions your code actually calls.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<details><summary>Example: Dependency Analysis with flowR</summary>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
The following showcases the dependency view of the [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr):
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</details>
|
|
33
|
+
|
|
15
34
|
* 🐞 **code linting**\
|
|
16
35
|
Analyze your R scripts for common issues and potential bugs (see the [wiki page](https://github.com/flowr-analysis/flowr/wiki/linter) for more information on the currently supported linters).
|
|
17
36
|
|
|
@@ -24,7 +43,7 @@ It offers a wide variety of features, for example:
|
|
|
24
43
|
|
|
25
44
|
```shell
|
|
26
45
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
27
|
-
flowR repl v2.13.
|
|
46
|
+
flowR repl v2.13.2, R grammar v14 (tree-sitter engine)
|
|
28
47
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
48
|
```
|
|
30
49
|
|
|
@@ -33,17 +52,17 @@ It offers a wide variety of features, for example:
|
|
|
33
52
|
|
|
34
53
|
|
|
35
54
|
```text
|
|
36
|
-
Query: linter (
|
|
55
|
+
Query: linter (3 ms)
|
|
37
56
|
╰ Deprecated Functions (deprecated-functions): no findings
|
|
38
57
|
╰ File Path Validity (file-path-validity):
|
|
39
58
|
╰ certain:
|
|
40
59
|
╰ Path `/root/x.txt` at 1.1-23
|
|
41
|
-
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
60
|
+
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 1
|
|
42
61
|
╰ Seeded Randomness (seeded-randomness): no findings
|
|
43
62
|
╰ Absolute Paths (absolute-file-paths):
|
|
44
63
|
╰ certain:
|
|
45
64
|
╰ Path `/root/x.txt` at 1.1-23
|
|
46
|
-
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
65
|
+
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0
|
|
47
66
|
╰ Unused Definitions (unused-definitions): no findings
|
|
48
67
|
╰ Network Functions (network-functions): no findings
|
|
49
68
|
╰ Dataframe Access Validation (dataframe-access-validation): no findings
|
|
@@ -54,7 +73,7 @@ It offers a wide variety of features, for example:
|
|
|
54
73
|
╰ Roxygen Arguments (roxygen-arguments): no findings
|
|
55
74
|
╰ No Leaked Credentials (no-leaked-credentials): no findings
|
|
56
75
|
╰ Undefined Symbol (undefined-symbol): no findings
|
|
57
|
-
All queries together required ≈
|
|
76
|
+
All queries together required ≈4 ms (1ms accuracy, total 4 ms)
|
|
58
77
|
```
|
|
59
78
|
|
|
60
79
|
|
|
@@ -76,17 +95,17 @@ It offers a wide variety of features, for example:
|
|
|
76
95
|
|
|
77
96
|
_Results (prettified and summarized):_
|
|
78
97
|
|
|
79
|
-
Query: **linter** (
|
|
98
|
+
Query: **linter** (5 ms)\
|
|
80
99
|
╰ **Deprecated Functions** (deprecated-functions): _no findings_\
|
|
81
100
|
╰ **File Path Validity** (file-path-validity):\
|
|
82
101
|
╰ certain:\
|
|
83
102
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
84
|
-
╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
103
|
+
╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 1\
|
|
85
104
|
╰ **Seeded Randomness** (seeded-randomness): _no findings_\
|
|
86
105
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
87
106
|
╰ certain:\
|
|
88
107
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
89
|
-
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
108
|
+
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0\
|
|
90
109
|
╰ **Unused Definitions** (unused-definitions): _no findings_\
|
|
91
110
|
╰ **Network Functions** (network-functions): _no findings_\
|
|
92
111
|
╰ **Dataframe Access Validation** (dataframe-access-validation): _no findings_\
|
|
@@ -97,11 +116,11 @@ It offers a wide variety of features, for example:
|
|
|
97
116
|
╰ **Roxygen Arguments** (roxygen-arguments): _no findings_\
|
|
98
117
|
╰ **No Leaked Credentials** (no-leaked-credentials): _no findings_\
|
|
99
118
|
╰ **Undefined Symbol** (undefined-symbol): _no findings_\
|
|
100
|
-
_All queries together required ≈
|
|
119
|
+
_All queries together required ≈5 ms (1ms accuracy, total 5 ms)_
|
|
101
120
|
|
|
102
121
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
103
122
|
|
|
104
|
-
The analysis required
|
|
123
|
+
The analysis required _4.8 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
105
124
|
|
|
106
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.
|
|
107
126
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -118,8 +137,8 @@ It offers a wide variety of features, for example:
|
|
|
118
137
|
".meta": {
|
|
119
138
|
"totalCalls": 0,
|
|
120
139
|
"totalFunctionDefinitions": 0,
|
|
121
|
-
"searchTimeMs":
|
|
122
|
-
"processTimeMs":
|
|
140
|
+
"searchTimeMs": 2,
|
|
141
|
+
"processTimeMs": 0
|
|
123
142
|
}
|
|
124
143
|
},
|
|
125
144
|
"file-path-validity": {
|
|
@@ -141,8 +160,8 @@ It offers a wide variety of features, for example:
|
|
|
141
160
|
"totalUnknown": 0,
|
|
142
161
|
"totalWritesBeforeAlways": 0,
|
|
143
162
|
"totalValid": 0,
|
|
144
|
-
"searchTimeMs":
|
|
145
|
-
"processTimeMs":
|
|
163
|
+
"searchTimeMs": 0,
|
|
164
|
+
"processTimeMs": 1
|
|
146
165
|
}
|
|
147
166
|
},
|
|
148
167
|
"seeded-randomness": {
|
|
@@ -153,7 +172,7 @@ It offers a wide variety of features, for example:
|
|
|
153
172
|
"callsWithAssignmentProducers": 0,
|
|
154
173
|
"callsWithNonConstantProducers": 0,
|
|
155
174
|
"callsWithOtherBranchProducers": 0,
|
|
156
|
-
"searchTimeMs":
|
|
175
|
+
"searchTimeMs": 0,
|
|
157
176
|
"processTimeMs": 0
|
|
158
177
|
}
|
|
159
178
|
},
|
|
@@ -173,7 +192,7 @@ It offers a wide variety of features, for example:
|
|
|
173
192
|
".meta": {
|
|
174
193
|
"totalConsidered": 1,
|
|
175
194
|
"totalUnknown": 0,
|
|
176
|
-
"searchTimeMs":
|
|
195
|
+
"searchTimeMs": 1,
|
|
177
196
|
"processTimeMs": 0
|
|
178
197
|
}
|
|
179
198
|
},
|
|
@@ -182,7 +201,7 @@ It offers a wide variety of features, for example:
|
|
|
182
201
|
".meta": {
|
|
183
202
|
"totalConsidered": 0,
|
|
184
203
|
"searchTimeMs": 0,
|
|
185
|
-
"processTimeMs":
|
|
204
|
+
"processTimeMs": 0
|
|
186
205
|
}
|
|
187
206
|
},
|
|
188
207
|
"network-functions": {
|
|
@@ -201,7 +220,7 @@ It offers a wide variety of features, for example:
|
|
|
201
220
|
"numAccesses": 0,
|
|
202
221
|
"totalAccessed": 0,
|
|
203
222
|
"searchTimeMs": 0,
|
|
204
|
-
"processTimeMs":
|
|
223
|
+
"processTimeMs": 0
|
|
205
224
|
}
|
|
206
225
|
},
|
|
207
226
|
"dead-code": {
|
|
@@ -223,7 +242,7 @@ It offers a wide variety of features, for example:
|
|
|
223
242
|
"results": [],
|
|
224
243
|
".meta": {
|
|
225
244
|
"searchTimeMs": 0,
|
|
226
|
-
"processTimeMs":
|
|
245
|
+
"processTimeMs": 1
|
|
227
246
|
}
|
|
228
247
|
},
|
|
229
248
|
"stop-call": {
|
|
@@ -262,16 +281,16 @@ It offers a wide variety of features, for example:
|
|
|
262
281
|
"subscript": 0
|
|
263
282
|
},
|
|
264
283
|
"searchTimeMs": 0,
|
|
265
|
-
"processTimeMs":
|
|
284
|
+
"processTimeMs": 0
|
|
266
285
|
}
|
|
267
286
|
}
|
|
268
287
|
},
|
|
269
288
|
".meta": {
|
|
270
|
-
"timing":
|
|
289
|
+
"timing": 5
|
|
271
290
|
}
|
|
272
291
|
},
|
|
273
292
|
".meta": {
|
|
274
|
-
"timing":
|
|
293
|
+
"timing": 5
|
|
275
294
|
}
|
|
276
295
|
}
|
|
277
296
|
```
|
|
@@ -335,7 +354,7 @@ It offers a wide variety of features, for example:
|
|
|
335
354
|
|
|
336
355
|
```shell
|
|
337
356
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
338
|
-
flowR repl v2.13.
|
|
357
|
+
flowR repl v2.13.2, R grammar v14 (tree-sitter engine)
|
|
339
358
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
340
359
|
```
|
|
341
360
|
|
|
@@ -349,7 +368,7 @@ It offers a wide variety of features, for example:
|
|
|
349
368
|
N <- 10
|
|
350
369
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
351
370
|
sum
|
|
352
|
-
All queries together required ≈
|
|
371
|
+
All queries together required ≈3 ms (1ms accuracy, total 3 ms)
|
|
353
372
|
```
|
|
354
373
|
|
|
355
374
|
|
|
@@ -363,25 +382,8 @@ It offers a wide variety of features, for example:
|
|
|
363
382
|
|
|
364
383
|
</details>
|
|
365
384
|
|
|
366
|
-
* 📚 **dependency analysis**\
|
|
367
|
-
Given your analysis project, flowR offers a plethora of so-called [queries](https://github.com/flowr-analysis/flowr/wiki/query-api) to get more information about your code.
|
|
368
|
-
An important query is the [dependencies query](https://github.com/flowr-analysis/flowr/wiki/%5BQuery%5D-Dependencies), which shows you the library your project needs,
|
|
369
|
-
the data files it reads, the scripts it sources, and the data it outputs.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
<details><summary>Example: Dependency Analysis with flowR</summary>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
The following showcases the dependency view of the [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr):
|
|
376
|
-
|
|
377
|
-

|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
</details>
|
|
382
|
-
|
|
383
385
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
384
|
-
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!">106.7 ms</span></i> (as of Jul 23, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
385
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,
|
|
386
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).
|
|
387
389
|
|
|
@@ -417,7 +419,7 @@ It offers a wide variety of features, for example:
|
|
|
417
419
|
|
|
418
420
|
```shell
|
|
419
421
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
420
|
-
flowR repl v2.13.
|
|
422
|
+
flowR repl v2.13.2, R grammar v14 (tree-sitter engine)
|
|
421
423
|
R> :dataflow* test/testfiles/example.R
|
|
422
424
|
```
|
|
423
425
|
|
|
@@ -690,7 +692,7 @@ It offers a wide variety of features, for example:
|
|
|
690
692
|
```
|
|
691
693
|
|
|
692
694
|
|
|
693
|
-
(The analysis required
|
|
695
|
+
(The analysis required _1.9 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`).)
|
|
694
696
|
|
|
695
697
|
|
|
696
698
|
|
|
@@ -136,6 +136,7 @@ function mapDataFrameIndexColRowAccess(access, inference, info) {
|
|
|
136
136
|
colnames: columns?.map(col => typeof col === 'string' ? col : undefined)
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
+
// eslint-disable-next-line no-useless-assignment -- ends the chain
|
|
139
140
|
operand = undefined;
|
|
140
141
|
}
|
|
141
142
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ResolveInfo } from '../../../dataflow/eval/resolve/alias-tracking';
|
|
2
2
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
3
3
|
import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
|
|
4
4
|
import type { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
|
|
@@ -851,6 +851,7 @@ function mapDataFrameSubset(args, params, inference, info) {
|
|
|
851
851
|
colnames: selectedCols?.map(col => typeof col === 'string' ? col : undefined),
|
|
852
852
|
...(duplicateCols || mixedAccess ? { options: { duplicateCols: true } } : {})
|
|
853
853
|
});
|
|
854
|
+
// eslint-disable-next-line no-useless-assignment -- ends the chain
|
|
854
855
|
operand = undefined;
|
|
855
856
|
}
|
|
856
857
|
}
|
|
@@ -932,6 +933,7 @@ function mapDataFrameSelect(args, params, inference, info) {
|
|
|
932
933
|
colnames: selectedCols?.map(col => typeof col === 'string' ? col : undefined),
|
|
933
934
|
...(renamedCols ? { options: { renamedCols: true } } : {})
|
|
934
935
|
});
|
|
936
|
+
// eslint-disable-next-line no-useless-assignment -- ends the chain
|
|
935
937
|
operand = undefined;
|
|
936
938
|
}
|
|
937
939
|
return result;
|
|
@@ -982,6 +984,7 @@ function mapDataFrameMutate(args, params, inference, info) {
|
|
|
982
984
|
colnames: deletedCols,
|
|
983
985
|
options: { maybe: true }
|
|
984
986
|
});
|
|
987
|
+
// eslint-disable-next-line no-useless-assignment -- ends the chain
|
|
985
988
|
operand = undefined;
|
|
986
989
|
}
|
|
987
990
|
return result;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
-
import {
|
|
2
|
+
import type { AnyAbstractDomain } from './abstract-domain';
|
|
3
3
|
/**
|
|
4
4
|
* An interface for state-like domains that store abstract values for AST nodes.
|
|
5
5
|
*/
|
package/cli/flowr.js
CHANGED
|
@@ -212,10 +212,26 @@ async function mainServer(useWebSocket) {
|
|
|
212
212
|
const backend = useWebSocket ? new WebSocketServerWrapper() : new NetServer();
|
|
213
213
|
await new FlowRServer(engines.engines, engines.default, options['r-session-access'], config, backend).start(options.port);
|
|
214
214
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
async function main() {
|
|
216
|
+
try {
|
|
217
|
+
if (options.server) {
|
|
218
|
+
await mainServer(options.ws);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
await mainRepl();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (e) {
|
|
225
|
+
const err = e;
|
|
226
|
+
console.error(ansi_1.formatter.format(`flowR failed to start: ${err.message}`, { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
227
|
+
if (options.verbose) {
|
|
228
|
+
console.error(err.stack);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
console.error((0, ansi_1.italic)('Run again with --verbose for the full stack trace.'));
|
|
232
|
+
}
|
|
233
|
+
(0, proc_1.exitSafe)(1);
|
|
234
|
+
}
|
|
220
235
|
}
|
|
236
|
+
void main();
|
|
221
237
|
//# sourceMappingURL=flowr.js.map
|
|
@@ -180,7 +180,6 @@ function getReplCommands() {
|
|
|
180
180
|
if (commandsInitialized) {
|
|
181
181
|
return _commands;
|
|
182
182
|
}
|
|
183
|
-
commandsInitialized = true;
|
|
184
183
|
for (const [script, { target, description, type, options }] of Object.entries(scripts_info_1.scripts)) {
|
|
185
184
|
if (type === 'master script') {
|
|
186
185
|
_commands[script] = {
|
|
@@ -204,6 +203,7 @@ function getReplCommands() {
|
|
|
204
203
|
};
|
|
205
204
|
}
|
|
206
205
|
}
|
|
206
|
+
commandsInitialized = true;
|
|
207
207
|
return _commands;
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -219,18 +219,20 @@ let commandNames = undefined;
|
|
|
219
219
|
// maps command names or aliases to the actual command name
|
|
220
220
|
let commandMapping = undefined;
|
|
221
221
|
function initCommandMapping() {
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
const mapping = {};
|
|
223
|
+
const names = [];
|
|
224
224
|
for (const [command, { aliases }] of Object.entries(getReplCommands())) {
|
|
225
|
-
(0, assert_1.guard)(
|
|
226
|
-
|
|
225
|
+
(0, assert_1.guard)(mapping[command] === undefined, `Command ${command} is already registered!`);
|
|
226
|
+
mapping[command] = command;
|
|
227
227
|
for (const alias of aliases) {
|
|
228
|
-
(0, assert_1.guard)(
|
|
229
|
-
|
|
228
|
+
(0, assert_1.guard)(mapping[alias] === undefined, `Command (alias) ${alias} is already registered!`);
|
|
229
|
+
mapping[alias] = command;
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
names.push(command);
|
|
232
|
+
names.push(...aliases);
|
|
233
233
|
}
|
|
234
|
+
commandMapping = mapping;
|
|
235
|
+
commandNames = names;
|
|
234
236
|
}
|
|
235
237
|
/**
|
|
236
238
|
* Get the command for a given command name or alias.
|
|
@@ -61,7 +61,7 @@ function printQueryDoc(output, name) {
|
|
|
61
61
|
output.stdout(`Run: ${(0, ansi_1.bold)(':query ' + syntax, output.formatter)}`);
|
|
62
62
|
output.stdout(`JSON: ${(0, ansi_1.italic)(queryTemplate(name, def.schema), output.formatter)}`);
|
|
63
63
|
const wiki = `https://github.com/flowr-analysis/flowr/wiki/${encodeURIComponent((0, query_1.queryWikiPage)(def.title).replaceAll(' ', '-'))}`;
|
|
64
|
-
output.stdout(`Docs: ${
|
|
64
|
+
output.stdout(`Docs: ${output.formatter.hyperlink(`${name} query`, wiki)}`);
|
|
65
65
|
}
|
|
66
66
|
/** A copy-pasteable JSON template for a query type: its `type` plus each required field as a placeholder. */
|
|
67
67
|
function queryTemplate(type, schema) {
|
|
@@ -8,6 +8,7 @@ const query_1 = require("../../../queries/query");
|
|
|
8
8
|
const signature_query_format_1 = require("../../../queries/catalog/signature-query/signature-query-format");
|
|
9
9
|
const query_print_1 = require("../../../queries/query-print");
|
|
10
10
|
const sigdb_download_1 = require("../../../project/sigdb/sigdb-download");
|
|
11
|
+
const config_1 = require("../../../config");
|
|
11
12
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
12
13
|
const signature_query_executor_1 = require("../../../queries/catalog/signature-query/signature-query-executor");
|
|
13
14
|
/** treat the whole line as arguments, no R code to separate */
|
|
@@ -67,7 +68,13 @@ async function runDownload(output, analyzer, rest) {
|
|
|
67
68
|
if (manifest) {
|
|
68
69
|
await analyzer.context().deps.addDatabaseSource(manifest);
|
|
69
70
|
analyzer.reset();
|
|
70
|
-
output.stdout(`Mounted ${(0, ansi_1.bold)(manifest, f)}
|
|
71
|
+
output.stdout(`Mounted ${(0, ansi_1.bold)(manifest, f)}.`);
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
output.stdout(`Recorded in ${(0, ansi_1.bold)((0, config_1.persistSigDbPathToGlobalConfig)(dir), f)}; loads automatically on the next startup.`);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
output.stderr((0, ansi_1.italic)(`Could not update global config (${e.message}); add ${dir} to solver.sigdb.additionalPaths manually.`, f));
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
80
|
catch (e) {
|
package/cli/repl/core.js
CHANGED
|
@@ -246,10 +246,16 @@ async function executeStatement(output, statement, analyzer, allowRSessionAccess
|
|
|
246
246
|
}
|
|
247
247
|
if (statement.startsWith(':')) {
|
|
248
248
|
const command = statement.slice(1).split(' ')[0].toLowerCase();
|
|
249
|
-
const processor = (0, repl_commands_1.getCommand)(command);
|
|
250
249
|
const bold = (s) => output.formatter.format(s, { style: 1 /* FontStyles.Bold */ });
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
const reportFailure = (e) => {
|
|
251
|
+
output.stderr(`${bold(`Failed to execute command ${command}`)}: ${e?.message}. Using the ${bold('--verbose')} flag on startup may provide additional information.\n`);
|
|
252
|
+
if (log_1.log.settings.minLevel < 6 /* LogLevel.Fatal */) {
|
|
253
|
+
console.error(e);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
try {
|
|
257
|
+
const processor = (0, repl_commands_1.getCommand)(command);
|
|
258
|
+
if (processor) {
|
|
253
259
|
await (0, query_1.genericWrapReplFailIfNoRequest)(async () => {
|
|
254
260
|
const remainingLine = statement.slice(command.length + 2).trim();
|
|
255
261
|
if (processor.isCodeCommand) {
|
|
@@ -265,15 +271,12 @@ async function executeStatement(output, statement, analyzer, allowRSessionAccess
|
|
|
265
271
|
}
|
|
266
272
|
}, output, analyzer);
|
|
267
273
|
}
|
|
268
|
-
|
|
269
|
-
output.stderr(
|
|
270
|
-
if (log_1.log.settings.minLevel < 6 /* LogLevel.Fatal */) {
|
|
271
|
-
console.error(e);
|
|
272
|
-
}
|
|
274
|
+
else {
|
|
275
|
+
output.stderr(`the command '${command}' is unknown, try ${bold(':help')} for more information\n`);
|
|
273
276
|
}
|
|
274
277
|
}
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
catch (e) {
|
|
279
|
+
reportFailure(e);
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
282
|
else {
|
|
@@ -40,7 +40,7 @@ function sigDbSummaryString() {
|
|
|
40
40
|
if (entries.length === 0) {
|
|
41
41
|
return it('no sigdb');
|
|
42
42
|
}
|
|
43
|
-
const link = (text, file) => it(ansi_1.formatter.hyperlink(text, (0, node_url_1.pathToFileURL)(file).href));
|
|
43
|
+
const link = (text, file) => it(ansi_1.formatter.hyperlink(text, (0, node_url_1.pathToFileURL)(file).href, true));
|
|
44
44
|
// if every ref shares the same date, print it once
|
|
45
45
|
const shared = entries.every(e => e.date !== undefined && e.date === entries[0].date) ? entries[0].date : undefined;
|
|
46
46
|
const refs = entries.map(e => link(shared === undefined && e.date !== undefined ? `${e.label} ${e.date}` : e.label, e.file));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Socket } from './net';
|
|
2
|
-
import { type TREE_SITTER_DATAFLOW_PIPELINE
|
|
2
|
+
import { DEFAULT_SLICING_PIPELINE, type TREE_SITTER_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
|
|
3
3
|
import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
|
|
4
4
|
import type { DeepPartial } from 'ts-essentials';
|
|
5
5
|
import type { KnownParser, ParseStepOutput } from '../../../r-bridge/parser';
|
package/cli/repl/server/net.js
CHANGED
|
@@ -18,6 +18,7 @@ class WebSocketServerWrapper {
|
|
|
18
18
|
}
|
|
19
19
|
start(port) {
|
|
20
20
|
this.server = new ws_1.WebSocketServer({ port, maxPayload: 1024 * 1024 * 1024 * 1024 });
|
|
21
|
+
this.server.on('error', (e) => reportListenFailure(port, e));
|
|
21
22
|
server_1.serverLog.info('WebSocket-Server wrapper is active!');
|
|
22
23
|
this.server.on('connection', c => this.connectHandler?.(new WebSocketWrapper(c)));
|
|
23
24
|
}
|
|
@@ -56,8 +57,22 @@ class NetServer {
|
|
|
56
57
|
this.server.on('connection', handler);
|
|
57
58
|
}
|
|
58
59
|
start(port) {
|
|
60
|
+
this.server.on('error', (e) => reportListenFailure(port, e));
|
|
59
61
|
this.server.listen(port);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
exports.NetServer = NetServer;
|
|
65
|
+
/** Log a clear, actionable message for a server that failed to bind its port, then exit (there is nothing left to serve). */
|
|
66
|
+
function reportListenFailure(port, e) {
|
|
67
|
+
if (e.code === 'EADDRINUSE') {
|
|
68
|
+
server_1.serverLog.error(`Port ${port} is already in use. Pick another port with --port <number> or stop the process using it.`);
|
|
69
|
+
}
|
|
70
|
+
else if (e.code === 'EACCES') {
|
|
71
|
+
server_1.serverLog.error(`Not allowed to listen on port ${port} (permission denied). Try a port above 1024 with --port <number>.`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
server_1.serverLog.error(`Failed to start the server on port ${port}: ${e.message}`);
|
|
75
|
+
}
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
63
78
|
//# sourceMappingURL=net.js.map
|
package/config.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { FlowrAnalyzerContext } from './project/context/flowr-analyzer-cont
|
|
|
10
10
|
import { ProjectKind } from './project/context/project-kind';
|
|
11
11
|
import type { BuiltInFlowrPluginArgs, BuiltInFlowrPluginName } from './project/plugins/plugin-registry';
|
|
12
12
|
import { type FlowrGasConfig } from './gas';
|
|
13
|
+
import type { InputClassifierConfig } from './queries/catalog/input-sources-query/simple-input-classifier';
|
|
13
14
|
export declare enum VariableResolve {
|
|
14
15
|
/** Don't resolve constants at all */
|
|
15
16
|
Disabled = "disabled",
|
|
@@ -156,6 +157,8 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
156
157
|
readonly project: {
|
|
157
158
|
/** Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files */
|
|
158
159
|
resolveUnknownPathsOnDisk: boolean;
|
|
160
|
+
/** Whether a directory that cannot be traversed during file discovery (e.g. due to permissions) aborts the analysis; when `false` (the default) such paths are logged and skipped. */
|
|
161
|
+
failOnInaccessiblePath?: boolean;
|
|
159
162
|
/** Overwrite the {@link ProjectKind} flowR would otherwise infer from the analyzed files, e.g. when auto-detection guesses wrong. */
|
|
160
163
|
useProjectType?: ProjectKind;
|
|
161
164
|
/**
|
|
@@ -170,12 +173,42 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
170
173
|
* {@link FlowrConfig.specializeConfig}.
|
|
171
174
|
*/
|
|
172
175
|
implicitSources?: string[];
|
|
176
|
+
/** Scoping options for the default project discovery. */
|
|
177
|
+
discovery?: {
|
|
178
|
+
/** Collect every file below the project root (greedy) instead of only the files the detected {@link ProjectKind} needs (default `false`). */
|
|
179
|
+
full?: boolean;
|
|
180
|
+
/** Per-{@link ProjectKind} include/exclude glob overrides layered on the default scoping. */
|
|
181
|
+
perKind?: Partial<Record<ProjectKind, {
|
|
182
|
+
include?: string[];
|
|
183
|
+
exclude?: string[];
|
|
184
|
+
}>>;
|
|
185
|
+
/** Case-insensitive globs that drop matching files from the intelligent discovery, regardless of kind (e.g. `.Renviron` to ignore environment files). */
|
|
186
|
+
ignore?: string[];
|
|
187
|
+
};
|
|
188
|
+
/** Overrides for the signals flowR uses to classify the {@link ProjectKind}; unset fields keep the built-in defaults. */
|
|
189
|
+
classification?: {
|
|
190
|
+
/** DESCRIPTION `Type:` values that mark a shiny app (default `shiny`, `shiny-app`, `shinyapp`). */
|
|
191
|
+
shinyDescriptionTypes?: string[];
|
|
192
|
+
/** File names a shiny app is assembled from (default `app.R`, `ui.R`, `server.R`, `global.R`). */
|
|
193
|
+
shinyEntryFiles?: string[];
|
|
194
|
+
/** Regex source evidencing shiny usage in an entry file. */
|
|
195
|
+
shinyUsagePattern?: string;
|
|
196
|
+
/** File extensions marking a notebook (default `ipynb`, `rmd`, `qmd`, `rnw`). */
|
|
197
|
+
notebookExtensions?: string[];
|
|
198
|
+
};
|
|
173
199
|
};
|
|
174
200
|
/** Linter configuration, usually specialized per {@link ProjectKind} via {@link FlowrConfig.specializeConfig}. */
|
|
175
201
|
readonly linter: {
|
|
176
202
|
/** Rule names excluded from the *default* rule set (a rule requested explicitly still runs). */
|
|
177
203
|
readonly disabledRules: string[];
|
|
178
204
|
};
|
|
205
|
+
/**
|
|
206
|
+
* Teaches the {@link InputSourcesQuery|input-sources} analysis (and with it the `problematic-inputs` linter)
|
|
207
|
+
* about further frameworks. Everything here is *added* to what flowR already knows, so a shiny app keeps its
|
|
208
|
+
* `input` even when you declare your own. Usually set per {@link ProjectKind} via {@link specializeConfig}.
|
|
209
|
+
* @see {@link InputClassifierConfig} - for what the entries mean
|
|
210
|
+
*/
|
|
211
|
+
readonly inputSources?: DeepWritable<InputClassifierConfig<string[]>>;
|
|
179
212
|
/**
|
|
180
213
|
* Overwrite (parts of) this configuration depending on the {@link ProjectKind} flowR detects for the project,
|
|
181
214
|
* e.g. to give a shiny app its implicit sources. An entry may `inherit` another kind's overwrite (merged first,
|
|
@@ -425,3 +458,7 @@ export declare const FlowrConfig: {
|
|
|
425
458
|
*/
|
|
426
459
|
readonly setInConfigInPlace: <Path extends ValidFlowrConfigPaths>(this: void, config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => void;
|
|
427
460
|
};
|
|
461
|
+
/** Path to the user-global `flowr.json`, read as a fallback when no project config is found. */
|
|
462
|
+
export declare function globalConfigFilePath(): string;
|
|
463
|
+
/** Persist `dbPath` into `solver.sigdb.additionalPaths` in the global config (creating it, preserving the user's raw JSON); idempotent, returns the file written. */
|
|
464
|
+
export declare function persistSigDbPathToGlobalConfig(dbPath: string): string;
|