@eagleoutice/flowr 2.5.0 → 2.6.1
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 -35
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/data-frame/absint-visitor.js +1 -1
- package/cli/flowr.js +11 -33
- package/cli/repl/commands/repl-cfg.d.ts +5 -5
- package/cli/repl/commands/repl-cfg.js +21 -22
- package/cli/repl/commands/repl-commands.d.ts +3 -3
- package/cli/repl/commands/repl-commands.js +2 -0
- package/cli/repl/commands/repl-dataflow.d.ts +5 -5
- package/cli/repl/commands/repl-dataflow.js +27 -30
- package/cli/repl/commands/repl-execute.d.ts +1 -1
- package/cli/repl/commands/repl-execute.js +8 -7
- package/cli/repl/commands/repl-lineage.d.ts +2 -2
- package/cli/repl/commands/repl-lineage.js +11 -11
- package/cli/repl/commands/repl-main.d.ts +35 -7
- package/cli/repl/commands/repl-normalize.d.ts +3 -3
- package/cli/repl/commands/repl-normalize.js +15 -19
- package/cli/repl/commands/repl-parse.d.ts +2 -2
- package/cli/repl/commands/repl-parse.js +14 -8
- package/cli/repl/commands/repl-query.d.ts +3 -3
- package/cli/repl/commands/repl-query.js +29 -19
- package/cli/repl/commands/repl-quit.js +1 -0
- package/cli/repl/commands/repl-version.d.ts +1 -16
- package/cli/repl/commands/repl-version.js +2 -18
- package/cli/repl/core.d.ts +12 -9
- package/cli/repl/core.js +26 -12
- package/cli/repl/print-version.js +2 -2
- package/cli/repl/server/connection.d.ts +7 -3
- package/cli/repl/server/connection.js +46 -50
- package/cli/repl/server/messages/message-hello.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/server.js +2 -2
- package/cli/slicer-app.js +1 -1
- package/config.d.ts +1 -1
- package/config.js +4 -1
- package/control-flow/extract-cfg.d.ts +1 -1
- package/control-flow/extract-cfg.js +1 -1
- package/core/pipeline-executor.d.ts +5 -0
- package/core/pipeline-executor.js +5 -0
- package/core/steps/all/core/20-dataflow.d.ts +3 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +24 -8
- package/core/steps/pipeline/default-pipelines.js +4 -1
- package/dataflow/environments/default-builtin-config.js +8 -0
- package/dataflow/eval/resolve/alias-tracking.js +2 -0
- package/dataflow/eval/resolve/resolve.js +3 -0
- package/dataflow/eval/values/r-value.d.ts +4 -1
- package/dataflow/eval/values/r-value.js +2 -0
- package/dataflow/extractor.d.ts +4 -1
- package/dataflow/extractor.js +7 -5
- package/dataflow/fn/higher-order-function.d.ts +9 -0
- package/dataflow/fn/higher-order-function.js +75 -0
- package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
- package/dataflow/graph/dataflowgraph-builder.js +6 -6
- package/documentation/doc-util/doc-query.d.ts +3 -6
- package/documentation/doc-util/doc-query.js +5 -17
- package/documentation/doc-util/doc-repl.js +5 -2
- package/documentation/doc-util/doc-search.js +7 -10
- package/documentation/doc-util/doc-structure.d.ts +4 -0
- package/documentation/doc-util/doc-structure.js +28 -0
- package/documentation/doc-util/doc-types.d.ts +5 -1
- package/documentation/doc-util/doc-types.js +29 -3
- package/documentation/print-analyzer-wiki.d.ts +1 -0
- package/documentation/print-analyzer-wiki.js +137 -0
- package/documentation/print-core-wiki.d.ts +2 -1
- package/documentation/print-core-wiki.js +58 -4
- package/documentation/print-dataflow-graph-wiki.js +16 -23
- package/documentation/print-interface-wiki.js +18 -1
- package/documentation/print-linter-wiki.js +5 -1
- package/documentation/print-normalized-ast-wiki.js +6 -8
- package/documentation/print-query-wiki.js +20 -0
- package/documentation/print-readme.js +1 -1
- package/engines.d.ts +9 -0
- package/engines.js +38 -0
- package/linter/linter-executor.d.ts +2 -8
- package/linter/linter-executor.js +9 -4
- package/linter/linter-format.d.ts +8 -9
- package/linter/linter-rules.d.ts +57 -15
- package/linter/linter-rules.js +2 -0
- package/linter/rules/absolute-path.d.ts +1 -0
- package/linter/rules/dataframe-access-validation.d.ts +4 -3
- package/linter/rules/dataframe-access-validation.js +7 -4
- package/linter/rules/dead-code.d.ts +2 -1
- package/linter/rules/deprecated-functions.d.ts +15 -28
- package/linter/rules/deprecated-functions.js +5 -43
- package/linter/rules/file-path-validity.d.ts +2 -1
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/function-finder-util.d.ts +51 -0
- package/linter/rules/function-finder-util.js +77 -0
- package/linter/rules/naming-convention.d.ts +2 -1
- package/linter/rules/network-functions.d.ts +40 -0
- package/linter/rules/network-functions.js +24 -0
- package/linter/rules/seeded-randomness.d.ts +2 -1
- package/linter/rules/unused-definition.d.ts +2 -1
- package/linter/rules/useless-loop.d.ts +3 -2
- package/linter/rules/useless-loop.js +4 -6
- package/package.json +2 -1
- package/project/cache/flowr-analyzer-cache.d.ts +94 -0
- package/project/cache/flowr-analyzer-cache.js +164 -0
- package/project/cache/flowr-cache.d.ts +28 -0
- package/project/cache/flowr-cache.js +49 -0
- package/project/cfg-kind.d.ts +17 -0
- package/project/cfg-kind.js +22 -0
- package/project/context/abstract-flowr-analyzer-context.d.ts +39 -0
- package/project/context/abstract-flowr-analyzer-context.js +46 -0
- package/project/context/flowr-analyzer-context.d.ts +54 -0
- package/project/context/flowr-analyzer-context.js +58 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +39 -0
- package/project/context/flowr-analyzer-dependencies-context.js +43 -0
- package/project/context/flowr-analyzer-files-context.d.ts +87 -0
- package/project/context/flowr-analyzer-files-context.js +134 -0
- package/project/context/flowr-analyzer-loading-order-context.d.ts +77 -0
- package/project/context/flowr-analyzer-loading-order-context.js +96 -0
- package/project/context/flowr-file.d.ts +89 -0
- package/project/context/flowr-file.js +78 -0
- package/project/flowr-analyzer-builder.d.ts +106 -0
- package/project/flowr-analyzer-builder.js +197 -0
- package/project/flowr-analyzer.d.ts +126 -0
- package/project/flowr-analyzer.js +88 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
- package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
- package/project/plugins/file-plugins/flowr-description-file.js +38 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
- package/project/plugins/flowr-analyzer-plugin.js +82 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
- package/project/plugins/package-version-plugins/package.d.ts +15 -0
- package/project/plugins/package-version-plugins/package.js +56 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
- package/queries/base-query-format.d.ts +2 -8
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +21 -13
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.js +5 -5
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +3 -3
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
- package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
- package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +45 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +22 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +32 -0
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
- package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
- package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
- package/queries/catalog/origin-query/origin-query-format.js +1 -1
- package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
- package/queries/catalog/project-query/project-query-executor.js +2 -2
- package/queries/catalog/project-query/project-query-format.d.ts +1 -54
- package/queries/catalog/project-query/project-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
- package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.js +3 -3
- package/queries/catalog/search-query/search-query-format.d.ts +1 -54
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
- package/queries/query-print.d.ts +4 -4
- package/queries/query-print.js +12 -12
- package/queries/query.d.ts +37 -885
- package/queries/query.js +3 -1
- package/r-bridge/parser.d.ts +7 -0
- package/r-bridge/retriever.d.ts +6 -5
- package/r-bridge/retriever.js +9 -5
- package/search/flowr-search-executor.d.ts +3 -5
- package/search/flowr-search-executor.js +6 -4
- package/search/flowr-search-filters.d.ts +12 -6
- package/search/flowr-search-filters.js +1 -1
- package/search/flowr-search.d.ts +5 -16
- package/search/flowr-search.js +14 -5
- package/search/search-executor/search-enrichers.d.ts +37 -36
- package/search/search-executor/search-enrichers.js +5 -4
- package/search/search-executor/search-generators.d.ts +12 -12
- package/search/search-executor/search-generators.js +27 -19
- package/search/search-executor/search-mappers.d.ts +5 -5
- package/search/search-executor/search-transformer.d.ts +17 -17
- package/search/search-executor/search-transformer.js +14 -7
- package/util/collections/arrays.d.ts +1 -0
- package/util/collections/arrays.js +15 -0
- package/util/collections/objectmap.d.ts +17 -0
- package/util/collections/objectmap.js +28 -0
- package/util/containers.d.ts +0 -1
- package/util/containers.js +0 -1
- package/util/files.d.ts +17 -0
- package/util/files.js +65 -0
- package/util/formats/adapter.d.ts +4 -2
- package/util/formats/adapter.js +11 -4
- package/util/r-value.d.ts +1 -1
- package/util/r-value.js +2 -0
- package/util/version.d.ts +17 -0
- package/util/version.js +28 -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.
|
|
27
|
+
flowR repl using flowR v2.6.0, R v4.5.0 (r-shell engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -33,30 +33,32 @@ It offers a wide variety of features, for example:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
Query: [;1mlinter[0m (
|
|
36
|
+
Query: [;1mlinter[0m (6 ms)
|
|
37
37
|
╰ **Deprecated Functions** (deprecated-functions):
|
|
38
|
-
╰ _Metadata_: <code>{"
|
|
38
|
+
╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":3,"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
42
|
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":1,"processTimeMs":0}</code>
|
|
43
43
|
╰ **Seeded Randomness** (seeded-randomness):
|
|
44
|
-
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":
|
|
44
|
+
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":1,"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":0,"processTimeMs":0}</code>
|
|
49
49
|
╰ **Unused Definitions** (unused-definitions):
|
|
50
50
|
╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
51
51
|
╰ **Naming Convention** (naming-convention):
|
|
52
52
|
╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
53
|
+
╰ **Network Functions** (network-functions):
|
|
54
|
+
╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
53
55
|
╰ **Dataframe Access Validation** (dataframe-access-validation):
|
|
54
|
-
╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":
|
|
56
|
+
╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":1,"processTimeMs":0}</code>
|
|
55
57
|
╰ **Dead Code** (dead-code):
|
|
56
58
|
╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
57
59
|
╰ **Useless Loops** (useless-loop):
|
|
58
60
|
╰ _Metadata_: <code>{"numOfUselessLoops":0,"searchTimeMs":0,"processTimeMs":0}</code>
|
|
59
|
-
[;3mAll queries together required ≈
|
|
61
|
+
[;3mAll queries together required ≈6 ms (1ms accuracy, total 9 ms)[0m[0m
|
|
60
62
|
```
|
|
61
63
|
|
|
62
64
|
|
|
@@ -78,15 +80,15 @@ It offers a wide variety of features, for example:
|
|
|
78
80
|
|
|
79
81
|
_Results (prettified and summarized):_
|
|
80
82
|
|
|
81
|
-
Query: **linter** (
|
|
83
|
+
Query: **linter** (213 ms)\
|
|
82
84
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
83
|
-
╰ _Metadata_: <code>{"
|
|
85
|
+
╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":199,"processTimeMs":1}</code>\
|
|
84
86
|
╰ **File Path Validity** (file-path-validity):\
|
|
85
87
|
╰ certain:\
|
|
86
88
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
87
|
-
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":
|
|
89
|
+
╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":4,"processTimeMs":1}</code>\
|
|
88
90
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
89
|
-
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":
|
|
91
|
+
╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":0,"processTimeMs":1}</code>\
|
|
90
92
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
91
93
|
╰ certain:\
|
|
92
94
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
@@ -95,17 +97,19 @@ It offers a wide variety of features, for example:
|
|
|
95
97
|
╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":0}</code>\
|
|
96
98
|
╰ **Naming Convention** (naming-convention):\
|
|
97
99
|
╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":0}</code>\
|
|
100
|
+
╰ **Network Functions** (network-functions):\
|
|
101
|
+
╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":1,"processTimeMs":0}</code>\
|
|
98
102
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
99
|
-
╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":
|
|
103
|
+
╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":3}</code>\
|
|
100
104
|
╰ **Dead Code** (dead-code):\
|
|
101
|
-
╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":
|
|
105
|
+
╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":0,"processTimeMs":1}</code>\
|
|
102
106
|
╰ **Useless Loops** (useless-loop):\
|
|
103
107
|
╰ _Metadata_: <code>{"numOfUselessLoops":0,"searchTimeMs":0,"processTimeMs":0}</code>\
|
|
104
|
-
_All queries together required ≈
|
|
108
|
+
_All queries together required ≈213 ms (1ms accuracy, total 214 ms)_
|
|
105
109
|
|
|
106
110
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
107
111
|
|
|
108
|
-
The analysis required
|
|
112
|
+
The analysis required _214.2 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
109
113
|
|
|
110
114
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
111
115
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -120,10 +124,10 @@ It offers a wide variety of features, for example:
|
|
|
120
124
|
"deprecated-functions": {
|
|
121
125
|
"results": [],
|
|
122
126
|
".meta": {
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"searchTimeMs":
|
|
126
|
-
"processTimeMs":
|
|
127
|
+
"totalCalls": 0,
|
|
128
|
+
"totalFunctionDefinitions": 0,
|
|
129
|
+
"searchTimeMs": 199,
|
|
130
|
+
"processTimeMs": 1
|
|
127
131
|
}
|
|
128
132
|
},
|
|
129
133
|
"file-path-validity": {
|
|
@@ -144,8 +148,8 @@ It offers a wide variety of features, for example:
|
|
|
144
148
|
"totalUnknown": 0,
|
|
145
149
|
"totalWritesBeforeAlways": 0,
|
|
146
150
|
"totalValid": 0,
|
|
147
|
-
"searchTimeMs":
|
|
148
|
-
"processTimeMs":
|
|
151
|
+
"searchTimeMs": 4,
|
|
152
|
+
"processTimeMs": 1
|
|
149
153
|
}
|
|
150
154
|
},
|
|
151
155
|
"seeded-randomness": {
|
|
@@ -155,8 +159,8 @@ It offers a wide variety of features, for example:
|
|
|
155
159
|
"callsWithFunctionProducers": 0,
|
|
156
160
|
"callsWithAssignmentProducers": 0,
|
|
157
161
|
"callsWithNonConstantProducers": 0,
|
|
158
|
-
"searchTimeMs":
|
|
159
|
-
"processTimeMs":
|
|
162
|
+
"searchTimeMs": 0,
|
|
163
|
+
"processTimeMs": 1
|
|
160
164
|
}
|
|
161
165
|
},
|
|
162
166
|
"absolute-file-paths": {
|
|
@@ -196,6 +200,15 @@ It offers a wide variety of features, for example:
|
|
|
196
200
|
"processTimeMs": 0
|
|
197
201
|
}
|
|
198
202
|
},
|
|
203
|
+
"network-functions": {
|
|
204
|
+
"results": [],
|
|
205
|
+
".meta": {
|
|
206
|
+
"totalCalls": 0,
|
|
207
|
+
"totalFunctionDefinitions": 0,
|
|
208
|
+
"searchTimeMs": 1,
|
|
209
|
+
"processTimeMs": 0
|
|
210
|
+
}
|
|
211
|
+
},
|
|
199
212
|
"dataframe-access-validation": {
|
|
200
213
|
"results": [],
|
|
201
214
|
".meta": {
|
|
@@ -203,15 +216,15 @@ It offers a wide variety of features, for example:
|
|
|
203
216
|
"numAccesses": 0,
|
|
204
217
|
"totalAccessed": 0,
|
|
205
218
|
"searchTimeMs": 0,
|
|
206
|
-
"processTimeMs":
|
|
219
|
+
"processTimeMs": 3
|
|
207
220
|
}
|
|
208
221
|
},
|
|
209
222
|
"dead-code": {
|
|
210
223
|
"results": [],
|
|
211
224
|
".meta": {
|
|
212
225
|
"consideredNodes": 5,
|
|
213
|
-
"searchTimeMs":
|
|
214
|
-
"processTimeMs":
|
|
226
|
+
"searchTimeMs": 0,
|
|
227
|
+
"processTimeMs": 1
|
|
215
228
|
}
|
|
216
229
|
},
|
|
217
230
|
"useless-loop": {
|
|
@@ -224,11 +237,11 @@ It offers a wide variety of features, for example:
|
|
|
224
237
|
}
|
|
225
238
|
},
|
|
226
239
|
".meta": {
|
|
227
|
-
"timing":
|
|
240
|
+
"timing": 213
|
|
228
241
|
}
|
|
229
242
|
},
|
|
230
243
|
".meta": {
|
|
231
|
-
"timing":
|
|
244
|
+
"timing": 213
|
|
232
245
|
}
|
|
233
246
|
}
|
|
234
247
|
```
|
|
@@ -241,8 +254,6 @@ It offers a wide variety of features, for example:
|
|
|
241
254
|
|
|
242
255
|
|
|
243
256
|
|
|
244
|
-
|
|
245
|
-
|
|
246
257
|
|
|
247
258
|
|
|
248
259
|
|
|
@@ -295,7 +306,7 @@ It offers a wide variety of features, for example:
|
|
|
295
306
|
|
|
296
307
|
```shell
|
|
297
308
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
298
|
-
flowR repl using flowR v2.
|
|
309
|
+
flowR repl using flowR v2.6.0, R v4.5.0 (r-shell engine)
|
|
299
310
|
R> :slicer test/testfiles/example.R --criterion "11@sum"
|
|
300
311
|
```
|
|
301
312
|
|
|
@@ -342,7 +353,7 @@ It offers a wide variety of features, for example:
|
|
|
342
353
|
|
|
343
354
|
|
|
344
355
|
* 🚀 **fast data- and control-flow graphs**\
|
|
345
|
-
Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
356
|
+
Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">136.9 ms</span></i> (as of Oct 13, 2025),
|
|
346
357
|
_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
358
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the dataflow graph.
|
|
348
359
|
|
|
@@ -378,7 +389,7 @@ It offers a wide variety of features, for example:
|
|
|
378
389
|
|
|
379
390
|
```shell
|
|
380
391
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
381
|
-
flowR repl using flowR v2.
|
|
392
|
+
flowR repl using flowR v2.6.0, R v4.5.0 (r-shell engine)
|
|
382
393
|
R> :dataflow* test/testfiles/example.R
|
|
383
394
|
```
|
|
384
395
|
|
|
@@ -683,7 +694,7 @@ It offers a wide variety of features, for example:
|
|
|
683
694
|
```
|
|
684
695
|
|
|
685
696
|
|
|
686
|
-
(The analysis required
|
|
697
|
+
(The analysis required _15.0 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
687
698
|
|
|
688
699
|
|
|
689
700
|
|
|
@@ -753,7 +764,7 @@ We welcome every contribution! Please check out the [developer onboarding](https
|
|
|
753
764
|
|
|
754
765
|
----
|
|
755
766
|
|
|
756
|
-
*flowr* is actively developed by [Florian Sihler](https://eagleoutice.github.io/portfolio/) under the
|
|
767
|
+
*flowr* is actively developed by [Florian Sihler](https://eagleoutice.github.io/portfolio/) and (since October 1st 2025) [Oliver Gerstl](https://www.linkedin.com/in/oliver-gerstl) under the
|
|
757
768
|
[GPLv3 License](LICENSE).\
|
|
758
769
|
It is partially supported by the German Research Foundation (DFG) under the grant [504226141](https://gepris.dfg.de/gepris/projekt/504226141) ("CodeInspector").
|
|
759
770
|
|
|
@@ -22,7 +22,7 @@ export declare class DataFrameShapeInferenceVisitor<OtherInfo = NoInfo, ControlF
|
|
|
22
22
|
private oldDomain;
|
|
23
23
|
/**
|
|
24
24
|
* The new domain of an AST node during and after processing the node.
|
|
25
|
-
* This information is stored in the {@link AbstractInterpretationInfo}
|
|
25
|
+
* This information is stored in the {@link AbstractInterpretationInfo} afterward.
|
|
26
26
|
*/
|
|
27
27
|
private newDomain;
|
|
28
28
|
constructor(config: Config);
|
|
@@ -23,7 +23,7 @@ class DataFrameShapeInferenceVisitor extends semantic_cfg_guided_visitor_1.Seman
|
|
|
23
23
|
oldDomain = new Map();
|
|
24
24
|
/**
|
|
25
25
|
* The new domain of an AST node during and after processing the node.
|
|
26
|
-
* This information is stored in the {@link AbstractInterpretationInfo}
|
|
26
|
+
* This information is stored in the {@link AbstractInterpretationInfo} afterward.
|
|
27
27
|
*/
|
|
28
28
|
newDomain = new Map();
|
|
29
29
|
constructor(config) {
|
package/cli/flowr.js
CHANGED
|
@@ -14,16 +14,15 @@ const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
|
14
14
|
const config_1 = require("../config");
|
|
15
15
|
const assert_1 = require("../util/assert");
|
|
16
16
|
const scripts_info_1 = require("./common/scripts-info");
|
|
17
|
-
const shell_1 = require("../r-bridge/shell");
|
|
18
17
|
const execute_1 = require("./repl/execute");
|
|
19
18
|
const repl_main_1 = require("./repl/commands/repl-main");
|
|
20
19
|
const core_1 = require("./repl/core");
|
|
21
|
-
const repl_version_1 = require("./repl/commands/repl-version");
|
|
22
20
|
const print_version_1 = require("./repl/print-version");
|
|
23
21
|
const flowr_main_options_1 = require("./flowr-main-options");
|
|
24
|
-
const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
|
|
25
22
|
const fs_1 = __importDefault(require("fs"));
|
|
26
23
|
const path_1 = __importDefault(require("path"));
|
|
24
|
+
const engines_1 = require("../engines");
|
|
25
|
+
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
27
26
|
exports.toolName = 'flowr';
|
|
28
27
|
exports.optionHelp = [
|
|
29
28
|
{
|
|
@@ -92,31 +91,6 @@ function createConfig() {
|
|
|
92
91
|
});
|
|
93
92
|
return config;
|
|
94
93
|
}
|
|
95
|
-
async function retrieveEngineInstances(config) {
|
|
96
|
-
const engines = {};
|
|
97
|
-
if ((0, config_1.getEngineConfig)(config, 'r-shell')) {
|
|
98
|
-
// we keep an active shell session to allow other parse investigations :)
|
|
99
|
-
engines['r-shell'] = new shell_1.RShell((0, config_1.getEngineConfig)(config, 'r-shell'), {
|
|
100
|
-
revive: 2 /* RShellReviveOptions.Always */,
|
|
101
|
-
onRevive: (code, signal) => {
|
|
102
|
-
const signalText = signal == null ? '' : ` and signal ${signal}`;
|
|
103
|
-
console.log(ansi_1.formatter.format(`R process exited with code ${code}${signalText}. Restarting...`, { color: 5 /* Colors.Magenta */, effect: ansi_1.ColorEffect.Foreground }));
|
|
104
|
-
console.log((0, ansi_1.italic)(`If you want to exit, press either Ctrl+C twice, or enter ${(0, ansi_1.bold)(':quit')}`));
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
if ((0, config_1.getEngineConfig)(config, 'tree-sitter')) {
|
|
109
|
-
await tree_sitter_executor_1.TreeSitterExecutor.initTreeSitter((0, config_1.getEngineConfig)(config, 'tree-sitter'));
|
|
110
|
-
engines['tree-sitter'] = new tree_sitter_executor_1.TreeSitterExecutor();
|
|
111
|
-
}
|
|
112
|
-
let defaultEngine = config.defaultEngine;
|
|
113
|
-
if (!defaultEngine || !engines[defaultEngine]) {
|
|
114
|
-
// if a default engine isn't specified, we just take the first one we have
|
|
115
|
-
defaultEngine = Object.keys(engines)[0];
|
|
116
|
-
}
|
|
117
|
-
log_1.log.info(`Using engines ${Object.keys(engines).join(', ')} with default ${defaultEngine}`);
|
|
118
|
-
return { engines, default: defaultEngine };
|
|
119
|
-
}
|
|
120
94
|
function hookSignalHandlers(engines) {
|
|
121
95
|
const end = () => {
|
|
122
96
|
if (options.execute === undefined) {
|
|
@@ -142,29 +116,33 @@ async function mainRepl() {
|
|
|
142
116
|
console.log((0, command_line_usage_1.default)(exports.optionHelp));
|
|
143
117
|
process.exit(0);
|
|
144
118
|
}
|
|
145
|
-
const engines = await retrieveEngineInstances(config);
|
|
119
|
+
const engines = await (0, engines_1.retrieveEngineInstances)(config);
|
|
146
120
|
const defaultEngine = engines.engines[engines.default];
|
|
147
121
|
if (options.version) {
|
|
148
122
|
for (const engine of Object.values(engines.engines)) {
|
|
149
|
-
await (0,
|
|
123
|
+
await (0, version_1.printVersionInformation)(repl_main_1.standardReplOutput, engine);
|
|
150
124
|
engine?.close();
|
|
151
125
|
}
|
|
152
126
|
process.exit(0);
|
|
153
127
|
}
|
|
154
128
|
hookSignalHandlers(engines);
|
|
129
|
+
const analyzer = new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
|
|
130
|
+
.setParser(defaultEngine)
|
|
131
|
+
.setConfig(config)
|
|
132
|
+
.buildSync();
|
|
155
133
|
const allowRSessionAccess = options['r-session-access'] ?? false;
|
|
156
134
|
if (options.execute) {
|
|
157
|
-
await (0, core_1.replProcessAnswer)(
|
|
135
|
+
await (0, core_1.replProcessAnswer)(analyzer, repl_main_1.standardReplOutput, options.execute, allowRSessionAccess);
|
|
158
136
|
}
|
|
159
137
|
else {
|
|
160
138
|
await (0, print_version_1.printVersionRepl)(defaultEngine);
|
|
161
|
-
await (0, core_1.repl)(
|
|
139
|
+
await (0, core_1.repl)({ analyzer: analyzer, allowRSessionAccess });
|
|
162
140
|
}
|
|
163
141
|
process.exit(0);
|
|
164
142
|
}
|
|
165
143
|
async function mainServer(backend = new net_1.NetServer()) {
|
|
166
144
|
const config = createConfig();
|
|
167
|
-
const engines = await retrieveEngineInstances(config);
|
|
145
|
+
const engines = await (0, engines_1.retrieveEngineInstances)(config);
|
|
168
146
|
hookSignalHandlers(engines);
|
|
169
147
|
await new server_1.FlowRServer(engines.engines, engines.default, options['r-session-access'], config, backend).start(options.port);
|
|
170
148
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const controlflowCommand:
|
|
3
|
-
export declare const controlflowStarCommand:
|
|
4
|
-
export declare const controlflowBbCommand:
|
|
5
|
-
export declare const controlflowBbStarCommand:
|
|
1
|
+
import type { ReplCodeCommand } from './repl-main';
|
|
2
|
+
export declare const controlflowCommand: ReplCodeCommand;
|
|
3
|
+
export declare const controlflowStarCommand: ReplCodeCommand;
|
|
4
|
+
export declare const controlflowBbCommand: ReplCodeCommand;
|
|
5
|
+
export declare const controlflowBbStarCommand: ReplCodeCommand;
|
|
@@ -34,27 +34,18 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.controlflowBbStarCommand = exports.controlflowBbCommand = exports.controlflowStarCommand = exports.controlflowCommand = void 0;
|
|
37
|
-
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
38
|
-
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
39
37
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
40
38
|
const cfg_1 = require("../../../util/mermaid/cfg");
|
|
41
39
|
const ansi_1 = require("../../../util/text/ansi");
|
|
42
40
|
const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
|
|
43
|
-
|
|
44
|
-
return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
|
|
45
|
-
request: (0, retriever_1.requestFromInput)(remainingLine.trim())
|
|
46
|
-
}, config).allRemainingSteps();
|
|
47
|
-
}
|
|
48
|
-
function handleString(code) {
|
|
49
|
-
return code.startsWith('"') ? JSON.parse(code) : code;
|
|
50
|
-
}
|
|
41
|
+
const core_1 = require("../core");
|
|
51
42
|
function formatInfo(out, type) {
|
|
52
43
|
return out.formatter.format(`Copied ${type} to clipboard.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
53
44
|
}
|
|
54
|
-
async function produceAndPrintCfg(
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const mermaid = cfgConverter(cfg,
|
|
45
|
+
async function produceAndPrintCfg(analyzer, output, simplifications, cfgConverter) {
|
|
46
|
+
const cfg = await analyzer.controlflow([...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
|
|
47
|
+
const normalizedAst = await analyzer.normalize();
|
|
48
|
+
const mermaid = cfgConverter(cfg, normalizedAst);
|
|
58
49
|
output.stdout(mermaid);
|
|
59
50
|
try {
|
|
60
51
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -66,38 +57,46 @@ async function produceAndPrintCfg(shell, remainingLine, output, simplifications,
|
|
|
66
57
|
}
|
|
67
58
|
exports.controlflowCommand = {
|
|
68
59
|
description: `Get mermaid code for the control-flow graph of R code, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
60
|
+
isCodeCommand: true,
|
|
69
61
|
usageExample: ':controlflow',
|
|
70
62
|
aliases: ['cfg', 'cf'],
|
|
71
63
|
script: false,
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
65
|
+
fn: async ({ output, analyzer }) => {
|
|
66
|
+
await produceAndPrintCfg(analyzer, output, [], cfg_1.cfgToMermaid);
|
|
74
67
|
}
|
|
75
68
|
};
|
|
76
69
|
exports.controlflowStarCommand = {
|
|
77
70
|
description: 'Returns the URL to mermaid.live',
|
|
71
|
+
isCodeCommand: true,
|
|
78
72
|
usageExample: ':controlflow*',
|
|
79
73
|
aliases: ['cfg*', 'cf*'],
|
|
80
74
|
script: false,
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
76
|
+
fn: async ({ output, analyzer }) => {
|
|
77
|
+
await produceAndPrintCfg(analyzer, output, [], cfg_1.cfgToMermaidUrl);
|
|
83
78
|
}
|
|
84
79
|
};
|
|
85
80
|
exports.controlflowBbCommand = {
|
|
86
81
|
description: `Get mermaid code for the control-flow graph with basic blocks, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
82
|
+
isCodeCommand: true,
|
|
87
83
|
usageExample: ':controlflowbb',
|
|
88
84
|
aliases: ['cfgb', 'cfb'],
|
|
89
85
|
script: false,
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
87
|
+
fn: async ({ output, analyzer }) => {
|
|
88
|
+
await produceAndPrintCfg(analyzer, output, ['to-basic-blocks'], cfg_1.cfgToMermaid);
|
|
92
89
|
}
|
|
93
90
|
};
|
|
94
91
|
exports.controlflowBbStarCommand = {
|
|
95
92
|
description: 'Returns the URL to mermaid.live',
|
|
93
|
+
isCodeCommand: true,
|
|
96
94
|
usageExample: ':controlflowbb*',
|
|
97
95
|
aliases: ['cfgb*', 'cfb*'],
|
|
98
96
|
script: false,
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
98
|
+
fn: async ({ output, analyzer }) => {
|
|
99
|
+
await produceAndPrintCfg(analyzer, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl);
|
|
101
100
|
}
|
|
102
101
|
};
|
|
103
102
|
//# sourceMappingURL=repl-cfg.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReplCommand } from './repl-main';
|
|
1
|
+
import type { ReplCodeCommand, ReplCommand } from './repl-main';
|
|
2
2
|
export declare const helpCommand: ReplCommand;
|
|
3
|
-
export declare function getReplCommands(): Record<string, ReplCommand>;
|
|
3
|
+
export declare function getReplCommands(): Record<string, ReplCommand | ReplCodeCommand>;
|
|
4
4
|
/**
|
|
5
5
|
* The names of all commands including their aliases (but without the leading `:`)
|
|
6
6
|
*/
|
|
@@ -9,7 +9,7 @@ export declare function getCommandNames(): string[];
|
|
|
9
9
|
* Get the command for a given command name or alias.
|
|
10
10
|
* @param command - The name of the command (without the leading `:`)
|
|
11
11
|
*/
|
|
12
|
-
export declare function getCommand(command: string): ReplCommand | undefined;
|
|
12
|
+
export declare function getCommand(command: string): ReplCodeCommand | ReplCommand | undefined;
|
|
13
13
|
export declare function asOptionName(argument: string): string;
|
|
14
14
|
export declare function longestCommandName(): number;
|
|
15
15
|
export declare function padCmd<T>(string: T): string;
|
|
@@ -47,6 +47,7 @@ function printCommandHelp(formatter) {
|
|
|
47
47
|
}
|
|
48
48
|
exports.helpCommand = {
|
|
49
49
|
description: 'Show help information',
|
|
50
|
+
isCodeCommand: false,
|
|
50
51
|
script: false,
|
|
51
52
|
usageExample: ':help',
|
|
52
53
|
aliases: ['h', '?'],
|
|
@@ -113,6 +114,7 @@ function getReplCommands() {
|
|
|
113
114
|
aliases: [],
|
|
114
115
|
script: true,
|
|
115
116
|
usageExample: `:${script} --help`,
|
|
117
|
+
isCodeCommand: false,
|
|
116
118
|
fn: async ({ output, remainingLine }) => {
|
|
117
119
|
// check if the target *module* exists in the current directory, else try two dirs up, otherwise, fail with a message
|
|
118
120
|
let path = `${__dirname}/${target}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const dataflowCommand:
|
|
3
|
-
export declare const dataflowStarCommand:
|
|
4
|
-
export declare const dataflowSimplifiedCommand:
|
|
5
|
-
export declare const dataflowSimpleStarCommand:
|
|
1
|
+
import type { ReplCodeCommand } from './repl-main';
|
|
2
|
+
export declare const dataflowCommand: ReplCodeCommand;
|
|
3
|
+
export declare const dataflowStarCommand: ReplCodeCommand;
|
|
4
|
+
export declare const dataflowSimplifiedCommand: ReplCodeCommand;
|
|
5
|
+
export declare const dataflowSimpleStarCommand: ReplCodeCommand;
|
|
@@ -34,88 +34,85 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.dataflowSimpleStarCommand = exports.dataflowSimplifiedCommand = exports.dataflowStarCommand = exports.dataflowCommand = void 0;
|
|
37
|
-
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
38
37
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
39
38
|
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
40
39
|
const ansi_1 = require("../../../util/text/ansi");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
async function replGetDataflow(config, parser, code) {
|
|
45
|
-
return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
|
|
46
|
-
request: (0, retriever_1.requestFromInput)(code.trim())
|
|
47
|
-
}, config).allRemainingSteps();
|
|
48
|
-
}
|
|
49
|
-
function handleString(code) {
|
|
50
|
-
return code.startsWith('"') ? JSON.parse(code) : code;
|
|
51
|
-
}
|
|
52
|
-
function formatInfo(out, type, timing) {
|
|
53
|
-
return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${timing}ms).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
40
|
+
const core_1 = require("../core");
|
|
41
|
+
function formatInfo(out, type, meta) {
|
|
42
|
+
return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${meta['.meta'].timing + 'ms'}).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
54
43
|
}
|
|
55
44
|
exports.dataflowCommand = {
|
|
56
45
|
description: `Get mermaid code for the dataflow graph, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
46
|
+
isCodeCommand: true,
|
|
57
47
|
usageExample: ':dataflow',
|
|
58
48
|
aliases: ['d', 'df'],
|
|
59
49
|
script: false,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
50
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
51
|
+
fn: async ({ output, analyzer }) => {
|
|
52
|
+
const result = await analyzer.dataflow();
|
|
53
|
+
const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.graph, includeEnvironments: false }).string;
|
|
63
54
|
output.stdout(mermaid);
|
|
64
55
|
try {
|
|
65
56
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
66
57
|
clipboard.default.writeSync(mermaid);
|
|
67
|
-
output.stdout(formatInfo(output, 'mermaid code', result
|
|
58
|
+
output.stdout(formatInfo(output, 'mermaid code', result));
|
|
68
59
|
}
|
|
69
60
|
catch { /* do nothing this is a service thing */ }
|
|
70
61
|
}
|
|
71
62
|
};
|
|
72
63
|
exports.dataflowStarCommand = {
|
|
73
64
|
description: 'Returns the URL to mermaid.live',
|
|
65
|
+
isCodeCommand: true,
|
|
74
66
|
usageExample: ':dataflow*',
|
|
75
67
|
aliases: ['d*', 'df*'],
|
|
76
68
|
script: false,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
69
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
70
|
+
fn: async ({ output, analyzer }) => {
|
|
71
|
+
const result = await analyzer.dataflow();
|
|
72
|
+
const mermaid = (0, dfg_1.graphToMermaidUrl)(result.graph, false);
|
|
80
73
|
output.stdout(mermaid);
|
|
81
74
|
try {
|
|
82
75
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
83
76
|
clipboard.default.writeSync(mermaid);
|
|
84
|
-
output.stdout(formatInfo(output, 'mermaid url', result
|
|
77
|
+
output.stdout(formatInfo(output, 'mermaid url', result));
|
|
85
78
|
}
|
|
86
79
|
catch { /* do nothing this is a service thing */ }
|
|
87
80
|
}
|
|
88
81
|
};
|
|
89
82
|
exports.dataflowSimplifiedCommand = {
|
|
90
83
|
description: `Get mermaid code for the simplified dataflow graph, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
84
|
+
isCodeCommand: true,
|
|
91
85
|
usageExample: ':dataflowsimple',
|
|
92
86
|
aliases: ['ds', 'dfs'],
|
|
93
87
|
script: false,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
88
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
89
|
+
fn: async ({ output, analyzer }) => {
|
|
90
|
+
const result = await analyzer.dataflow();
|
|
91
|
+
const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.graph, includeEnvironments: false, simplified: true }).string;
|
|
97
92
|
output.stdout(mermaid);
|
|
98
93
|
try {
|
|
99
94
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
100
95
|
clipboard.default.writeSync(mermaid);
|
|
101
|
-
output.stdout(formatInfo(output, 'mermaid code', result
|
|
96
|
+
output.stdout(formatInfo(output, 'mermaid code', result));
|
|
102
97
|
}
|
|
103
98
|
catch { /* do nothing this is a service thing */ }
|
|
104
99
|
}
|
|
105
100
|
};
|
|
106
101
|
exports.dataflowSimpleStarCommand = {
|
|
107
102
|
description: 'Returns the URL to mermaid.live',
|
|
103
|
+
isCodeCommand: true,
|
|
108
104
|
usageExample: ':dataflowsimple*',
|
|
109
105
|
aliases: ['ds*', 'dfs*'],
|
|
110
106
|
script: false,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
107
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
108
|
+
fn: async ({ output, analyzer }) => {
|
|
109
|
+
const result = await analyzer.dataflow();
|
|
110
|
+
const mermaid = (0, dfg_1.graphToMermaidUrl)(result.graph, false, undefined, true);
|
|
114
111
|
output.stdout(mermaid);
|
|
115
112
|
try {
|
|
116
113
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
117
114
|
clipboard.default.writeSync(mermaid);
|
|
118
|
-
output.stdout(formatInfo(output, 'mermaid url', result
|
|
115
|
+
output.stdout(formatInfo(output, 'mermaid url', result));
|
|
119
116
|
}
|
|
120
117
|
catch { /* do nothing this is a service thing */ }
|
|
121
118
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReplCommand, ReplCommandInformation } from './repl-main';
|
|
2
|
-
export declare function tryExecuteRShellCommand({ output,
|
|
2
|
+
export declare function tryExecuteRShellCommand({ output, analyzer, allowRSessionAccess, remainingLine }: ReplCommandInformation): Promise<void>;
|
|
3
3
|
export declare const executeCommand: ReplCommand;
|