@eagleoutice/flowr 2.9.13 → 2.10.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 +52 -28
- package/abstract-interpretation/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/absint-visitor.js +20 -20
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +7 -5
- package/benchmark/stats/stats.d.ts +2 -2
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/parser/slice-query-parser.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.js +2 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.js +2 -2
- package/config.d.ts +12 -8
- package/config.js +5 -3
- package/control-flow/extract-cfg.js +2 -2
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +43 -43
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +3 -3
- package/core/print/dataflow-printer.d.ts +0 -14
- package/core/print/dataflow-printer.js +0 -21
- package/core/steps/all/core/20-dataflow.d.ts +3 -3
- package/core/steps/all/core/20-dataflow.js +3 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
- package/core/steps/all/static-slicing/00-slice.js +6 -8
- package/core/steps/pipeline/default-pipelines.d.ts +89 -89
- package/dataflow/environments/built-in-proc-name.d.ts +83 -0
- package/dataflow/environments/built-in-proc-name.js +88 -0
- package/dataflow/environments/built-in.d.ts +1 -83
- package/dataflow/environments/built-in.js +37 -120
- package/dataflow/environments/default-builtin-config.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.js +75 -75
- package/dataflow/environments/identifier.d.ts +5 -0
- package/dataflow/environments/identifier.js +18 -0
- package/dataflow/eval/resolve/resolve.js +2 -2
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -2
- package/dataflow/graph/call-graph.d.ts +46 -19
- package/dataflow/graph/call-graph.js +95 -114
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +133 -0
- package/dataflow/graph/df-helper.js +138 -0
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
- package/dataflow/graph/diff-dataflow-graph.js +3 -28
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +60 -0
- package/dataflow/graph/graph-helper.js +128 -0
- package/dataflow/graph/graph.d.ts +19 -3
- package/dataflow/graph/graph.js +32 -5
- package/dataflow/graph/vertex.d.ts +3 -1
- package/dataflow/info.d.ts +14 -4
- package/dataflow/info.js +28 -16
- package/dataflow/internal/linker.d.ts +14 -10
- package/dataflow/internal/linker.js +29 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +8 -7
- 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-eval.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- 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-s-three-dispatch.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
- package/dataflow/internal/process/functions/call/common.js +2 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
- package/documentation/doc-readme.js +2 -1
- package/documentation/doc-util/doc-dfg.d.ts +3 -0
- package/documentation/doc-util/doc-dfg.js +5 -7
- package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
- package/documentation/doc-util/doc-normalized-ast.js +0 -23
- package/documentation/doc-util/doc-structure.js +3 -3
- package/documentation/doc-util/doc-types.js +3 -3
- package/documentation/wiki-core.js +5 -4
- package/documentation/wiki-dataflow-graph.js +14 -12
- package/documentation/wiki-interface.js +3 -3
- package/documentation/wiki-linter.js +6 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +49 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/problematic-eval.d.ts +44 -0
- package/linter/rules/problematic-eval.js +83 -0
- package/linter/rules/seeded-randomness.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +35 -0
- package/linter/rules/stop-with-call-arg.js +72 -0
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +7 -7
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/flowr-analyzer-builder.d.ts +3 -0
- package/project/flowr-analyzer.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +90 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +308 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- 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 +3 -3
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +6 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +34 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +17 -1
- package/queries/query.js +4 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/model.js +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +29 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-printer.js +3 -3
- package/search/search-executor/search-enrichers.js +2 -2
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +43 -18
- package/slicing/criterion/parse.js +68 -63
- package/slicing/static/slicer-types.d.ts +2 -3
- package/slicing/static/static-slicer.d.ts +3 -4
- package/slicing/static/static-slicer.js +32 -12
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +7 -0
- package/util/diff.d.ts +2 -2
- package/util/mermaid/ast.js +4 -4
- package/util/mermaid/cfg.js +5 -5
- package/util/mermaid/dfg.d.ts +33 -18
- package/util/mermaid/dfg.js +47 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/range.d.ts +8 -0
- package/util/range.js +13 -1
- package/util/slice-direction.d.ts +7 -0
- package/util/slice-direction.js +12 -0
- package/util/version.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +0 -6
- package/dataflow/graph/invert-dfg.js +0 -20
- package/dataflow/graph/resolve-graph.d.ts +0 -8
- package/dataflow/graph/resolve-graph.js +0 -59
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.10.0, R grammar v14 (tree-sitter engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -33,13 +33,13 @@ It offers a wide variety of features, for example:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
Query: linter (
|
|
36
|
+
Query: linter (2 ms)
|
|
37
37
|
╰ Deprecated Functions (deprecated-functions):
|
|
38
|
-
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs:
|
|
38
|
+
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0
|
|
39
39
|
╰ File Path Validity (file-path-validity):
|
|
40
40
|
╰ certain:
|
|
41
41
|
╰ Path `/root/x.txt` at 1.1-23
|
|
42
|
-
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
42
|
+
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 0
|
|
43
43
|
╰ Seeded Randomness (seeded-randomness):
|
|
44
44
|
╰ Metadata: consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 0, processTimeMs: 0
|
|
45
45
|
╰ Absolute Paths (absolute-file-paths):
|
|
@@ -53,12 +53,16 @@ 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
58
|
╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
60
60
|
╰ Metadata: numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0
|
|
61
|
-
|
|
61
|
+
╰ Problematic eval (problematic-eval):
|
|
62
|
+
╰ Metadata: searchTimeMs: 0, processTimeMs: 0
|
|
63
|
+
╰ Stop without call.=False argument (stop-call):
|
|
64
|
+
╰ Metadata: consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0
|
|
65
|
+
All queries together required ≈2 ms (1ms accuracy, total 2 ms)
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
|
|
@@ -82,17 +86,17 @@ It offers a wide variety of features, for example:
|
|
|
82
86
|
|
|
83
87
|
Query: **linter** (2 ms)\
|
|
84
88
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
85
|
-
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs:
|
|
89
|
+
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
86
90
|
╰ **File Path Validity** (file-path-validity):\
|
|
87
91
|
╰ certain:\
|
|
88
92
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
89
|
-
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
93
|
+
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
90
94
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
91
95
|
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
92
96
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
93
97
|
╰ certain:\
|
|
94
98
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
95
|
-
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
99
|
+
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
96
100
|
╰ **Unused Definitions** (unused-definitions):\
|
|
97
101
|
╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
98
102
|
╰ **Naming Convention** (naming-convention):\
|
|
@@ -100,16 +104,20 @@ It offers a wide variety of features, for example:
|
|
|
100
104
|
╰ **Network Functions** (network-functions):\
|
|
101
105
|
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
102
106
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
103
|
-
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs:
|
|
107
|
+
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
104
108
|
╰ **Dead Code** (dead-code):\
|
|
105
109
|
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
106
110
|
╰ **Useless Loops** (useless-loop):\
|
|
107
111
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
112
|
+
╰ **Problematic eval** (problematic-eval):\
|
|
113
|
+
╰ _Metadata_: <code>searchTimeMs: 0, processTimeMs: 0</code>\
|
|
114
|
+
╰ **Stop without call.=False argument** (stop-call):\
|
|
115
|
+
╰ _Metadata_: <code>consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
108
116
|
_All queries together required ≈2 ms (1ms accuracy, total 2 ms)_
|
|
109
117
|
|
|
110
118
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
111
119
|
|
|
112
|
-
The analysis required _2.
|
|
120
|
+
The analysis required _2.3 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
113
121
|
|
|
114
122
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
115
123
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -126,7 +134,7 @@ It offers a wide variety of features, for example:
|
|
|
126
134
|
".meta": {
|
|
127
135
|
"totalCalls": 0,
|
|
128
136
|
"totalFunctionDefinitions": 0,
|
|
129
|
-
"searchTimeMs":
|
|
137
|
+
"searchTimeMs": 1,
|
|
130
138
|
"processTimeMs": 0
|
|
131
139
|
}
|
|
132
140
|
},
|
|
@@ -149,7 +157,7 @@ It offers a wide variety of features, for example:
|
|
|
149
157
|
"totalUnknown": 0,
|
|
150
158
|
"totalWritesBeforeAlways": 0,
|
|
151
159
|
"totalValid": 0,
|
|
152
|
-
"searchTimeMs":
|
|
160
|
+
"searchTimeMs": 0,
|
|
153
161
|
"processTimeMs": 0
|
|
154
162
|
}
|
|
155
163
|
},
|
|
@@ -181,7 +189,7 @@ It offers a wide variety of features, for example:
|
|
|
181
189
|
".meta": {
|
|
182
190
|
"totalConsidered": 1,
|
|
183
191
|
"totalUnknown": 0,
|
|
184
|
-
"searchTimeMs":
|
|
192
|
+
"searchTimeMs": 1,
|
|
185
193
|
"processTimeMs": 0
|
|
186
194
|
}
|
|
187
195
|
},
|
|
@@ -218,7 +226,7 @@ It offers a wide variety of features, for example:
|
|
|
218
226
|
"numAccesses": 0,
|
|
219
227
|
"totalAccessed": 0,
|
|
220
228
|
"searchTimeMs": 0,
|
|
221
|
-
"processTimeMs":
|
|
229
|
+
"processTimeMs": 0
|
|
222
230
|
}
|
|
223
231
|
},
|
|
224
232
|
"dead-code": {
|
|
@@ -236,6 +244,21 @@ It offers a wide variety of features, for example:
|
|
|
236
244
|
"searchTimeMs": 0,
|
|
237
245
|
"processTimeMs": 0
|
|
238
246
|
}
|
|
247
|
+
},
|
|
248
|
+
"problematic-eval": {
|
|
249
|
+
"results": [],
|
|
250
|
+
".meta": {
|
|
251
|
+
"searchTimeMs": 0,
|
|
252
|
+
"processTimeMs": 0
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"stop-call": {
|
|
256
|
+
"results": [],
|
|
257
|
+
".meta": {
|
|
258
|
+
"consideredNodes": 0,
|
|
259
|
+
"searchTimeMs": 0,
|
|
260
|
+
"processTimeMs": 0
|
|
261
|
+
}
|
|
239
262
|
}
|
|
240
263
|
},
|
|
241
264
|
".meta": {
|
|
@@ -308,7 +331,7 @@ It offers a wide variety of features, for example:
|
|
|
308
331
|
|
|
309
332
|
```shell
|
|
310
333
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
311
|
-
flowR repl using flowR v2.
|
|
334
|
+
flowR repl using flowR v2.10.0, R grammar v14 (tree-sitter engine)
|
|
312
335
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
313
336
|
```
|
|
314
337
|
|
|
@@ -322,7 +345,7 @@ It offers a wide variety of features, for example:
|
|
|
322
345
|
N <- 10
|
|
323
346
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
324
347
|
sum
|
|
325
|
-
All queries together required ≈
|
|
348
|
+
All queries together required ≈2 ms (1ms accuracy, total 2 ms)
|
|
326
349
|
```
|
|
327
350
|
|
|
328
351
|
|
|
@@ -356,7 +379,7 @@ It offers a wide variety of features, for example:
|
|
|
356
379
|
|
|
357
380
|
|
|
358
381
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
359
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
382
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">99.2 ms</span></i> (as of Mar 13, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
360
383
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
361
384
|
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).
|
|
362
385
|
|
|
@@ -392,7 +415,7 @@ It offers a wide variety of features, for example:
|
|
|
392
415
|
|
|
393
416
|
```shell
|
|
394
417
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
395
|
-
flowR repl using flowR v2.
|
|
418
|
+
flowR repl using flowR v2.10.0, R grammar v14 (tree-sitter engine)
|
|
396
419
|
R> :dataflow* test/testfiles/example.R
|
|
397
420
|
```
|
|
398
421
|
|
|
@@ -418,7 +441,7 @@ It offers a wide variety of features, for example:
|
|
|
418
441
|
*1.8*`"}}
|
|
419
442
|
%% No edges found for 1
|
|
420
443
|
0["`#91;RSymbol#93; sum
|
|
421
|
-
(0)
|
|
444
|
+
(0, sources: [1])
|
|
422
445
|
*1.1-3*`"]
|
|
423
446
|
2[["`#91;RBinaryOp#93; #60;#45;
|
|
424
447
|
(2)
|
|
@@ -432,7 +455,7 @@ It offers a wide variety of features, for example:
|
|
|
432
455
|
*2.12*`"}}
|
|
433
456
|
%% No edges found for 4
|
|
434
457
|
3["`#91;RSymbol#93; product
|
|
435
|
-
(3)
|
|
458
|
+
(3, sources: [4])
|
|
436
459
|
*2.1-7*`"]
|
|
437
460
|
5[["`#91;RBinaryOp#93; #60;#45;
|
|
438
461
|
(5)
|
|
@@ -443,7 +466,7 @@ It offers a wide variety of features, for example:
|
|
|
443
466
|
*3.6*`"}}
|
|
444
467
|
%% No edges found for 7
|
|
445
468
|
6["`#91;RSymbol#93; w
|
|
446
|
-
(6)
|
|
469
|
+
(6, sources: [7])
|
|
447
470
|
*3.1*`"]
|
|
448
471
|
8[["`#91;RBinaryOp#93; #60;#45;
|
|
449
472
|
(8)
|
|
@@ -454,14 +477,14 @@ It offers a wide variety of features, for example:
|
|
|
454
477
|
*4.6-7*`"}}
|
|
455
478
|
%% No edges found for 10
|
|
456
479
|
9["`#91;RSymbol#93; N
|
|
457
|
-
(9)
|
|
480
|
+
(9, sources: [10])
|
|
458
481
|
*4.1*`"]
|
|
459
482
|
11[["`#91;RBinaryOp#93; #60;#45;
|
|
460
483
|
(11)
|
|
461
484
|
*4.1-7*
|
|
462
485
|
(9, 10)`"]]
|
|
463
486
|
12["`#91;RSymbol#93; i
|
|
464
|
-
(12)
|
|
487
|
+
(12, sources: [20])
|
|
465
488
|
*6.6*`"]
|
|
466
489
|
13{{"`#91;RNumber#93; 1
|
|
467
490
|
(13)
|
|
@@ -513,7 +536,7 @@ It offers a wide variety of features, for example:
|
|
|
513
536
|
*7.10-20*
|
|
514
537
|
(26, 27)`"]]
|
|
515
538
|
23["`#91;RSymbol#93; sum
|
|
516
|
-
(23, :may:36
|
|
539
|
+
(23, :may:36+, sources: [28])
|
|
517
540
|
*7.3-5*`"]
|
|
518
541
|
29[["`#91;RBinaryOp#93; #60;#45;
|
|
519
542
|
(29, :may:36+)
|
|
@@ -530,7 +553,7 @@ It offers a wide variety of features, for example:
|
|
|
530
553
|
*8.14-24*
|
|
531
554
|
(31, 32)`"]]
|
|
532
555
|
30["`#91;RSymbol#93; product
|
|
533
|
-
(30, :may:36
|
|
556
|
+
(30, :may:36+, sources: [33])
|
|
534
557
|
*8.3-9*`"]
|
|
535
558
|
34[["`#91;RBinaryOp#93; #60;#45;
|
|
536
559
|
(34, :may:36+)
|
|
@@ -700,7 +723,7 @@ It offers a wide variety of features, for example:
|
|
|
700
723
|
```
|
|
701
724
|
|
|
702
725
|
|
|
703
|
-
(The analysis required _1.
|
|
726
|
+
(The analysis required _1.6 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
704
727
|
|
|
705
728
|
|
|
706
729
|
|
|
@@ -877,7 +900,8 @@ We welcome every contribution! Please check out the [developer onboarding](https
|
|
|
877
900
|
|
|
878
901
|
*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
|
|
879
902
|
[GPLv3 License](LICENSE).\
|
|
880
|
-
It is partially supported by the German Research Foundation (DFG) under the grant [504226141](https://gepris.dfg.de/gepris/projekt/504226141) ("CodeInspector")
|
|
903
|
+
It is partially supported by the German Research Foundation (DFG) under the grant [504226141](https://gepris.dfg.de/gepris/projekt/504226141) ("CodeInspector")
|
|
904
|
+
and received an unrestricted gift from [Posit](https://posit.co/), the open-source data science company.
|
|
881
905
|
|
|
882
906
|
----
|
|
883
907
|
|
|
@@ -2,7 +2,6 @@ import type { ControlFlowInformation } from '../control-flow/control-flow-graph'
|
|
|
2
2
|
import { CfgVertex } from '../control-flow/control-flow-graph';
|
|
3
3
|
import type { SemanticCfgGuidedVisitorConfiguration } from '../control-flow/semantic-cfg-guided-visitor';
|
|
4
4
|
import { SemanticCfgGuidedVisitor } from '../control-flow/semantic-cfg-guided-visitor';
|
|
5
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in';
|
|
6
5
|
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
7
6
|
import { type DataflowGraphVertexFunctionCall, type DataflowGraphVertexVariableDefinition } from '../dataflow/graph/vertex';
|
|
8
7
|
import type { NoInfo, RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
@@ -11,6 +10,7 @@ import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
|
11
10
|
import { type AnyAbstractDomain } from './domains/abstract-domain';
|
|
12
11
|
import type { StateAbstractDomain } from './domains/state-abstract-domain';
|
|
13
12
|
import { MutableStateAbstractDomain } from './domains/state-abstract-domain';
|
|
13
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
14
14
|
export type AbsintVisitorConfiguration = Omit<SemanticCfgGuidedVisitorConfiguration<NoInfo, ControlFlowInformation, NormalizedAst>, 'defaultVisitingOrder' | 'defaultVisitingType'>;
|
|
15
15
|
/**
|
|
16
16
|
* A control flow graph visitor to perform abstract interpretation.
|
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AbstractInterpretationVisitor = void 0;
|
|
4
4
|
const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
5
5
|
const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
|
|
6
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
7
6
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
8
|
-
const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
|
|
9
7
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
10
8
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
11
9
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
12
10
|
const assert_1 = require("../util/assert");
|
|
13
11
|
const abstract_domain_1 = require("./domains/abstract-domain");
|
|
14
12
|
const state_abstract_domain_1 = require("./domains/state-abstract-domain");
|
|
13
|
+
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
14
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
15
15
|
/**
|
|
16
16
|
* A control flow graph visitor to perform abstract interpretation.
|
|
17
17
|
*
|
|
@@ -86,7 +86,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
86
86
|
else if (node.type === type_1.RType.ExpressionList && node.children.length > 0) {
|
|
87
87
|
return this.getAbstractValue(node.children.at(-1), state);
|
|
88
88
|
}
|
|
89
|
-
else if (origins.includes(
|
|
89
|
+
else if (origins.includes(built_in_proc_name_1.BuiltInProcName.Pipe)) {
|
|
90
90
|
if (node.type === type_1.RType.Pipe || node.type === type_1.RType.BinaryOp) {
|
|
91
91
|
return this.getAbstractValue(node.rhs, state);
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
94
94
|
return this.getAbstractValue(call.args[1].nodeId, state);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
else if (origins.includes(
|
|
97
|
+
else if (origins.includes(built_in_proc_name_1.BuiltInProcName.IfThenElse)) {
|
|
98
98
|
let values = [];
|
|
99
99
|
if (node.type === type_1.RType.IfThenElse && node.otherwise !== undefined) {
|
|
100
100
|
values = [node.then, node.otherwise].map(entry => this.getAbstractValue(entry, state));
|
|
@@ -203,20 +203,20 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
203
203
|
onDispatchFunctionCallOrigin(call, origin) {
|
|
204
204
|
super.onDispatchFunctionCallOrigin(call, origin);
|
|
205
205
|
switch (origin) {
|
|
206
|
-
case
|
|
207
|
-
case
|
|
208
|
-
case
|
|
209
|
-
case
|
|
210
|
-
case
|
|
211
|
-
case
|
|
212
|
-
case
|
|
213
|
-
case
|
|
214
|
-
case
|
|
215
|
-
case
|
|
216
|
-
case
|
|
217
|
-
case
|
|
218
|
-
case
|
|
219
|
-
case
|
|
206
|
+
case built_in_proc_name_1.BuiltInProcName.ExpressionList:
|
|
207
|
+
case built_in_proc_name_1.BuiltInProcName.IfThenElse:
|
|
208
|
+
case built_in_proc_name_1.BuiltInProcName.ForLoop:
|
|
209
|
+
case built_in_proc_name_1.BuiltInProcName.WhileLoop:
|
|
210
|
+
case built_in_proc_name_1.BuiltInProcName.RepeatLoop:
|
|
211
|
+
case built_in_proc_name_1.BuiltInProcName.FunctionDefinition:
|
|
212
|
+
case built_in_proc_name_1.BuiltInProcName.Assignment:
|
|
213
|
+
case built_in_proc_name_1.BuiltInProcName.AssignmentLike:
|
|
214
|
+
case built_in_proc_name_1.BuiltInProcName.TableAssignment:
|
|
215
|
+
case built_in_proc_name_1.BuiltInProcName.Replacement:
|
|
216
|
+
case built_in_proc_name_1.BuiltInProcName.Access:
|
|
217
|
+
case built_in_proc_name_1.BuiltInProcName.Pipe:
|
|
218
|
+
case built_in_proc_name_1.BuiltInProcName.Break:
|
|
219
|
+
case built_in_proc_name_1.BuiltInProcName.Return:
|
|
220
220
|
return;
|
|
221
221
|
default:
|
|
222
222
|
return this.onFunctionCall({ call });
|
|
@@ -273,7 +273,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
273
273
|
}
|
|
274
274
|
/** Gets each variable origin that has already been visited and whose assignment has already been processed */
|
|
275
275
|
getVariableOrigins(nodeId) {
|
|
276
|
-
return
|
|
276
|
+
return df_helper_1.Dataflow.origin(this.config.dfg, nodeId)
|
|
277
277
|
?.filter(origin => origin.type === 0 /* OriginType.ReadVariableOrigin */)
|
|
278
278
|
.map(origin => origin.id)
|
|
279
279
|
.filter(origin => this.trace.has(origin) && !this.unassigned.has(origin)) ?? [];
|
|
@@ -293,7 +293,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
293
293
|
return false;
|
|
294
294
|
}
|
|
295
295
|
const origin = dataflowVertex.origin;
|
|
296
|
-
return origin.includes(
|
|
296
|
+
return origin.includes(built_in_proc_name_1.BuiltInProcName.ForLoop) || origin.includes(built_in_proc_name_1.BuiltInProcName.WhileLoop) || origin.includes(built_in_proc_name_1.BuiltInProcName.RepeatLoop);
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
299
299
|
* Checks whether a control flow graph vertex should be skipped during visitation.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapDataFrameReplacementFunction = mapDataFrameReplacementFunction;
|
|
4
4
|
const config_1 = require("../../../config");
|
|
5
|
-
const built_in_1 = require("../../../dataflow/environments/built-in");
|
|
6
5
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
6
|
const make_argument_1 = require("../../../dataflow/internal/process/functions/call/argument/make-argument");
|
|
8
7
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
@@ -12,6 +11,7 @@ const semantics_1 = require("../semantics");
|
|
|
12
11
|
const access_mapper_1 = require("./access-mapper");
|
|
13
12
|
const arguments_1 = require("./arguments");
|
|
14
13
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
14
|
+
const built_in_proc_name_1 = require("../../../dataflow/environments/built-in-proc-name");
|
|
15
15
|
/** Mapper for mapping the supported data frame replacement functions to mapper functions */
|
|
16
16
|
const DataFrameReplacementFunctionMapper = {
|
|
17
17
|
'colnames': mapDataFrameColNamesAssignment,
|
|
@@ -59,7 +59,7 @@ function isDataFrameReplacement(functionName) {
|
|
|
59
59
|
}
|
|
60
60
|
function hasParentReplacement(node, dfg) {
|
|
61
61
|
const parentVertex = node.info.parent ? dfg.getVertex(node.info.parent) : undefined;
|
|
62
|
-
return (0, vertex_1.isFunctionCallVertex)(parentVertex) && parentVertex.origin.includes(
|
|
62
|
+
return (0, vertex_1.isFunctionCallVertex)(parentVertex) && parentVertex.origin.includes(built_in_proc_name_1.BuiltInProcName.Replacement);
|
|
63
63
|
}
|
|
64
64
|
function mapDataFrameContentAssignment(access, expression, inference) {
|
|
65
65
|
const dataFrame = access.accessed;
|
package/benchmark/slicer.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { SliceResult } from '../slicing/static/slicer-types';
|
|
|
8
8
|
import type { ReconstructionResult } from '../reconstruct/reconstruct';
|
|
9
9
|
import type { PerSliceStats, SlicerStats, SlicerStatsDfShape } from './stats/stats';
|
|
10
10
|
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
11
|
-
import
|
|
11
|
+
import { SlicingCriteria } from '../slicing/criterion/parse';
|
|
12
12
|
import { type RParseRequestFromFile, type RParseRequestFromText } from '../r-bridge/retriever';
|
|
13
13
|
import { type SlicingCriteriaFilter } from '../slicing/criterion/collect-all';
|
|
14
14
|
import type { AutoSelectPredicate } from '../reconstruct/auto-select/auto-select-defaults';
|
package/benchmark/slicer.js
CHANGED
|
@@ -13,6 +13,7 @@ const seedrandom_1 = __importDefault(require("seedrandom"));
|
|
|
13
13
|
const log_1 = require("../util/log");
|
|
14
14
|
const assert_1 = require("../util/assert");
|
|
15
15
|
const strings_1 = require("../util/text/strings");
|
|
16
|
+
const parse_1 = require("../slicing/criterion/parse");
|
|
16
17
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
17
18
|
const retriever_1 = require("../r-bridge/retriever");
|
|
18
19
|
const collect_all_1 = require("../slicing/criterion/collect-all");
|
|
@@ -199,15 +200,16 @@ class BenchmarkSlicer {
|
|
|
199
200
|
this.executor.updateRequest({ criterion: slicingCriteria });
|
|
200
201
|
const totalStopwatch = measurements.start('total');
|
|
201
202
|
const slicedOutput = await this.measureSliceStep('slice', measurements, 'static slicing');
|
|
202
|
-
|
|
203
|
+
const decodedCriteria = parse_1.SlicingCriteria.decodeAll(slicingCriteria, this.normalizedAst.idMap);
|
|
204
|
+
stats.slicingCriteria = Array.from(decodedCriteria);
|
|
203
205
|
stats.reconstructedCode = await this.measureSliceStep('reconstruct', measurements, 'reconstruct code');
|
|
204
206
|
totalStopwatch.stop();
|
|
205
207
|
exports.benchmarkLogger.debug(`Produced code for ${JSON.stringify(slicingCriteria)}: ${stats.reconstructedCode.code}`);
|
|
206
208
|
const results = this.executor.getResults(false);
|
|
207
209
|
if (exports.benchmarkLogger.settings.minLevel >= 3 /* LogLevel.Info */) {
|
|
208
|
-
exports.benchmarkLogger.info(`mapped slicing criteria: ${slicedOutput.
|
|
209
|
-
const node = results.normalize.idMap.get(
|
|
210
|
-
return `\n- id: ${
|
|
210
|
+
exports.benchmarkLogger.info(`mapped slicing criteria: ${slicedOutput.slicedFor.map(id => {
|
|
211
|
+
const node = results.normalize.idMap.get(id);
|
|
212
|
+
return `\n- id: ${id}, location: ${JSON.stringify(node?.location)}, lexeme: ${JSON.stringify(node?.lexeme)}`;
|
|
211
213
|
}).join('')}`);
|
|
212
214
|
}
|
|
213
215
|
// if it is not in the dataflow graph it was kept to be safe and should not count to the included nodes
|
|
@@ -235,7 +237,7 @@ class BenchmarkSlicer {
|
|
|
235
237
|
this.guardActive();
|
|
236
238
|
const g = this.dataflow?.graph;
|
|
237
239
|
(0, assert_1.guard)(g !== undefined, 'dataflow should be defined for call graph extraction');
|
|
238
|
-
this.callGraph = this.measureSimpleStep('extract call graph', () =>
|
|
240
|
+
this.callGraph = this.measureSimpleStep('extract call graph', () => call_graph_1.CallGraph.compute(g));
|
|
239
241
|
}
|
|
240
242
|
/**
|
|
241
243
|
* Infer the shape of data frames using abstract interpretation with {@link inferDataFrameShapes}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SlicingCriterion, SlicingCriteria } from '../../slicing/criterion/parse';
|
|
2
2
|
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import type { ReconstructionResult } from '../../reconstruct/reconstruct';
|
|
4
4
|
import type { RParseRequestFromFile, RParseRequestFromText } from '../../r-bridge/retriever';
|
|
@@ -15,7 +15,7 @@ export type ElapsedTime = bigint;
|
|
|
15
15
|
export interface PerSliceStats {
|
|
16
16
|
measurements: Map<PerSliceMeasurements, ElapsedTime>;
|
|
17
17
|
slicingCriteria: {
|
|
18
|
-
criterion:
|
|
18
|
+
criterion: SlicingCriterion;
|
|
19
19
|
id: NodeId;
|
|
20
20
|
}[];
|
|
21
21
|
reconstructedCode: ReconstructionResult;
|
|
@@ -35,11 +35,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.dataflowSimpleStarCommand = exports.dataflowSimplifiedCommand = exports.dataflowSilentCommand = exports.dataflowAsciiCommand = exports.dataflowStarCommand = exports.dataflowCommand = void 0;
|
|
37
37
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
38
|
-
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
39
38
|
const ansi_1 = require("../../../util/text/ansi");
|
|
40
39
|
const core_1 = require("../core");
|
|
41
40
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
42
41
|
const dfg_ascii_1 = require("../../../util/simple-df/dfg-ascii");
|
|
42
|
+
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
43
43
|
function formatInfo(out, type, meta) {
|
|
44
44
|
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 */ });
|
|
45
45
|
}
|
|
@@ -52,7 +52,7 @@ exports.dataflowCommand = {
|
|
|
52
52
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
53
53
|
fn: async ({ output, analyzer }) => {
|
|
54
54
|
const result = await analyzer.dataflow();
|
|
55
|
-
const mermaid =
|
|
55
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.convert({ graph: result.graph, includeEnvironments: false }).string;
|
|
56
56
|
output.stdout(mermaid);
|
|
57
57
|
try {
|
|
58
58
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -72,7 +72,7 @@ exports.dataflowStarCommand = {
|
|
|
72
72
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
73
73
|
fn: async ({ output, analyzer }) => {
|
|
74
74
|
const result = await analyzer.dataflow();
|
|
75
|
-
const mermaid =
|
|
75
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false);
|
|
76
76
|
output.stdout(mermaid);
|
|
77
77
|
try {
|
|
78
78
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -126,7 +126,7 @@ exports.dataflowSimplifiedCommand = {
|
|
|
126
126
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
127
127
|
fn: async ({ output, analyzer }) => {
|
|
128
128
|
const result = await analyzer.dataflow();
|
|
129
|
-
const mermaid =
|
|
129
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.convert({ graph: result.graph, includeEnvironments: false, simplified: true }).string;
|
|
130
130
|
output.stdout(mermaid);
|
|
131
131
|
try {
|
|
132
132
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -145,7 +145,7 @@ exports.dataflowSimpleStarCommand = {
|
|
|
145
145
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
146
146
|
fn: async ({ output, analyzer }) => {
|
|
147
147
|
const result = await analyzer.dataflow();
|
|
148
|
-
const mermaid =
|
|
148
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false, undefined, true);
|
|
149
149
|
output.stdout(mermaid);
|
|
150
150
|
try {
|
|
151
151
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { SlicingCriterion, SlicingCriteria } from '../../../slicing/criterion/parse';
|
|
2
|
+
import { SliceDirection } from '../../../util/slice-direction';
|
|
3
3
|
/**
|
|
4
4
|
* Checks whether the given argument represents a slicing direction with an `f` suffix.
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ export declare function sliceDirectionParser(argument: string): SliceDirection;
|
|
|
7
7
|
/**
|
|
8
8
|
* Parses a single slicing criterion from the given argument.
|
|
9
9
|
*/
|
|
10
|
-
export declare function sliceCriterionParser(argument: string | undefined):
|
|
10
|
+
export declare function sliceCriterionParser(argument: string | undefined): SlicingCriterion | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* Parses multiple slicing criteria from the given argument.
|
|
13
13
|
*/
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.sliceDirectionParser = sliceDirectionParser;
|
|
4
4
|
exports.sliceCriterionParser = sliceCriterionParser;
|
|
5
5
|
exports.sliceCriteriaParser = sliceCriteriaParser;
|
|
6
|
-
const
|
|
6
|
+
const slice_direction_1 = require("../../../util/slice-direction");
|
|
7
7
|
/**
|
|
8
8
|
* Checks whether the given argument represents a slicing direction with an `f` suffix.
|
|
9
9
|
*/
|
|
10
10
|
function sliceDirectionParser(argument) {
|
|
11
11
|
const endBracket = argument.indexOf(')');
|
|
12
|
-
return argument[endBracket + 1] === 'f' ?
|
|
12
|
+
return argument[endBracket + 1] === 'f' ? slice_direction_1.SliceDirection.Forward : slice_direction_1.SliceDirection.Backward;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Parses a single slicing criterion from the given argument.
|
|
@@ -58,8 +58,8 @@ const tmp = __importStar(require("tmp"));
|
|
|
58
58
|
const fs_1 = __importDefault(require("fs"));
|
|
59
59
|
const message_query_1 = require("./messages/message-query");
|
|
60
60
|
const compact_1 = require("./compact");
|
|
61
|
-
const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
|
|
62
61
|
const flowr_analyzer_builder_1 = require("../../../project/flowr-analyzer-builder");
|
|
62
|
+
const slice_direction_1 = require("../../../util/slice-direction");
|
|
63
63
|
/**
|
|
64
64
|
* Each connection handles a single client, answering to its requests.
|
|
65
65
|
* There is no need to construct this class manually, {@link FlowRServer} will do it for you.
|
|
@@ -235,7 +235,7 @@ class FlowRServerConnection {
|
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
const request = requestResult.message;
|
|
238
|
-
this.logger.info(`[${request.filetoken}] Received ${request.direction ??
|
|
238
|
+
this.logger.info(`[${request.filetoken}] Received ${request.direction ?? slice_direction_1.SliceDirection.Backward} slice request with criteria ${JSON.stringify(request.criterion)}`);
|
|
239
239
|
const fileInformation = this.fileMap.get(request.filetoken);
|
|
240
240
|
if (!fileInformation) {
|
|
241
241
|
(0, send_1.sendMessage)(this.socket, {
|
|
@@ -2,7 +2,7 @@ import type { IdMessageBase, MessageDefinition } from './all-messages';
|
|
|
2
2
|
import type { SlicingCriteria } from '../../../../slicing/criterion/parse';
|
|
3
3
|
import type { PipelineOutput } from '../../../../core/steps/pipeline/pipeline';
|
|
4
4
|
import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICING_PIPELINE } from '../../../../core/steps/pipeline/default-pipelines';
|
|
5
|
-
import { SliceDirection } from '../../../../
|
|
5
|
+
import { SliceDirection } from '../../../../util/slice-direction';
|
|
6
6
|
/**
|
|
7
7
|
* Can only be sent after you have sent the {@link FileAnalysisRequestMessage}.
|
|
8
8
|
* Using the same `filetoken` as in the {@link FileAnalysisRequestMessage} you
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.responseSliceMessage = exports.requestSliceMessage = void 0;
|
|
37
37
|
const Joi = __importStar(require("joi"));
|
|
38
|
-
const
|
|
38
|
+
const slice_direction_1 = require("../../../../util/slice-direction");
|
|
39
39
|
exports.requestSliceMessage = {
|
|
40
40
|
type: 'request-slice',
|
|
41
41
|
schema: Joi.object({
|
|
@@ -43,7 +43,7 @@ exports.requestSliceMessage = {
|
|
|
43
43
|
id: Joi.string().optional().description('The id of the message, if you passed one in the request.'),
|
|
44
44
|
filetoken: Joi.string().required().description('The filetoken of the file to slice must be the same as with the analysis request.'),
|
|
45
45
|
criterion: Joi.array().items(Joi.string()).min(0).required().required().description('The slicing criteria to use.'),
|
|
46
|
-
direction: Joi.string().valid(...Object.values(
|
|
46
|
+
direction: Joi.string().valid(...Object.values(slice_direction_1.SliceDirection)).description('The direction to slice in. Defaults to backward slicing if unset.')
|
|
47
47
|
})
|
|
48
48
|
};
|
|
49
49
|
exports.responseSliceMessage = {
|