@eagleoutice/flowr 2.10.9 → 2.10.10
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 +103 -33
- package/abstract-interpretation/absint-visitor.js +6 -3
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/interval-domain.js +1 -1
- package/abstract-interpretation/domains/lattice.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
- package/abstract-interpretation/domains/singleton-domain.d.ts +1 -1
- package/abstract-interpretation/domains/singleton-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.js +2 -2
- package/abstract-interpretation/unsupported-functions.d.ts +3 -2
- package/abstract-interpretation/unsupported-functions.js +38 -28
- package/cli/benchmark-app.js +2 -1
- package/cli/common/script.js +3 -2
- package/cli/flowr.js +47 -10
- package/cli/repl/commands/repl-cfg.js +9 -9
- package/cli/repl/commands/repl-commands.js +5 -0
- package/cli/repl/commands/repl-dataflow.js +31 -24
- package/cli/repl/commands/repl-main.d.ts +6 -0
- package/cli/repl/commands/repl-normalize.js +15 -12
- package/cli/repl/commands/repl-parse.js +1 -1
- package/cli/repl/commands/repl-query.js +4 -5
- package/cli/repl/commands/repl-quit.js +2 -1
- package/cli/repl/core.d.ts +11 -0
- package/cli/repl/core.js +101 -3
- package/cli/repl/execute.js +3 -2
- package/cli/repl/parser/slice-query-parser.d.ts +16 -0
- package/cli/repl/parser/slice-query-parser.js +52 -0
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +25 -0
- package/cli/repl/server/messages/message-analysis.d.ts +10 -0
- package/cli/repl/server/messages/message-analysis.js +6 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/script-core/statistics-core.js +2 -1
- package/cli/script-core/statistics-helper-core.js +2 -1
- package/cli/wiki.d.ts +2 -1
- package/cli/wiki.js +4 -1
- package/config.d.ts +9 -10
- package/config.js +25 -7
- package/control-flow/diff-cfg.d.ts +1 -1
- package/control-flow/diff-cfg.js +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +1 -0
- package/control-flow/simple-visitor.js +6 -5
- package/control-flow/useless-loop.js +2 -2
- package/core/print/dataflow-printer.d.ts +2 -2
- package/core/print/dataflow-printer.js +2 -2
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +146 -146
- package/dataflow/environments/append.d.ts +2 -1
- package/dataflow/environments/append.js +2 -1
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in.d.ts +2 -0
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +122 -66
- package/dataflow/environments/default-builtin-config.js +324 -145
- package/dataflow/environments/environment.d.ts +2 -1
- package/dataflow/environments/environment.js +13 -9
- package/dataflow/environments/identifier.d.ts +55 -2
- package/dataflow/environments/identifier.js +14 -2
- package/dataflow/environments/reference-to-maybe.d.ts +2 -0
- package/dataflow/environments/reference-to-maybe.js +56 -11
- package/dataflow/environments/resolve-by-name.js +13 -7
- package/dataflow/eval/values/general.js +4 -0
- package/dataflow/extractor.js +12 -2
- package/dataflow/graph/df-helper.d.ts +6 -0
- package/dataflow/graph/df-helper.js +33 -0
- package/dataflow/graph/graph.js +1 -1
- package/dataflow/info.d.ts +1 -1
- package/dataflow/internal/linker.d.ts +5 -1
- package/dataflow/internal/linker.js +34 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +53 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +58 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +38 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +9 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/named-call-handling.js +6 -0
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +1 -1
- package/dataflow/processor.d.ts +6 -0
- package/documentation/data/faq/faqs.d.ts +2 -1
- package/documentation/data/faq/faqs.js +75 -57
- package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
- package/documentation/data/server/doc-data-server-messages.js +15 -7
- package/documentation/doc-readme.js +15 -15
- package/documentation/doc-util/doc-cfg.d.ts +3 -1
- package/documentation/doc-util/doc-cfg.js +3 -3
- package/documentation/doc-util/doc-dfg.d.ts +3 -1
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-files.d.ts +3 -1
- package/documentation/doc-util/doc-files.js +9 -6
- package/documentation/doc-util/doc-normalized-ast.d.ts +3 -1
- package/documentation/doc-util/doc-normalized-ast.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +2 -1
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -0
- package/documentation/doc-util/doc-types.d.ts +6 -6
- package/documentation/doc-util/doc-types.js +11 -9
- package/documentation/issue-linting-rule.js +1 -2
- package/documentation/wiki-analyzer.js +9 -9
- package/documentation/wiki-cfg.js +40 -41
- package/documentation/wiki-core.js +119 -31
- package/documentation/wiki-create-linting-rules.d.ts +6 -0
- package/documentation/wiki-create-linting-rules.js +95 -0
- package/documentation/wiki-dataflow-graph.js +77 -76
- package/documentation/wiki-engine.js +1 -2
- package/documentation/wiki-faq.d.ts +2 -1
- package/documentation/wiki-faq.js +4 -4
- package/documentation/wiki-interface.js +19 -6
- package/documentation/wiki-linter.d.ts +1 -1
- package/documentation/wiki-linter.js +14 -6
- package/documentation/wiki-linting-and-testing.js +2 -2
- package/documentation/wiki-mk/doc-context.d.ts +3 -3
- package/documentation/wiki-mk/doc-maker.d.ts +2 -0
- package/documentation/wiki-mk/doc-maker.js +7 -1
- package/documentation/wiki-normalized-ast.js +5 -5
- package/documentation/wiki-onboarding.d.ts +2 -1
- package/documentation/wiki-onboarding.js +5 -5
- package/documentation/wiki-overview.js +3 -3
- package/documentation/wiki-query.js +85 -84
- package/documentation/wiki-search.js +4 -5
- package/documentation/wiki-setup.js +6 -7
- package/gas.d.ts +74 -0
- package/gas.js +18 -0
- package/linter/linter-executor.js +2 -8
- package/linter/linter-format.d.ts +4 -11
- package/linter/linter-rules.d.ts +88 -86
- package/linter/linter-rules.js +7 -1
- package/linter/rules/absolute-path.d.ts +2 -7
- package/linter/rules/absolute-path.js +6 -4
- package/linter/rules/dataframe-access-validation.d.ts +1 -6
- package/linter/rules/dataframe-access-validation.js +8 -6
- package/linter/rules/dead-code.d.ts +2 -11
- package/linter/rules/dead-code.js +16 -11
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/file-path-validity.d.ts +1 -6
- package/linter/rules/file-path-validity.js +5 -5
- package/linter/rules/function-finder-util.d.ts +7 -11
- package/linter/rules/function-finder-util.js +9 -6
- package/linter/rules/naming-convention.d.ts +2 -7
- package/linter/rules/naming-convention.js +3 -2
- package/linter/rules/network-functions.d.ts +2 -7
- package/linter/rules/network-functions.js +14 -12
- package/linter/rules/no-leaked-credentials.d.ts +36 -0
- package/linter/rules/no-leaked-credentials.js +75 -0
- package/linter/rules/problematic-inputs.d.ts +1 -8
- package/linter/rules/problematic-inputs.js +5 -4
- package/linter/rules/roxygen-arguments.d.ts +2 -7
- package/linter/rules/roxygen-arguments.js +13 -20
- package/linter/rules/seeded-randomness.d.ts +2 -7
- package/linter/rules/seeded-randomness.js +7 -4
- package/linter/rules/software-has-license.d.ts +31 -0
- package/linter/rules/software-has-license.js +46 -0
- package/linter/rules/software-has-tests.d.ts +38 -0
- package/linter/rules/software-has-tests.js +48 -0
- package/linter/rules/stop-with-call-arg.d.ts +2 -7
- package/linter/rules/stop-with-call-arg.js +3 -2
- package/linter/rules/unused-definition.d.ts +3 -8
- package/linter/rules/unused-definition.js +7 -5
- package/linter/rules/useless-loop.d.ts +2 -7
- package/linter/rules/useless-loop.js +5 -2
- package/package.json +3 -2
- package/project/context/flowr-analyzer-context.d.ts +13 -14
- package/project/context/flowr-analyzer-context.js +4 -0
- package/project/context/flowr-analyzer-files-context.d.ts +12 -0
- package/project/context/flowr-analyzer-files-context.js +12 -2
- package/project/context/flowr-analyzer-gas-context.d.ts +28 -0
- package/project/context/flowr-analyzer-gas-context.js +101 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +13 -7
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +56 -11
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +2 -2
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +5 -5
- package/project/plugins/flowr-analyzer-plugin.d.ts +15 -8
- package/project/plugins/flowr-analyzer-plugin.js +14 -7
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.d.ts +19 -0
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.js +35 -0
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +3 -1
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +22 -0
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +47 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +54 -8
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -2
- package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.js +18 -177
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- package/queries/catalog/dice-query/dice-query-executor.d.ts +8 -0
- package/queries/catalog/dice-query/dice-query-executor.js +52 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +53 -0
- package/queries/catalog/dice-query/dice-query-format.js +102 -0
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -0
- package/queries/catalog/linter-query/linter-query-executor.js +7 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +1 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/queries/query.d.ts +18 -1
- package/queries/query.js +3 -1
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +55 -44
- package/r-bridge/parser.js +2 -9
- package/r-bridge/shell.d.ts +8 -1
- package/r-bridge/shell.js +26 -7
- package/search/flowr-search-builder.d.ts +2 -2
- package/search/flowr-search-builder.js +1 -1
- package/search/flowr-search-filters.d.ts +30 -9
- package/search/flowr-search-filters.js +26 -21
- package/search/search-executor/search-enrichers.d.ts +600 -0
- package/search/search-executor/search-enrichers.js +23 -2
- package/slicing/static/static-slicer.d.ts +39 -11
- package/slicing/static/static-slicer.js +44 -14
- package/util/collections/queue.d.ts +16 -0
- package/util/collections/queue.js +38 -0
- package/util/log.d.ts +1 -1
- package/util/log.js +1 -1
- package/util/mermaid/dfg.d.ts +2 -2
- package/util/mermaid/dfg.js +2 -2
- package/util/objects.d.ts +9 -0
- package/util/objects.js +54 -0
- package/util/proc.d.ts +6 -0
- package/util/proc.js +20 -0
- package/util/version.js +1 -1
package/README.md
CHANGED
|
@@ -13,18 +13,18 @@ and [Docker](https://hub.docker.com/r/eagleoutice/flowr).
|
|
|
13
13
|
It offers a wide variety of features, for example:
|
|
14
14
|
|
|
15
15
|
* 🐞 **code linting**\
|
|
16
|
-
Analyze your R scripts for common issues and potential bugs (see the [wiki page](https://github.com/flowr-analysis/flowr/wiki/
|
|
16
|
+
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
17
|
|
|
18
18
|
|
|
19
19
|
<details><summary>Example: Linting code with flowR</summary>
|
|
20
20
|
|
|
21
|
-
To lint your code, you can use the [REPL](https://github.com/flowr-analysis/flowr/wiki/
|
|
21
|
+
To lint your code, you can use the [REPL](https://github.com/flowr-analysis/flowr/wiki/interface#using-the-repl) or the [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr) (see [vscode-flowr#283](https://github.com/flowr-analysis/vscode-flowr/pull/283)).
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
27
|
-
flowR repl using flowR v2.10.
|
|
27
|
+
flowR repl using flowR v2.10.9, R grammar v14 (tree-sitter 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 (
|
|
36
|
+
Query: linter (1 ms)
|
|
37
37
|
╰ Deprecated Functions (deprecated-functions):
|
|
38
38
|
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
|
|
39
39
|
╰ File Path Validity (file-path-validity):
|
|
@@ -53,9 +53,9 @@ It offers a wide variety of features, for example:
|
|
|
53
53
|
╰ Network Functions (network-functions):
|
|
54
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:
|
|
56
|
+
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0
|
|
57
57
|
╰ Dead Code (dead-code):
|
|
58
|
-
╰ Metadata:
|
|
58
|
+
╰ Metadata: searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
60
60
|
╰ Metadata: numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0
|
|
61
61
|
╰ Problematic inputs (problematic-inputs):
|
|
@@ -64,7 +64,17 @@ It offers a wide variety of features, for example:
|
|
|
64
64
|
╰ Metadata: consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0
|
|
65
65
|
╰ Roxygen Arguments (roxygen-arguments):
|
|
66
66
|
╰ Metadata: searchTimeMs: 0, processTimeMs: 0
|
|
67
|
-
|
|
67
|
+
╰ Software Has License (software-has-license):
|
|
68
|
+
╰ certain:
|
|
69
|
+
╰ No license found in the project
|
|
70
|
+
╰ Metadata: searchTimeMs: 0, processTimeMs: 0
|
|
71
|
+
╰ Software Has Tests (software-has-tests):
|
|
72
|
+
╰ certain:
|
|
73
|
+
╰ No tests found in the project
|
|
74
|
+
╰ Metadata: testFilesFound: 0, testCallsFound: 0, searchTimeMs: 0, processTimeMs: 0
|
|
75
|
+
╰ No Leaked Credentials (no-leaked-credentials):
|
|
76
|
+
╰ Metadata: totalChecked: 0, searchTimeMs: 0, processTimeMs: 0
|
|
77
|
+
All queries together required ≈1 ms (1ms accuracy, total 1 ms)
|
|
68
78
|
```
|
|
69
79
|
|
|
70
80
|
|
|
@@ -80,15 +90,15 @@ It offers a wide variety of features, for example:
|
|
|
80
90
|
```
|
|
81
91
|
|
|
82
92
|
|
|
83
|
-
(This can be shortened to `@linter` when used with the REPL command <span title="Description (Repl Command): Query the given R code
|
|
93
|
+
(This can be shortened to `@linter` when used with the REPL command <span title="Description (Repl Command): Query the given R code (use 'help' for more information)">`:query`</span>).
|
|
84
94
|
|
|
85
95
|
|
|
86
96
|
|
|
87
97
|
_Results (prettified and summarized):_
|
|
88
98
|
|
|
89
|
-
Query: **linter** (
|
|
99
|
+
Query: **linter** (1 ms)\
|
|
90
100
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
91
|
-
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs:
|
|
101
|
+
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
92
102
|
╰ **File Path Validity** (file-path-validity):\
|
|
93
103
|
╰ certain:\
|
|
94
104
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
@@ -98,7 +108,7 @@ It offers a wide variety of features, for example:
|
|
|
98
108
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
99
109
|
╰ certain:\
|
|
100
110
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
101
|
-
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
111
|
+
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
102
112
|
╰ **Unused Definitions** (unused-definitions):\
|
|
103
113
|
╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
104
114
|
╰ **Naming Convention** (naming-convention):\
|
|
@@ -108,7 +118,7 @@ It offers a wide variety of features, for example:
|
|
|
108
118
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
109
119
|
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
110
120
|
╰ **Dead Code** (dead-code):\
|
|
111
|
-
╰ _Metadata_: <code>
|
|
121
|
+
╰ _Metadata_: <code>searchTimeMs: 0, processTimeMs: 0</code>\
|
|
112
122
|
╰ **Useless Loops** (useless-loop):\
|
|
113
123
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
114
124
|
╰ **Problematic inputs** (problematic-inputs):\
|
|
@@ -117,11 +127,21 @@ It offers a wide variety of features, for example:
|
|
|
117
127
|
╰ _Metadata_: <code>consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
118
128
|
╰ **Roxygen Arguments** (roxygen-arguments):\
|
|
119
129
|
╰ _Metadata_: <code>searchTimeMs: 0, processTimeMs: 0</code>\
|
|
120
|
-
|
|
130
|
+
╰ **Software Has License** (software-has-license):\
|
|
131
|
+
╰ certain:\
|
|
132
|
+
╰ No license found in the project\
|
|
133
|
+
╰ _Metadata_: <code>searchTimeMs: 0, processTimeMs: 0</code>\
|
|
134
|
+
╰ **Software Has Tests** (software-has-tests):\
|
|
135
|
+
╰ certain:\
|
|
136
|
+
╰ No tests found in the project\
|
|
137
|
+
╰ _Metadata_: <code>testFilesFound: 0, testCallsFound: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
138
|
+
╰ **No Leaked Credentials** (no-leaked-credentials):\
|
|
139
|
+
╰ _Metadata_: <code>totalChecked: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
140
|
+
_All queries together required ≈1 ms (1ms accuracy, total 2 ms)_
|
|
121
141
|
|
|
122
142
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
123
143
|
|
|
124
|
-
The analysis required
|
|
144
|
+
The analysis required _1.8 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
125
145
|
|
|
126
146
|
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.
|
|
127
147
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -138,7 +158,7 @@ It offers a wide variety of features, for example:
|
|
|
138
158
|
".meta": {
|
|
139
159
|
"totalCalls": 0,
|
|
140
160
|
"totalFunctionDefinitions": 0,
|
|
141
|
-
"searchTimeMs":
|
|
161
|
+
"searchTimeMs": 0,
|
|
142
162
|
"processTimeMs": 0
|
|
143
163
|
}
|
|
144
164
|
},
|
|
@@ -193,7 +213,7 @@ It offers a wide variety of features, for example:
|
|
|
193
213
|
".meta": {
|
|
194
214
|
"totalConsidered": 1,
|
|
195
215
|
"totalUnknown": 0,
|
|
196
|
-
"searchTimeMs":
|
|
216
|
+
"searchTimeMs": 1,
|
|
197
217
|
"processTimeMs": 0
|
|
198
218
|
}
|
|
199
219
|
},
|
|
@@ -236,8 +256,7 @@ It offers a wide variety of features, for example:
|
|
|
236
256
|
"dead-code": {
|
|
237
257
|
"results": [],
|
|
238
258
|
".meta": {
|
|
239
|
-
"
|
|
240
|
-
"searchTimeMs": 1,
|
|
259
|
+
"searchTimeMs": 0,
|
|
241
260
|
"processTimeMs": 0
|
|
242
261
|
}
|
|
243
262
|
},
|
|
@@ -270,14 +289,60 @@ It offers a wide variety of features, for example:
|
|
|
270
289
|
"searchTimeMs": 0,
|
|
271
290
|
"processTimeMs": 0
|
|
272
291
|
}
|
|
292
|
+
},
|
|
293
|
+
"software-has-license": {
|
|
294
|
+
"results": [
|
|
295
|
+
{
|
|
296
|
+
"certainty": "certain",
|
|
297
|
+
"loc": [
|
|
298
|
+
-1,
|
|
299
|
+
-1,
|
|
300
|
+
-1,
|
|
301
|
+
-1
|
|
302
|
+
],
|
|
303
|
+
"message": "No license found in the project"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
".meta": {
|
|
307
|
+
"searchTimeMs": 0,
|
|
308
|
+
"processTimeMs": 0
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"software-has-tests": {
|
|
312
|
+
"results": [
|
|
313
|
+
{
|
|
314
|
+
"certainty": "certain",
|
|
315
|
+
"loc": [
|
|
316
|
+
-1,
|
|
317
|
+
-1,
|
|
318
|
+
-1,
|
|
319
|
+
-1
|
|
320
|
+
],
|
|
321
|
+
"message": "No tests found in the project"
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
".meta": {
|
|
325
|
+
"testFilesFound": 0,
|
|
326
|
+
"testCallsFound": 0,
|
|
327
|
+
"searchTimeMs": 0,
|
|
328
|
+
"processTimeMs": 0
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"no-leaked-credentials": {
|
|
332
|
+
"results": [],
|
|
333
|
+
".meta": {
|
|
334
|
+
"totalChecked": 0,
|
|
335
|
+
"searchTimeMs": 0,
|
|
336
|
+
"processTimeMs": 0
|
|
337
|
+
}
|
|
273
338
|
}
|
|
274
339
|
},
|
|
275
340
|
".meta": {
|
|
276
|
-
"timing":
|
|
341
|
+
"timing": 1
|
|
277
342
|
}
|
|
278
343
|
},
|
|
279
344
|
".meta": {
|
|
280
|
-
"timing":
|
|
345
|
+
"timing": 1
|
|
281
346
|
}
|
|
282
347
|
}
|
|
283
348
|
```
|
|
@@ -311,8 +376,8 @@ It offers a wide variety of features, for example:
|
|
|
311
376
|
<details><summary>Example: Slicing with flowR</summary>
|
|
312
377
|
|
|
313
378
|
|
|
314
|
-
The simplest way to retrieve slices is with flowR's [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr).
|
|
315
|
-
However, you can slice using the [REPL](https://github.com/flowr-analysis/flowr/wiki/
|
|
379
|
+
The simplest way to retrieve slices is with flowR's [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr).
|
|
380
|
+
However, you can slice using the [REPL](https://github.com/flowr-analysis/flowr/wiki/interface#using-the-repl) as well.
|
|
316
381
|
This can help you if you want to reuse specific parts of an existing analysis within another context or if you want to understand
|
|
317
382
|
what is happening in the code.
|
|
318
383
|
|
|
@@ -342,7 +407,7 @@ It offers a wide variety of features, for example:
|
|
|
342
407
|
|
|
343
408
|
```shell
|
|
344
409
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
345
|
-
flowR repl using flowR v2.10.
|
|
410
|
+
flowR repl using flowR v2.10.9, R grammar v14 (tree-sitter engine)
|
|
346
411
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
347
412
|
```
|
|
348
413
|
|
|
@@ -356,7 +421,7 @@ It offers a wide variety of features, for example:
|
|
|
356
421
|
N <- 10
|
|
357
422
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
358
423
|
sum
|
|
359
|
-
All queries together required ≈1 ms (1ms accuracy, total
|
|
424
|
+
All queries together required ≈1 ms (1ms accuracy, total 1 ms)
|
|
360
425
|
```
|
|
361
426
|
|
|
362
427
|
|
|
@@ -373,7 +438,7 @@ It offers a wide variety of features, for example:
|
|
|
373
438
|
|
|
374
439
|
* 📚 **dependency analysis**\
|
|
375
440
|
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.
|
|
376
|
-
An important query is the [dependencies query](https://github.com/flowr-analysis/flowr/wiki/
|
|
441
|
+
An important query is the [dependencies query](https://github.com/flowr-analysis/flowr/wiki/query-api#dependencies-query), which shows you the library your project needs,
|
|
377
442
|
the data files it reads, the scripts it sources, and the data it outputs.
|
|
378
443
|
|
|
379
444
|
|
|
@@ -390,7 +455,7 @@ It offers a wide variety of features, for example:
|
|
|
390
455
|
|
|
391
456
|
|
|
392
457
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
393
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
458
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">101.7 ms</span></i> (as of Jun 15, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
394
459
|
_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,
|
|
395
460
|
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).
|
|
396
461
|
|
|
@@ -398,8 +463,8 @@ It offers a wide variety of features, for example:
|
|
|
398
463
|
<details><summary>Example: Generating a dataflow graph with flowR</summary>
|
|
399
464
|
|
|
400
465
|
|
|
401
|
-
You can investigate flowR's analyses using the [REPL](https://github.com/flowr-analysis/flowr/wiki/
|
|
402
|
-
Commands like <span title="Description (Repl Command, starred version): Returns the URL to mermaid.live; Base Command: Get mermaid code for the dataflow graph
|
|
466
|
+
You can investigate flowR's analyses using the [REPL](https://github.com/flowr-analysis/flowr/wiki/interface#using-the-repl).
|
|
467
|
+
Commands like <span title="Description (Repl Command, starred version): Returns the URL to mermaid.live; Base Command: Get mermaid code for the dataflow graph (aliases: :d*, :df*)">`:dataflow*`</span> allow you to view a [dataflow graph](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) for a given R script.
|
|
403
468
|
|
|
404
469
|
Let's have a look at the following example:
|
|
405
470
|
|
|
@@ -426,7 +491,7 @@ It offers a wide variety of features, for example:
|
|
|
426
491
|
|
|
427
492
|
```shell
|
|
428
493
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
429
|
-
flowR repl using flowR v2.10.
|
|
494
|
+
flowR repl using flowR v2.10.9, R grammar v14 (tree-sitter engine)
|
|
430
495
|
R> :dataflow* test/testfiles/example.R
|
|
431
496
|
```
|
|
432
497
|
|
|
@@ -588,6 +653,9 @@ It offers a wide variety of features, for example:
|
|
|
588
653
|
40(["`#91;RSymbol#93; sum
|
|
589
654
|
(40)
|
|
590
655
|
*11.13-15*`"])
|
|
656
|
+
built-in:sum["`Built-In:
|
|
657
|
+
sum`"]
|
|
658
|
+
style built-in:sum stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
|
|
591
659
|
42{{"`#91;RString#93; #34;
|
|
592
660
|
#34;
|
|
593
661
|
(42)
|
|
@@ -719,22 +787,24 @@ It offers a wide variety of features, for example:
|
|
|
719
787
|
linkStyle 74 stroke:gray;
|
|
720
788
|
40 -->|"reads"| 0
|
|
721
789
|
40 -->|"reads"| 23
|
|
790
|
+
40 -.->|"reads"| built-in:sum
|
|
791
|
+
linkStyle 77 stroke:gray;
|
|
722
792
|
44 -->|"argument"| 38
|
|
723
793
|
44 -->|"reads, argument"| 40
|
|
724
794
|
44 -->|"argument"| 42
|
|
725
795
|
44 -.->|"reads, calls"| built-in:cat
|
|
726
|
-
linkStyle
|
|
796
|
+
linkStyle 81 stroke:gray;
|
|
727
797
|
48 -->|"reads"| 3
|
|
728
798
|
48 -->|"reads"| 30
|
|
729
799
|
52 -->|"argument"| 46
|
|
730
800
|
52 -->|"reads, argument"| 48
|
|
731
801
|
52 -->|"argument"| 50
|
|
732
802
|
52 -.->|"reads, calls"| built-in:cat
|
|
733
|
-
linkStyle
|
|
803
|
+
linkStyle 87 stroke:gray;
|
|
734
804
|
```
|
|
735
805
|
|
|
736
806
|
|
|
737
|
-
(The analysis required
|
|
807
|
+
(The analysis required _1.0 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
738
808
|
|
|
739
809
|
|
|
740
810
|
|
|
@@ -752,7 +822,7 @@ If you want to use flowR and the features it provides, feel free to check out th
|
|
|
752
822
|
- [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr)/[Positron](https://open-vsx.org/extension/code-inspect/vscode-flowr): provides access to flowR directly in VS Code and Positron (or [vscode.dev](https://vscode.dev/))
|
|
753
823
|
- [RStudio Addin](https://github.com/flowr-analysis/rstudio-addin-flowr): integrates flowR into [RStudio](https://posit.co/downloads/)
|
|
754
824
|
- [R package](https://github.com/flowr-analysis/flowr-r-adapter): use flowR in your R scripts
|
|
755
|
-
- [Docker image](https://hub.docker.com/r/eagleoutice/flowr): run flowR in a container, this also includes [flowR's server](https://github.com/flowr-analysis/flowr/wiki/
|
|
825
|
+
- [Docker image](https://hub.docker.com/r/eagleoutice/flowr): run flowR in a container, this also includes [flowR's server](https://github.com/flowr-analysis/flowr/wiki/interface#communicating-with-the-server)
|
|
756
826
|
- [NPM package](https://www.npmjs.com/package/@eagleoutice/flowr): include flowR in your TypeScript and JavaScript projects
|
|
757
827
|
|
|
758
828
|
|
|
@@ -229,7 +229,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
onVariableDefinition({ vertex }) {
|
|
232
|
-
if (this.
|
|
232
|
+
if (!this.trace.has(vertex.id)) {
|
|
233
233
|
this.unassigned.add(vertex.id);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -241,8 +241,11 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
241
241
|
this.unassigned.delete(target);
|
|
242
242
|
if (value !== undefined) {
|
|
243
243
|
this.currentState.set(target, value);
|
|
244
|
-
this.trace.set(target, this.currentState);
|
|
245
244
|
}
|
|
245
|
+
else {
|
|
246
|
+
this.currentState.remove(target);
|
|
247
|
+
}
|
|
248
|
+
this.trace.set(target, this.currentState);
|
|
246
249
|
}
|
|
247
250
|
onReplacementCall({ target }) {
|
|
248
251
|
if (target !== undefined) {
|
|
@@ -285,7 +288,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
285
288
|
}
|
|
286
289
|
/** Checks whether a node represents a unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...) */
|
|
287
290
|
isUnsupportedFunctionCall(nodeId) {
|
|
288
|
-
return unsupported_functions_1.UnsupportedFunctions.isUnsupportedCall(this.getDataflowGraph(nodeId));
|
|
291
|
+
return unsupported_functions_1.UnsupportedFunctions.isUnsupportedCall(this.getDataflowGraph(nodeId), this.config.dfg);
|
|
289
292
|
}
|
|
290
293
|
/** We only perform widening at `for`, `while`, or `repeat` loops with more than one ingoing CFG edge */
|
|
291
294
|
isWideningPoint(nodeId) {
|
|
@@ -48,7 +48,7 @@ export declare abstract class AbstractDomain<Concrete, Abstract, Top, Bot, Value
|
|
|
48
48
|
* Maps a set of possible concrete values into an abstract value as abstraction function of the abstract domain (should additionally be provided as static function).
|
|
49
49
|
*/
|
|
50
50
|
abstract abstract(concrete: ReadonlySet<Concrete> | typeof Top): this;
|
|
51
|
-
abstract
|
|
51
|
+
abstract toJSON(): unknown;
|
|
52
52
|
abstract toString(): string;
|
|
53
53
|
abstract isTop(): this is AbstractDomain<Concrete, Abstract, Top, Bot, Top>;
|
|
54
54
|
abstract isBottom(): this is AbstractDomain<Concrete, Abstract, Top, Bot, Bot>;
|
|
@@ -47,7 +47,7 @@ export declare class BoundedSetDomain<T, Value extends BoundedSetLift<T> = Bound
|
|
|
47
47
|
concretize(limit: number): ReadonlySet<T> | typeof Top;
|
|
48
48
|
abstract(concrete: ReadonlySet<T> | typeof Top): this;
|
|
49
49
|
satisfies(value: T): Ternary;
|
|
50
|
-
|
|
50
|
+
toJSON(): unknown;
|
|
51
51
|
toString(): string;
|
|
52
52
|
isTop(): this is BoundedSetDomain<T, BoundedSetTop>;
|
|
53
53
|
isBottom(): this is BoundedSetDomain<T, BoundedSetBottom>;
|
|
@@ -60,7 +60,7 @@ export declare class IntervalDomain<Value extends IntervalLift = IntervalLift> e
|
|
|
60
60
|
* Extends the upper bound of the current abstract value up to +∞.
|
|
61
61
|
*/
|
|
62
62
|
widenUp(): this;
|
|
63
|
-
|
|
63
|
+
toJSON(): unknown;
|
|
64
64
|
toString(): string;
|
|
65
65
|
isTop(): this is IntervalDomain<IntervalTop>;
|
|
66
66
|
isBottom(): this is IntervalDomain<IntervalBottom>;
|
|
@@ -51,7 +51,7 @@ export interface Lattice<Value, Top, Bot, Lift extends Value | Top | Bot = Value
|
|
|
51
51
|
/**
|
|
52
52
|
* Converts the lattice into a JSON serializable value.
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
toJSON(): unknown;
|
|
55
55
|
/**
|
|
56
56
|
* Converts the lattice into a human-readable string.
|
|
57
57
|
*/
|
|
@@ -31,7 +31,7 @@ export declare abstract class PartialProductDomain<Product extends AbstractProdu
|
|
|
31
31
|
narrow(other: this): this;
|
|
32
32
|
concretize(limit: number): ReadonlySet<ConcreteProductOf<Product>> | typeof Top;
|
|
33
33
|
abstract(concrete: ReadonlySet<ConcreteProductOf<Product>> | typeof Top): this;
|
|
34
|
-
|
|
34
|
+
toJSON(): unknown;
|
|
35
35
|
toString(): string;
|
|
36
36
|
isTop(): boolean;
|
|
37
37
|
isTop(): this is this;
|
|
@@ -140,8 +140,8 @@ class PartialProductDomain extends abstract_domain_1.AbstractDomain {
|
|
|
140
140
|
}
|
|
141
141
|
return this.create(result);
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
return record_1.Record.mapProperties(this.value, entry => entry?.
|
|
143
|
+
toJSON() {
|
|
144
|
+
return record_1.Record.mapProperties(this.value, entry => entry?.toJSON());
|
|
145
145
|
}
|
|
146
146
|
toString() {
|
|
147
147
|
return '(' + record_1.Record.entries(this.value).map(([key, value]) => `${key}: ${value.toString()}`).join(', ') + ')';
|
|
@@ -94,7 +94,7 @@ export declare class SetRangeDomain<T, Value extends SetRangeLift<T> = SetRangeL
|
|
|
94
94
|
* Extends the maximum set of the current abstract value up to {@link Top}.
|
|
95
95
|
*/
|
|
96
96
|
widenUp(): this;
|
|
97
|
-
|
|
97
|
+
toJSON(): unknown;
|
|
98
98
|
toString(): string;
|
|
99
99
|
isTop(): this is SetRangeDomain<T, SetRangeTop>;
|
|
100
100
|
isBottom(): this is SetRangeDomain<T, SetRangeBottom>;
|
|
@@ -45,7 +45,7 @@ export declare class SetUpperBoundDomain<T, Value extends SetUpperBoundLift<T> =
|
|
|
45
45
|
concretize(limit: number): ReadonlySet<ReadonlySet<T>> | typeof Top;
|
|
46
46
|
abstract(concrete: ReadonlySet<ReadonlySet<T>> | typeof Top): this;
|
|
47
47
|
satisfies(set: ReadonlySet<T> | T[], comparator?: SetComparator): Ternary;
|
|
48
|
-
|
|
48
|
+
toJSON(): unknown;
|
|
49
49
|
toString(): string;
|
|
50
50
|
isTop(): this is SetUpperBoundDomain<T, SetUpperBoundTop>;
|
|
51
51
|
isBottom(): this is SetUpperBoundDomain<T, SetUpperBoundBottom>;
|
|
@@ -34,7 +34,7 @@ export declare class SingletonDomain<T, Value extends SingletonLift<T> = Singlet
|
|
|
34
34
|
concretize(): ReadonlySet<T> | typeof Top;
|
|
35
35
|
abstract(concrete: ReadonlySet<T> | typeof Top): this;
|
|
36
36
|
satisfies(value: T): Ternary;
|
|
37
|
-
|
|
37
|
+
toJSON(): unknown;
|
|
38
38
|
toString(): string;
|
|
39
39
|
isTop(): this is SingletonDomain<T, SingletonTop>;
|
|
40
40
|
isBottom(): this is SingletonDomain<T, SingletonBottom>;
|
|
@@ -38,7 +38,7 @@ export declare class StateAbstractDomain<Domain extends AnyAbstractDomain, Value
|
|
|
38
38
|
narrow(other: this): this;
|
|
39
39
|
concretize(limit: number): ReadonlySet<ConcreteState<Domain>> | typeof Top;
|
|
40
40
|
abstract(concrete: ReadonlySet<ConcreteState<Domain>> | typeof Top): this;
|
|
41
|
-
|
|
41
|
+
toJSON(): unknown;
|
|
42
42
|
toString(): string;
|
|
43
43
|
isTop(): this is this & StateAbstractDomain<Domain, StateDomainTop>;
|
|
44
44
|
isBottom(): this is this & StateAbstractDomain<Domain, StateDomainBottom>;
|
|
@@ -205,11 +205,11 @@ class StateAbstractDomain extends abstract_domain_1.AbstractDomain {
|
|
|
205
205
|
}
|
|
206
206
|
return this.create(result);
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
toJSON() {
|
|
209
209
|
if (this.value === lattice_1.Bottom) {
|
|
210
210
|
return this.value.description;
|
|
211
211
|
}
|
|
212
|
-
return Object.fromEntries(this.value.entries().map(([key, value]) => [key, value.
|
|
212
|
+
return Object.fromEntries(this.value.entries().map(([key, value]) => [key, value.toJSON()]));
|
|
213
213
|
}
|
|
214
214
|
toString() {
|
|
215
215
|
if (this.value === lattice_1.Bottom) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
1
2
|
import { type DataflowGraphVertexArgument } from '../dataflow/graph/vertex';
|
|
2
3
|
/**
|
|
3
4
|
* Helper for unsupported functions that may change the environment.
|
|
4
5
|
*/
|
|
5
6
|
export declare const UnsupportedFunctions: {
|
|
6
7
|
/**
|
|
7
|
-
* Checks whether a data flow graph vertex represents
|
|
8
|
+
* Checks whether a data flow graph vertex represents an unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...)
|
|
8
9
|
*/
|
|
9
|
-
isUnsupportedCall(this: void, vertex: DataflowGraphVertexArgument | undefined): boolean;
|
|
10
|
+
isUnsupportedCall(this: void, vertex: DataflowGraphVertexArgument | undefined, dfg: DataflowGraph): boolean;
|
|
10
11
|
};
|
|
@@ -3,43 +3,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UnsupportedFunctions = void 0;
|
|
4
4
|
const identifier_1 = require("../dataflow/environments/identifier");
|
|
5
5
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
6
|
+
const record_1 = require("../util/record");
|
|
7
|
+
function unsupportedFunctions(functions) {
|
|
8
|
+
return record_1.Record.entries(functions).map(([identifier, info]) => ({ identifier: identifier_1.Identifier.parse(identifier), ...info }));
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* List of known function calls that may change the environment unresolvable/implicitly.
|
|
8
12
|
*/
|
|
9
|
-
const UnsupportedFunctionsList = {
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'eval': {
|
|
18
|
-
'evalq': {
|
|
19
|
-
'eval.parent': {
|
|
20
|
-
'eval_tidy': {
|
|
21
|
-
'eval_bare': {
|
|
22
|
-
'body<-': {
|
|
23
|
-
'formals<-': {
|
|
24
|
-
'environment<-': {
|
|
25
|
-
'load': {
|
|
26
|
-
'attach': {
|
|
27
|
-
'detach': {
|
|
28
|
-
'rm': {
|
|
29
|
-
'remove': {
|
|
30
|
-
'list2env': {
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
}
|
|
13
|
+
const UnsupportedFunctionsList = unsupportedFunctions({
|
|
14
|
+
'base::.Primitive': {},
|
|
15
|
+
'base::.Internal': {},
|
|
16
|
+
'base::.External': {},
|
|
17
|
+
'base::.Call': {},
|
|
18
|
+
'base::.C': {},
|
|
19
|
+
'base::.Fortran': {},
|
|
20
|
+
'base::.dyn.load': {},
|
|
21
|
+
'base::eval': {},
|
|
22
|
+
'base::evalq': {},
|
|
23
|
+
'base::eval.parent': {},
|
|
24
|
+
'rlang::eval_tidy': {},
|
|
25
|
+
'rlang::eval_bare': {},
|
|
26
|
+
'base::body<-': {},
|
|
27
|
+
'base::formals<-': {},
|
|
28
|
+
'base::environment<-': {},
|
|
29
|
+
'base::load': {},
|
|
30
|
+
'base::attach': {},
|
|
31
|
+
'base::detach': {},
|
|
32
|
+
'base::rm': {},
|
|
33
|
+
'base::remove': {},
|
|
34
|
+
'base::list2env': {},
|
|
35
|
+
'base::assign': { condition: (vertex, dfg) => dfg.unknownSideEffects.has(vertex.id) },
|
|
36
|
+
'base::delayedAssign': { condition: (vertex, dfg) => dfg.unknownSideEffects.has(vertex.id) },
|
|
37
|
+
'utils::assignInNamespace': {},
|
|
38
|
+
'utils::assignInMyNamespace': {},
|
|
39
|
+
});
|
|
34
40
|
/**
|
|
35
41
|
* Helper for unsupported functions that may change the environment.
|
|
36
42
|
*/
|
|
37
43
|
exports.UnsupportedFunctions = {
|
|
38
44
|
/**
|
|
39
|
-
* Checks whether a data flow graph vertex represents
|
|
45
|
+
* Checks whether a data flow graph vertex represents an unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...)
|
|
40
46
|
*/
|
|
41
|
-
isUnsupportedCall(vertex) {
|
|
42
|
-
|
|
47
|
+
isUnsupportedCall(vertex, dfg) {
|
|
48
|
+
if (!(0, vertex_1.isFunctionCallVertex)(vertex)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const entry = UnsupportedFunctionsList.find(entry => identifier_1.Identifier.matches(vertex.name, entry.identifier));
|
|
52
|
+
return entry !== undefined && (entry.condition?.(vertex, dfg) ?? true);
|
|
43
53
|
}
|
|
44
54
|
};
|
|
45
55
|
//# sourceMappingURL=unsupported-functions.js.map
|