@eagleoutice/flowr 2.2.12 → 2.2.13
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 +82 -20
- package/benchmark/slicer.js +2 -2
- package/benchmark/summarizer/first-phase/input.js +1 -1
- package/benchmark/summarizer/first-phase/process.js +3 -3
- package/benchmark/summarizer/second-phase/process.js +1 -1
- package/benchmark/summarizer/summarizer.js +1 -1
- package/cli/common/options.js +4 -4
- package/cli/common/script.js +1 -1
- package/cli/flowr.js +1 -1
- package/cli/repl/commands/repl-cfg.d.ts +2 -0
- package/cli/repl/commands/repl-cfg.js +38 -24
- package/cli/repl/commands/repl-commands.js +4 -2
- package/cli/repl/commands/repl-dataflow.js +3 -3
- package/cli/repl/commands/repl-execute.js +1 -1
- package/cli/repl/commands/repl-main.d.ts +1 -1
- package/cli/repl/commands/repl-main.js +1 -1
- package/cli/repl/commands/repl-normalize.js +1 -1
- package/cli/repl/commands/repl-query.js +2 -2
- package/cli/repl/core.js +1 -1
- package/cli/repl/prompt.js +1 -1
- package/cli/repl/server/connection.js +4 -4
- package/cli/repl/server/messages/message-analysis.d.ts +1 -1
- package/cli/script-core/statistics-core.js +1 -1
- package/cli/script-core/statistics-helper-core.js +4 -4
- package/config.d.ts +47 -24
- package/config.js +3 -3
- package/control-flow/basic-cfg-guided-visitor.d.ts +39 -0
- package/control-flow/basic-cfg-guided-visitor.js +114 -0
- package/control-flow/cfg-properties.d.ts +26 -0
- package/control-flow/cfg-properties.js +100 -0
- package/control-flow/cfg-simplification.d.ts +18 -0
- package/control-flow/cfg-simplification.js +55 -0
- package/control-flow/cfg-to-basic-blocks.d.ts +5 -0
- package/control-flow/cfg-to-basic-blocks.js +81 -0
- package/control-flow/control-flow-graph.d.ts +247 -0
- package/control-flow/control-flow-graph.js +290 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +32 -0
- package/control-flow/dfg-cfg-guided-visitor.js +71 -0
- package/control-flow/diff-cfg.d.ts +11 -0
- package/control-flow/diff-cfg.js +161 -0
- package/control-flow/extract-cfg.d.ts +30 -0
- package/control-flow/extract-cfg.js +475 -0
- package/control-flow/happens-before.d.ts +7 -0
- package/{util/cfg → control-flow}/happens-before.js +3 -3
- package/control-flow/semantic-cfg-guided-visitor.d.ts +452 -0
- package/control-flow/semantic-cfg-guided-visitor.js +492 -0
- package/control-flow/simple-visitor.d.ts +25 -0
- package/control-flow/simple-visitor.js +80 -0
- package/control-flow/syntax-cfg-guided-visitor.d.ts +128 -0
- package/control-flow/syntax-cfg-guided-visitor.js +166 -0
- package/core/print/print.d.ts +1 -1
- package/core/print/slice-diff-ansi.js +1 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/dataflow/environments/built-in-config.js +9 -6
- package/dataflow/environments/built-in.d.ts +8 -4
- package/dataflow/environments/built-in.js +47 -5
- package/dataflow/environments/default-builtin-config.d.ts +2 -0
- package/dataflow/environments/default-builtin-config.js +81 -14
- package/dataflow/environments/resolve-by-name.js +15 -4
- package/dataflow/extractor.js +2 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +3 -1
- package/dataflow/graph/dataflowgraph-builder.js +4 -2
- package/dataflow/graph/diff-dataflow-graph.d.ts +16 -0
- package/dataflow/graph/{diff.js → diff-dataflow-graph.js} +30 -56
- package/dataflow/graph/graph.d.ts +11 -3
- package/dataflow/graph/graph.js +27 -12
- package/dataflow/graph/vertex.d.ts +17 -2
- package/dataflow/internal/linker.d.ts +3 -2
- package/dataflow/internal/linker.js +33 -24
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +12 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +84 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +23 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +15 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -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-source.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +4 -1
- package/dataflow/internal/process/functions/call/common.js +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -0
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +6 -4
- package/dataflow/internal/process/process-named-call.d.ts +1 -1
- package/dataflow/internal/process/process-named-call.js +5 -5
- package/dataflow/origin/dfg-get-origin.d.ts +82 -0
- package/dataflow/origin/dfg-get-origin.js +116 -0
- package/documentation/doc-util/doc-cfg.d.ts +13 -6
- package/documentation/doc-util/doc-cfg.js +19 -14
- package/documentation/doc-util/doc-cli-option.js +4 -2
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-escape.d.ts +7 -0
- package/documentation/doc-util/doc-escape.js +19 -0
- package/documentation/doc-util/doc-files.d.ts +1 -0
- package/documentation/doc-util/doc-files.js +2 -1
- package/documentation/doc-util/doc-normalized-ast.js +3 -3
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -1
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/doc-util/doc-server-message.js +2 -2
- package/documentation/doc-util/doc-structure.d.ts +1 -0
- package/documentation/doc-util/doc-structure.js +5 -0
- package/documentation/doc-util/doc-types.d.ts +7 -1
- package/documentation/doc-util/doc-types.js +13 -2
- package/documentation/print-capabilities-markdown.js +27 -1
- package/documentation/print-cfg-wiki.js +505 -17
- package/documentation/print-dataflow-graph-wiki.js +180 -25
- package/documentation/print-engines-wiki.js +1 -1
- package/documentation/print-faq-wiki.d.ts +1 -0
- package/documentation/print-faq-wiki.js +75 -0
- package/documentation/print-interface-wiki.js +1 -1
- package/documentation/print-linting-and-testing-wiki.js +52 -36
- package/documentation/print-normalized-ast-wiki.js +1 -1
- package/documentation/print-onboarding-wiki.d.ts +1 -0
- package/documentation/print-onboarding-wiki.js +42 -0
- package/documentation/print-query-wiki.js +21 -1
- package/documentation/print-readme.js +10 -3
- package/package.json +9 -6
- package/queries/catalog/call-context-query/call-context-query-executor.js +5 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +2 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +24 -21
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -1
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +2 -2
- 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 +4 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-format.js +2 -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 +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +5 -0
- package/queries/catalog/origin-query/origin-query-executor.js +33 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +71 -0
- package/queries/catalog/origin-query/origin-query-format.js +27 -0
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -2
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.js +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +2 -2
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -4
- package/queries/query.d.ts +61 -2
- package/queries/query.js +3 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +3 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +26 -8
- package/r-bridge/retriever.js +1 -1
- package/search/search-executor/search-generators.d.ts +1 -1
- package/search/search-executor/search-transformer.d.ts +1 -1
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/static/slice-call.js +13 -3
- package/statistics/features/supported/assignments/post-process.js +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -2
- package/statistics/features/supported/used-functions/post-process.js +1 -1
- package/statistics/features/supported/used-packages/post-process.js +2 -2
- package/statistics/features/supported/values/post-process.js +2 -2
- package/statistics/output/print-stats.js +2 -2
- package/statistics/summarizer/post-process/clusterer.d.ts +1 -1
- package/statistics/summarizer/post-process/clusterer.js +1 -1
- package/statistics/summarizer/post-process/histogram.js +3 -3
- package/statistics/summarizer/post-process/post-process-output.js +3 -3
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +2 -2
- package/util/assert.js +36 -1
- package/util/cfg/cfg.d.ts +0 -80
- package/util/cfg/cfg.js +0 -549
- package/util/{arrays.d.ts → collections/arrays.d.ts} +1 -1
- package/util/{arrays.js → collections/arrays.js} +3 -3
- package/util/collections/set.js +17 -0
- package/util/diff-graph.d.ts +47 -0
- package/util/diff-graph.js +61 -0
- package/util/diff.d.ts +6 -6
- package/util/diff.js +1 -1
- package/util/mermaid/cfg.d.ts +9 -2
- package/util/mermaid/cfg.js +64 -12
- package/util/mermaid/dfg.d.ts +2 -1
- package/util/mermaid/dfg.js +26 -10
- package/util/mermaid/mermaid.d.ts +2 -0
- package/util/mermaid/mermaid.js +6 -0
- package/util/quads.js +1 -1
- package/util/schema.d.ts +1 -1
- package/util/schema.js +1 -1
- package/util/summarizer.js +1 -1
- package/util/{text.js → text/text.js} +1 -1
- package/util/{time.js → text/time.js} +1 -1
- package/util/version.js +1 -1
- package/dataflow/graph/diff.d.ts +0 -36
- package/util/cfg/happens-before.d.ts +0 -7
- package/util/cfg/visitor.d.ts +0 -9
- package/util/cfg/visitor.js +0 -30
- package/util/set.js +0 -31
- /package/util/{bimap.d.ts → collections/bimap.d.ts} +0 -0
- /package/util/{bimap.js → collections/bimap.js} +0 -0
- /package/util/{defaultmap.d.ts → collections/defaultmap.d.ts} +0 -0
- /package/util/{defaultmap.js → collections/defaultmap.js} +0 -0
- /package/util/{set.d.ts → collections/set.d.ts} +0 -0
- /package/util/{ansi.d.ts → text/ansi.d.ts} +0 -0
- /package/util/{ansi.js → text/ansi.js} +0 -0
- /package/util/{args.d.ts → text/args.d.ts} +0 -0
- /package/util/{args.js → text/args.js} +0 -0
- /package/util/{strings.d.ts → text/strings.d.ts} +0 -0
- /package/util/{strings.js → text/strings.js} +0 -0
- /package/util/{text.d.ts → text/text.d.ts} +0 -0
- /package/util/{time.d.ts → text/time.d.ts} +0 -0
|
@@ -22,32 +22,34 @@ function getText() {
|
|
|
22
22
|
For the latest code coverage information, see [codecov.io](${doc_files_1.FlowrCodecovRef}),
|
|
23
23
|
for the latest benchmark results, see the [benchmark results](${doc_files_1.FlowrSiteBaseRef}/wiki/stats/benchmark) wiki page.
|
|
24
24
|
|
|
25
|
-
- [Testing Suites](#testing-suites)
|
|
26
|
-
- [Functionality Tests](#functionality-tests)
|
|
27
|
-
- [Test Structure](#test-structure)
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [Testing Within Your IDE](#testing-within-your-ide)
|
|
25
|
+
- [🏨 Testing Suites](#testing-suites)
|
|
26
|
+
- [🧪 Functionality Tests](#functionality-tests)
|
|
27
|
+
- [🏗️ Test Structure](#test-structure)
|
|
28
|
+
- [🏷️ Test Labels](#test-labels)
|
|
29
|
+
- [🖋️ Writing a Test](#writing-a-test)
|
|
30
|
+
- [🤏 Running Only Some Tests](#running-only-some-tests)
|
|
31
|
+
- [💽 System Tests](#system-tests)
|
|
32
|
+
- [💃 Performance Tests](#performance-tests)
|
|
33
|
+
- [📝 Testing Within Your IDE](#testing-within-your-ide)
|
|
34
34
|
- [VS Code](#vs-code)
|
|
35
35
|
- [Webstorm](#webstorm)
|
|
36
|
-
- [CI Pipeline](#ci-pipeline)
|
|
37
|
-
- [Linting](#linting)
|
|
36
|
+
- [🪈 CI Pipeline](#ci-pipeline)
|
|
37
|
+
- [🧹 Linting](#linting)
|
|
38
38
|
- [Oh no, the linter fails](#oh-no-the-linter-fails)
|
|
39
39
|
- [License Checker](#license-checker)
|
|
40
|
-
- [Debugging](#debugging)
|
|
40
|
+
- [🐛 Debugging](#debugging)
|
|
41
41
|
- [VS Code](#vs-code-1)
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
<a id='testing-suites'></a>
|
|
44
|
+
## 🏨 Testing Suites
|
|
44
45
|
|
|
45
46
|
Currently, flowR contains three testing suites: one for [functionality](#functionality-tests),
|
|
46
47
|
one for [system tests](#system-tests), and one for [performance](#performance-tests). We explain each of them in the following.
|
|
47
48
|
In addition to running those tests, you can use the more generalized \`npm run checkup\`.
|
|
48
49
|
This command includes the construction of the docker image, the generation of the wiki pages, and the linter.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
<a id='functionality-tests'></a>
|
|
52
|
+
### 🧪 Functionality Tests
|
|
51
53
|
|
|
52
54
|
The functionality tests represent conventional unit (and depending on your terminology component/api) tests.
|
|
53
55
|
We use [vitest](https://vitest.dev/) as our testing framework.
|
|
@@ -75,7 +77,8 @@ some tests may be skipped automatically as they do not apply to your current sys
|
|
|
75
77
|
Each test can specify such requirements as part of the \`TestConfiguration\`, which is then used in the \`test.skipIf\` function of _vitest_.
|
|
76
78
|
It is up to the [ci](#ci-pipeline) to run the tests on different systems to ensure that those tests run.
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
<a id='test-structure'></a>
|
|
81
|
+
#### 🏗️ Test Structure
|
|
79
82
|
|
|
80
83
|
All functionality tests are to be located under [test/functionality](${doc_files_1.RemoteFlowrFilePathBaseRef}/test/functionality).
|
|
81
84
|
|
|
@@ -94,15 +97,24 @@ to disable parallel execution for the respective test (otherwise, such tests are
|
|
|
94
97
|
`
|
|
95
98
|
})}
|
|
96
99
|
|
|
97
|
-
|
|
100
|
+
<a id='test-labels'></a>
|
|
101
|
+
#### 🏷️ Test Labels
|
|
98
102
|
|
|
99
|
-
|
|
100
|
-
and it is probably best to have a look at existing tests in that area to get an idea of what comfort functionality is available.
|
|
103
|
+
Generally, tests are [labeled](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper/label.ts) according to the *flowR* capabilities they test.
|
|
101
104
|
|
|
102
|
-
Generally, tests should be [labeled](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper/label.ts) according to the *flowR* capabilities they test.
|
|
103
105
|
The set of currently supported capabilities and their IDs can be found in ${(0, doc_files_1.getFilePathMd)('../r-bridge/data/data.ts')}.
|
|
106
|
+
|
|
104
107
|
The resulting labels are used in the test report that is generated as part of the test output.
|
|
105
108
|
They group tests by the capabilities they test and allow the report to display how many tests ensure that any given capability is properly supported.
|
|
109
|
+
The report can be found on the wiki's [capabilities page](${doc_files_1.FlowrWikiBaseRef}/Capabilities).
|
|
110
|
+
|
|
111
|
+
To add new labels, simply add them to the relevant section in ${(0, doc_files_1.getFilePathMd)('../r-bridge/data/data.ts')} as part of a pull request.
|
|
112
|
+
|
|
113
|
+
<a id='writing-a-test'></a>
|
|
114
|
+
#### 🖋️ Writing a Test
|
|
115
|
+
|
|
116
|
+
Currently, this is heavily dependent on what you want to test (normalization, dataflow, quad-export, …)
|
|
117
|
+
and it is probably best to have a look at existing tests in that area to get an idea of what comfort functionality is available.
|
|
106
118
|
|
|
107
119
|
Various helper functions are available to ease in writing tests with common behaviors, like testing for dataflow, slicing or query results.
|
|
108
120
|
These can be found in [the \`_helper\` subdirectory](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper).
|
|
@@ -136,12 +148,14 @@ assertDataflow(label('without distractors', [...OperatorDatabase['<-'].capabilit
|
|
|
136
148
|
);
|
|
137
149
|
`)}
|
|
138
150
|
|
|
139
|
-
|
|
151
|
+
<a id='running-only-some-tests'></a>
|
|
152
|
+
#### 🤏 Running Only Some Tests
|
|
140
153
|
|
|
141
154
|
To run only some tests, vitest allows you to [filter](https://vitest.dev/guide/filtering.html) tests.
|
|
142
155
|
Besides, you can use the watch mode (with \`npm run test\`) to only run tests that are affected by your changes.
|
|
143
156
|
|
|
144
|
-
|
|
157
|
+
<a id='system-tests'></a>
|
|
158
|
+
### 💽 System Tests
|
|
145
159
|
|
|
146
160
|
In contrast to the [functionality tests](#functionality-tests), the system tests use runners like the \`npm\` scripts
|
|
147
161
|
to test the behavior of the whole system, for example, by running the CLI or the server.
|
|
@@ -154,9 +168,8 @@ with the [functionality tests](#functionality-tests)).
|
|
|
154
168
|
|
|
155
169
|
Have a look at the [test/system-tests](${doc_files_1.RemoteFlowrFilePathBaseRef}test/system-tests) folder for more information.
|
|
156
170
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### Performance Tests
|
|
171
|
+
<a id='performance-tests'></a>
|
|
172
|
+
### 💃 Performance Tests
|
|
160
173
|
|
|
161
174
|
The performance test suite of *flowR* uses several suites to check for variations in the required times for certain steps.
|
|
162
175
|
Although we measure wall time in the CI (which is subject to rather large variations), it should give a rough idea *flowR*'s performance.
|
|
@@ -167,8 +180,8 @@ ${(0, doc_code_1.codeBlock)('shell', 'npm run performance-test')}
|
|
|
167
180
|
|
|
168
181
|
See [test/performance](${doc_files_1.RemoteFlowrFilePathBaseRef}test/performance) for more information on the suites, how to run them, and their results. If you are interested in the results of the benchmarks, see [here](${doc_files_1.FlowrSiteBaseRef}/wiki/stats/benchmark).
|
|
169
182
|
|
|
170
|
-
|
|
171
|
-
### Testing Within Your IDE
|
|
183
|
+
<a id='testing-within-your-ide'></a>
|
|
184
|
+
### 📝 Testing Within Your IDE
|
|
172
185
|
|
|
173
186
|
#### VS Code
|
|
174
187
|
|
|
@@ -188,8 +201,8 @@ To get started, install the [vitest Extension](https://marketplace.visualstudio.
|
|
|
188
201
|
|
|
189
202
|
Please follow the official guide [here](https://www.jetbrains.com/help/webstorm/vitest.html).
|
|
190
203
|
|
|
191
|
-
|
|
192
|
-
## CI Pipeline
|
|
204
|
+
<a id='ci-pipeline'></a>
|
|
205
|
+
## 🪈 CI Pipeline
|
|
193
206
|
|
|
194
207
|
We have several workflows defined in [.github/workflows](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/).
|
|
195
208
|
We explain the most important workflows in the following:
|
|
@@ -203,8 +216,9 @@ We explain the most important workflows in the following:
|
|
|
203
216
|
- deploying the documentation to [GitHub Pages](${doc_files_1.FlowrSiteBaseRef}/doc/)
|
|
204
217
|
- [release.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/release.yaml) is responsible for creating a new release, only to be run by repository owners. Furthermore, it adds the new docker image to [docker hub](${doc_files_1.FlowrDockerRef}).
|
|
205
218
|
- [broken-links-and-wiki.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/broken-links-and-wiki.yaml) repeatedly tests that all links are not dead!
|
|
206
|
-
|
|
207
|
-
|
|
219
|
+
|
|
220
|
+
<a id='linting'></a>
|
|
221
|
+
## 🧹 Linting
|
|
208
222
|
|
|
209
223
|
There are two linting scripts.
|
|
210
224
|
The main one:
|
|
@@ -222,21 +236,23 @@ eslint can automatically fix several linting problems[](https://eslint.org/docs/
|
|
|
222
236
|
So you may be fine by just running:
|
|
223
237
|
|
|
224
238
|
${(0, doc_code_1.codeBlock)('shell', 'npm run lint-local -- --fix')}
|
|
225
|
-
|
|
226
|
-
|
|
239
|
+
|
|
240
|
+
<a id='oh-no-the-linter-fails'></a>
|
|
241
|
+
### 💥 Oh no, the linter fails
|
|
227
242
|
|
|
228
243
|
By now, the rules should be rather stable and so, if the linter fails,
|
|
229
244
|
it is usually best if you (when necessary) read the respective description and fix the respective problem.
|
|
230
245
|
Rules in this project cover general JavaScript issues [using regular ESLint](https://eslint.org/docs/latest/rules), TypeScript-specific issues [using typescript-eslint](https://typescript-eslint.io/rules/), and code formatting [with ESLint Stylistic](https://eslint.style/packages/default#rules).
|
|
231
246
|
|
|
232
247
|
However, in case you think that the linter is wrong, please do not hesitate to open a [new issue](${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose).
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
|
|
249
|
+
<a id='license-checker'></a>
|
|
250
|
+
### 🪪 License Checker
|
|
235
251
|
|
|
236
252
|
*flowR* is licensed under the [GPLv3 License](${doc_files_1.FlowrGithubBaseRef}/flowr/blob/main/LICENSE) requiring us to only rely on [compatible licenses](https://www.gnu.org/licenses/license-list.en.html). For now, this list is hardcoded as part of the npm [\`license-compat\`](${doc_files_1.RemoteFlowrFilePathBaseRef}/package.json) script so it can very well be that a new dependency you add causes the checker to fail — *even though it is compatible*. In that case, please either open a [new issue](${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose) or directly add the license to the list (including a reference to why it is compatible).
|
|
237
253
|
|
|
238
|
-
|
|
239
|
-
## Debugging
|
|
254
|
+
<a id='debugging'></a>
|
|
255
|
+
## 🐛 Debugging
|
|
240
256
|
### VS Code
|
|
241
257
|
When working with VS Code, you can attach a debugger to the REPL. This works automatically by running the \`Start Debugging\` command (\`F5\` by default).
|
|
242
258
|
You can also set the \`Auto Attach Filter\` setting to automatically attach the debugger, when running \`npm run flowr\`.
|
|
@@ -12,7 +12,7 @@ const doc_types_1 = require("./doc-util/doc-types");
|
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
13
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
14
14
|
const doc_cli_option_1 = require("./doc-util/doc-cli-option");
|
|
15
|
-
const time_1 = require("../util/time");
|
|
15
|
+
const time_1 = require("../util/text/time");
|
|
16
16
|
const doc_structure_1 = require("./doc-util/doc-structure");
|
|
17
17
|
const pipeline_executor_1 = require("../core/pipeline-executor");
|
|
18
18
|
const retriever_1 = require("../r-bridge/retriever");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const log_1 = require("../../test/functionality/_helper/log");
|
|
4
|
+
const doc_files_1 = require("./doc-util/doc-files");
|
|
5
|
+
const doc_code_1 = require("./doc-util/doc-code");
|
|
6
|
+
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
|
|
7
|
+
function print() {
|
|
8
|
+
return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'developer onboarding process' })}
|
|
9
|
+
|
|
10
|
+
To get started developing on *flowR*, we recommend carefully reading the following pages:
|
|
11
|
+
- 💻 [Setting up the *flowR* development environment](${doc_files_1.FlowrWikiBaseRef}/Setup#%EF%B8%8F-building-from-scratch).\
|
|
12
|
+
This page explains how to install **R** and **Node.js**.
|
|
13
|
+
- 💖 [Contributing guidelines](${doc_files_1.FlowrGithubBaseRef}/flowr/tree/main/.github/CONTRIBUTING.md).\
|
|
14
|
+
This page also includes information about how to set up **git-lfs** and several **git hooks**.
|
|
15
|
+
|
|
16
|
+
## ⌛ TL;DR
|
|
17
|
+
|
|
18
|
+
The most important steps to get the *flowR* development environment set up (after installing **R** and **Node.js**) can be seen below. For convenience, they can be executed all at once using the following command:
|
|
19
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run setup:dev')}
|
|
20
|
+
|
|
21
|
+
If you want to execute the steps manually, please follow the instructions below:
|
|
22
|
+
|
|
23
|
+
${(0, doc_code_1.codeBlock)('shell', `
|
|
24
|
+
# Installing git-lfs for your current user (if you haven't already)
|
|
25
|
+
git lfs install
|
|
26
|
+
# Cloning the repository
|
|
27
|
+
git clone https://github.com/flowr-analysis/flowr.git
|
|
28
|
+
# Installing dependencies
|
|
29
|
+
npm ci
|
|
30
|
+
# Configuring git hooks
|
|
31
|
+
git config --local core.hooksPath .githooks/
|
|
32
|
+
# Test if the git hooks are working correctly
|
|
33
|
+
# Running this command should lint the code
|
|
34
|
+
git push --dry-run
|
|
35
|
+
`)}
|
|
36
|
+
`.trim();
|
|
37
|
+
}
|
|
38
|
+
if (require.main === module) {
|
|
39
|
+
(0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
|
|
40
|
+
console.log(print());
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=print-onboarding-wiki.js.map
|
|
@@ -10,7 +10,7 @@ const query_1 = require("../queries/query");
|
|
|
10
10
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
11
11
|
const doc_query_1 = require("./doc-util/doc-query");
|
|
12
12
|
const schema_1 = require("../util/schema");
|
|
13
|
-
const ansi_1 = require("../util/ansi");
|
|
13
|
+
const ansi_1 = require("../util/text/ansi");
|
|
14
14
|
const call_context_query_executor_1 = require("../queries/catalog/call-context-query/call-context-query-executor");
|
|
15
15
|
const compound_query_1 = require("../queries/virtual-query/compound-query");
|
|
16
16
|
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
|
|
@@ -238,6 +238,26 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
238
238
|
`;
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
|
+
(0, doc_query_1.registerQueryDocumentation)('origin', {
|
|
242
|
+
name: 'Origin Query',
|
|
243
|
+
type: 'active',
|
|
244
|
+
shortDescription: 'Retrieve the origin of a variable, function call, ...',
|
|
245
|
+
functionName: search_query_executor_1.executeSearch.name,
|
|
246
|
+
functionFile: '../queries/catalog/origin-query/origin-query-executor.ts',
|
|
247
|
+
buildExplanation: async (shell) => {
|
|
248
|
+
const exampleCode = 'x <- 1\nprint(x)';
|
|
249
|
+
return `
|
|
250
|
+
With this query you can use flowR's origin tracking to find out the read origins of a variable,
|
|
251
|
+
the functions called by a call, and more.
|
|
252
|
+
|
|
253
|
+
Using the example code \`${exampleCode}\` (with the \`print(x)\` in the second line), the following query returns the origins of \`x\` in the code:
|
|
254
|
+
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
255
|
+
type: 'origin',
|
|
256
|
+
criterion: '2@x'
|
|
257
|
+
}], { showCode: true })}
|
|
258
|
+
`;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
241
261
|
(0, doc_query_1.registerQueryDocumentation)('search', {
|
|
242
262
|
name: 'Search Query',
|
|
243
263
|
type: 'active',
|
|
@@ -23,9 +23,12 @@ async function getText(shell) {
|
|
|
23
23
|
[](${doc_files_1.FlowrDockerRef})
|
|
24
24
|
[](${doc_files_1.FlowrGithubBaseRef}/flowr/releases/latest)
|
|
25
25
|
[](${doc_files_1.FlowrVsCode})
|
|
26
|
+
[](${doc_files_1.FlowrPositron})
|
|
26
27
|
[](https://zenodo.org/doi/10.5281/zenodo.13319290)
|
|
27
28
|
|
|
28
|
-
_flowR_ is a sophisticated, static [dataflow analyzer](https://en.wikipedia.org/wiki/Data-flow_analysis) for the [R programming language](https://www.r-project.org/)
|
|
29
|
+
_flowR_ is a sophisticated, static [dataflow analyzer](https://en.wikipedia.org/wiki/Data-flow_analysis) for the [R programming language](https://www.r-project.org/),
|
|
30
|
+
available for [VSCode](${doc_files_1.FlowrVsCode}), [Positron](${doc_files_1.FlowrPositron}), [RStudio](${doc_files_1.FlowrGithubBaseRef}/rstudio-addin-flowr),
|
|
31
|
+
and [Docker](${doc_files_1.FlowrDockerRef}).
|
|
29
32
|
It offers a wide variety of features, for example:
|
|
30
33
|
|
|
31
34
|
* 🍕 **program slicing**\\
|
|
@@ -90,12 +93,16 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(shell, (0, doc_files_1.getFileContent
|
|
|
90
93
|
|
|
91
94
|
If you want to use flowR and the features it provides, feel free to check out the:
|
|
92
95
|
|
|
93
|
-
- [Visual Studio Code
|
|
96
|
+
- [Visual Studio Code](${doc_files_1.FlowrVsCode})/[Positron](${doc_files_1.FlowrPositron}): provides access to flowR directly in VS Code and Positron (or [vscode.dev](https://vscode.dev/))
|
|
94
97
|
- [RStudio Addin](${doc_files_1.FlowrGithubBaseRef}/rstudio-addin-flowr): integrates flowR into [RStudio](https://posit.co/downloads/)
|
|
95
98
|
- [R package](${doc_files_1.FlowrGithubBaseRef}/flowr-r-adapter): use flowR in your R scripts
|
|
96
99
|
- [Docker image](${doc_files_1.FlowrDockerRef}): run flowR in a container, this also includes [flowR's server](${doc_files_1.FlowrWikiBaseRef}/Interface#communicating-with-the-server)
|
|
97
100
|
- [NPM package](${doc_files_1.FlowrNpmRef}): include flowR in your TypeScript and JavaScript projects
|
|
98
101
|
|
|
102
|
+
|
|
103
|
+
If you are already using flowR and want to give feedback, please consider filling out our [feedback form](https://docs.google.com/forms/d/e/1FAIpQLScKFhgnh9LGVU7QzqLvFwZe1oiv_5jNhkIO-G-zND0ppqsMxQ/viewform).
|
|
104
|
+
|
|
105
|
+
|
|
99
106
|
## ⭐ Getting Started
|
|
100
107
|
|
|
101
108
|
To get started with _flowR_ and its features, please check out the [Overview](${doc_files_1.FlowrGithubBaseRef}/flowr/wiki/Overview) wiki page.
|
|
@@ -121,7 +128,7 @@ as well as the deployed [code documentation](https://flowr-analysis.github.io/fl
|
|
|
121
128
|
|
|
122
129
|
## 🚀 Contributing
|
|
123
130
|
|
|
124
|
-
We welcome every contribution! Please check out the [
|
|
131
|
+
We welcome every contribution! Please check out the [developer onboarding](${doc_files_1.FlowrWikiBaseRef}/Onboarding) section in the wiki for all the information you will need.
|
|
125
132
|
|
|
126
133
|
### Contributors
|
|
127
134
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagleoutice/flowr",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
4
4
|
"description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"url": "https://github.com/flowr-analysis/flowr/issues"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
+
"setup:dev": "git lfs fetch && npm ci && git config --local core.hooksPath .githooks/ && git push --dry-run",
|
|
15
16
|
"main": "npm run build:bundle-flowr && node dist/src/cli/flowr.min.js",
|
|
16
17
|
"flowr": "npm run main --",
|
|
17
18
|
"main-dev": "ts-node src/cli/flowr.ts",
|
|
@@ -33,13 +34,14 @@
|
|
|
33
34
|
"wiki:search-api": "ts-node src/documentation/print-search-wiki.ts",
|
|
34
35
|
"wiki:linting-and-testing": "ts-node src/documentation/print-linting-and-testing-wiki.ts",
|
|
35
36
|
"wiki:interface": "ts-node src/documentation/print-interface-wiki.ts",
|
|
37
|
+
"wiki:onboarding": "ts-node src/documentation/print-onboarding-wiki.ts",
|
|
38
|
+
"wiki:faq": "ts-node src/documentation/print-faq-wiki.ts",
|
|
36
39
|
"wiki:cfg": "ts-node src/documentation/print-cfg-wiki.ts",
|
|
37
40
|
"gen:readme": "ts-node src/documentation/print-readme.ts",
|
|
38
41
|
"build": "tsc --project .",
|
|
39
42
|
"build-dev": "npm run build && npm run build:copy-wasm",
|
|
40
|
-
"build:bundle-flowr": "npm run build && esbuild --bundle dist/src/cli/flowr.js --platform=node --tree-shaking=true --bundle --minify --external:clipboardy --target=node22 --outfile=dist/src/cli/flowr.min.js && npm run build:copy-wasm
|
|
41
|
-
"build:copy-wasm": "mkdir -p dist/
|
|
42
|
-
"build:copy-wasm-min": "mkdir -p dist/src/cli && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/cli",
|
|
43
|
+
"build:bundle-flowr": "npm run build && esbuild --bundle dist/src/cli/flowr.js --platform=node --tree-shaking=true --bundle --minify --external:clipboardy --target=node22 --outfile=dist/src/cli/flowr.min.js && npm run build:copy-wasm",
|
|
44
|
+
"build:copy-wasm": "mkdir -p dist/node_modules/@eagleoutice/tree-sitter-r/ && mkdir -p dist/node_modules/web-tree-sitter && cp node_modules/@eagleoutice/tree-sitter-r/tree-sitter-r.wasm dist/node_modules/@eagleoutice/tree-sitter-r/ && cp node_modules/web-tree-sitter/tree-sitter.wasm dist/node_modules/web-tree-sitter/",
|
|
43
45
|
"lint-local": "npx eslint --version && npx eslint src/ test/ --rule \"no-warning-comments: off\"",
|
|
44
46
|
"lint": "npm run license-compat -- --summary && npx eslint --version && npx eslint src/ test/",
|
|
45
47
|
"license-compat": "license-checker --onlyAllow 'MIT;MIT OR X11;GPLv2;LGPL;GNUGPL;ISC;Apache-2.0;FreeBSD;BSD-2-Clause;clearbsd;ModifiedBSD;BSD-3-Clause;Python-2.0;Unlicense;WTFPL;BlueOak-1.0.0;CC-BY-4.0;CC-BY-3.0;CC0-1.0;0BSD'",
|
|
@@ -175,7 +177,7 @@
|
|
|
175
177
|
"@eagleoutice/eslint-config-flowr": "^1.0.17",
|
|
176
178
|
"@eslint/eslintrc": "^3.2.0",
|
|
177
179
|
"@eslint/js": "^9.20.0",
|
|
178
|
-
"@j-ulrich/release-it-regex-bumper": "^5.
|
|
180
|
+
"@j-ulrich/release-it-regex-bumper": "^5.3.0",
|
|
179
181
|
"@types/command-line-args": "^5.2.3",
|
|
180
182
|
"@types/command-line-usage": "^5.0.4",
|
|
181
183
|
"@types/n-readlines": "^1.0.6",
|
|
@@ -190,7 +192,7 @@
|
|
|
190
192
|
"eslint": "^9.20.1",
|
|
191
193
|
"license-checker": "^25.0.1",
|
|
192
194
|
"npm-run-all": "^4.1.5",
|
|
193
|
-
"release-it": "^
|
|
195
|
+
"release-it": "^19.0.2",
|
|
194
196
|
"ts-node": "^10.9.2",
|
|
195
197
|
"typedoc": "^0.27.7",
|
|
196
198
|
"typedoc-plugin-missing-exports": "^3.1.0",
|
|
@@ -200,6 +202,7 @@
|
|
|
200
202
|
"vitest": "^3.0.6"
|
|
201
203
|
},
|
|
202
204
|
"dependencies": {
|
|
205
|
+
"@eagleoutice/tree-sitter-r": "^1.1.2",
|
|
203
206
|
"@xmldom/xmldom": "^0.9.7",
|
|
204
207
|
"clipboardy": "^4.0.0",
|
|
205
208
|
"command-line-args": "^6.0.1",
|
|
@@ -4,7 +4,7 @@ exports.executeCallContextQueries = executeCallContextQueries;
|
|
|
4
4
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
5
5
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
6
6
|
const edge_1 = require("../../../dataflow/graph/edge");
|
|
7
|
-
const
|
|
7
|
+
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
8
8
|
const two_layer_collector_1 = require("../../two-layer-collector");
|
|
9
9
|
const objects_1 = require("../../../util/objects");
|
|
10
10
|
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
@@ -85,7 +85,7 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
85
85
|
const aliases = new Map();
|
|
86
86
|
const visited = new Set();
|
|
87
87
|
/* we store the current call name */
|
|
88
|
-
|
|
88
|
+
let queue = [[(0, node_id_1.recoverContent)(nodeId, graph) ?? '', nodeId]];
|
|
89
89
|
while (queue.length > 0) {
|
|
90
90
|
const [str, id] = queue.shift();
|
|
91
91
|
if (visited.has(id)) {
|
|
@@ -111,7 +111,7 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
111
111
|
.filter(([, { types }]) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall))
|
|
112
112
|
.map(([t]) => [(0, node_id_1.recoverContent)(t, graph) ?? '', t]);
|
|
113
113
|
/** only follow defined-by and reads */
|
|
114
|
-
queue.
|
|
114
|
+
queue = queue.concat(x);
|
|
115
115
|
continue;
|
|
116
116
|
}
|
|
117
117
|
let track = edge_1.EdgeType.Calls | edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall;
|
|
@@ -180,7 +180,7 @@ function executeCallContextQueries({ dataflow: { graph }, ast }, queries) {
|
|
|
180
180
|
const { promotedQueries, requiresCfg } = promoteQueryCallNames(queries);
|
|
181
181
|
let cfg = undefined;
|
|
182
182
|
if (requiresCfg) {
|
|
183
|
-
cfg = (0,
|
|
183
|
+
cfg = (0, extract_cfg_1.extractCFG)(ast, graph, []);
|
|
184
184
|
}
|
|
185
185
|
const queriesWhichWantAliases = promotedQueries.filter(q => q.includeAliases);
|
|
186
186
|
for (const [nodeId, info] of graph.vertices(true)) {
|
|
@@ -203,7 +203,7 @@ function executeCallContextQueries({ dataflow: { graph }, ast }, queries) {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
for (const query of promotedQueries.filter(q => q.callName.test(info.name))) {
|
|
206
|
+
for (const query of promotedQueries.filter(q => !q.includeAliases && q.callName.test(info.name))) {
|
|
207
207
|
const file = ast.idMap.get(nodeId)?.info.file;
|
|
208
208
|
if (!doesFilepathMatch(file, query.fileFilter)) {
|
|
209
209
|
continue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import { executeCallContextQueries } from './call-context-query-executor';
|
|
4
|
-
import type { OutputFormatter } from '../../../util/ansi';
|
|
4
|
+
import type { OutputFormatter } from '../../../util/text/ansi';
|
|
5
5
|
import Joi from 'joi';
|
|
6
6
|
import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
|
|
7
7
|
import type { DEFAULT_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CallContextQueryDefinition = void 0;
|
|
7
7
|
const call_context_query_executor_1 = require("./call-context-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
-
import type { ControlFlowGraph } from '../../../util/cfg/cfg';
|
|
3
2
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
4
3
|
import type { DataflowGraphVertexFunctionCall } from '../../../dataflow/graph/vertex';
|
|
5
4
|
import { RType } from '../../../r-bridge/lang-4.x/ast/model/type';
|
|
6
5
|
import type { RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
7
6
|
import type { LinkTo } from './call-context-query-format';
|
|
7
|
+
import type { ControlFlowGraph } from '../../../control-flow/control-flow-graph';
|
|
8
8
|
export declare enum CallTargets {
|
|
9
|
-
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
9
|
+
/** call targets a function that is not defined locally in the script (e.g., the call targets a library function) */
|
|
10
10
|
OnlyGlobal = "global",
|
|
11
11
|
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
12
12
|
MustIncludeGlobal = "must-include-global",
|
|
@@ -5,7 +5,7 @@ exports.satisfiesCallTargets = satisfiesCallTargets;
|
|
|
5
5
|
exports.getValueOfArgument = getValueOfArgument;
|
|
6
6
|
exports.identifyLinkToLastCallRelation = identifyLinkToLastCallRelation;
|
|
7
7
|
const graph_1 = require("../../../dataflow/graph/graph");
|
|
8
|
-
const
|
|
8
|
+
const simple_visitor_1 = require("../../../control-flow/simple-visitor");
|
|
9
9
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
10
10
|
const edge_1 = require("../../../dataflow/graph/edge");
|
|
11
11
|
const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
|
|
@@ -17,7 +17,7 @@ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-
|
|
|
17
17
|
const cascade_action_1 = require("./cascade-action");
|
|
18
18
|
var CallTargets;
|
|
19
19
|
(function (CallTargets) {
|
|
20
|
-
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
20
|
+
/** call targets a function that is not defined locally in the script (e.g., the call targets a library function) */
|
|
21
21
|
CallTargets["OnlyGlobal"] = "global";
|
|
22
22
|
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
23
23
|
CallTargets["MustIncludeGlobal"] = "must-include-global";
|
|
@@ -29,16 +29,19 @@ var CallTargets;
|
|
|
29
29
|
CallTargets["Any"] = "any";
|
|
30
30
|
})(CallTargets || (exports.CallTargets = CallTargets = {}));
|
|
31
31
|
function satisfiesCallTargets(id, graph, callTarget) {
|
|
32
|
-
const callVertex = graph.
|
|
33
|
-
if (callVertex === undefined || callVertex
|
|
32
|
+
const callVertex = graph.getVertex(id, true);
|
|
33
|
+
if (callVertex === undefined || callVertex.tag !== vertex_1.VertexType.FunctionCall) {
|
|
34
|
+
return 'no';
|
|
35
|
+
}
|
|
36
|
+
const outgoing = graph.outgoingEdges(id);
|
|
37
|
+
if (outgoing === undefined) {
|
|
34
38
|
return 'no';
|
|
35
39
|
}
|
|
36
|
-
const [info, outgoing] = callVertex;
|
|
37
40
|
const callTargets = [...outgoing]
|
|
38
|
-
.filter(([,
|
|
41
|
+
.filter(([, { types }]) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.Calls))
|
|
39
42
|
.map(([t]) => t);
|
|
40
43
|
let builtIn = false;
|
|
41
|
-
if (
|
|
44
|
+
if (callVertex.environment === undefined) {
|
|
42
45
|
/* if we have a call with an unbound environment,
|
|
43
46
|
* this only happens if we are sure of built-in relations and want to save references
|
|
44
47
|
*/
|
|
@@ -49,8 +52,8 @@ function satisfiesCallTargets(id, graph, callTarget) {
|
|
|
49
52
|
* for performance and scoping reasons, flowR will not identify the global linkage,
|
|
50
53
|
* including any potential built-in mapping.
|
|
51
54
|
*/
|
|
52
|
-
const reResolved = (0, resolve_by_name_1.resolveByName)(
|
|
53
|
-
if (reResolved?.some(t =>
|
|
55
|
+
const reResolved = (0, resolve_by_name_1.resolveByName)(callVertex.name, callVertex.environment, identifier_1.ReferenceType.Unknown);
|
|
56
|
+
if (reResolved?.some(t => (0, built_in_1.isBuiltIn)(t.definedAt))) {
|
|
54
57
|
builtIn = true;
|
|
55
58
|
}
|
|
56
59
|
}
|
|
@@ -58,19 +61,19 @@ function satisfiesCallTargets(id, graph, callTarget) {
|
|
|
58
61
|
case CallTargets.Any:
|
|
59
62
|
return callTargets;
|
|
60
63
|
case CallTargets.OnlyGlobal:
|
|
61
|
-
if (callTargets.
|
|
62
|
-
return builtIn ? [
|
|
64
|
+
if (callTargets.every(built_in_1.isBuiltIn)) {
|
|
65
|
+
return builtIn ? ['built-in'] : [];
|
|
63
66
|
}
|
|
64
67
|
else {
|
|
65
68
|
return 'no';
|
|
66
69
|
}
|
|
67
70
|
case CallTargets.MustIncludeGlobal:
|
|
68
|
-
return builtIn || callTargets.length === 0 ? [...callTargets,
|
|
71
|
+
return builtIn || callTargets.length === 0 ? [...callTargets, 'built-in'] : 'no';
|
|
69
72
|
case CallTargets.OnlyLocal:
|
|
70
73
|
return !builtIn && callTargets.length > 0 ? callTargets : 'no';
|
|
71
74
|
case CallTargets.MustIncludeLocal:
|
|
72
75
|
if (callTargets.length > 0) {
|
|
73
|
-
return builtIn ? [...callTargets,
|
|
76
|
+
return builtIn ? [...callTargets, 'built-in'] : callTargets;
|
|
74
77
|
}
|
|
75
78
|
else {
|
|
76
79
|
return 'no';
|
|
@@ -105,25 +108,25 @@ function getValueOfArgument(graph, call, argument, additionalAllowedTypes) {
|
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
function identifyLinkToLastCallRelation(from, cfg, graph, { callName, ignoreIf, cascadeIf }) {
|
|
108
|
-
const found = [];
|
|
109
111
|
if (ignoreIf && ignoreIf(from, graph)) {
|
|
110
|
-
return
|
|
112
|
+
return [];
|
|
111
113
|
}
|
|
112
|
-
|
|
114
|
+
const found = [];
|
|
115
|
+
(0, simple_visitor_1.visitCfgInReverseOrder)(cfg, [from], node => {
|
|
113
116
|
/* we ignore the start id as it cannot be the last call */
|
|
114
117
|
if (node === from) {
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
117
|
-
const vertex = graph.
|
|
118
|
-
if (vertex === undefined || vertex
|
|
120
|
+
const vertex = graph.getVertex(node, true);
|
|
121
|
+
if (vertex === undefined || vertex.tag !== vertex_1.VertexType.FunctionCall) {
|
|
119
122
|
return;
|
|
120
123
|
}
|
|
121
|
-
if (callName.test(vertex
|
|
122
|
-
const act = cascadeIf ? cascadeIf(vertex
|
|
124
|
+
if (callName.test(vertex.name)) {
|
|
125
|
+
const act = cascadeIf ? cascadeIf(vertex, from, graph) : cascade_action_1.CascadeAction.Stop;
|
|
123
126
|
if (act === cascade_action_1.CascadeAction.Skip) {
|
|
124
127
|
return;
|
|
125
128
|
}
|
|
126
|
-
const tar = satisfiesCallTargets(vertex
|
|
129
|
+
const tar = satisfiesCallTargets(vertex.id, graph, CallTargets.MustIncludeGlobal);
|
|
127
130
|
if (tar === 'no') {
|
|
128
131
|
return act === cascade_action_1.CascadeAction.Stop;
|
|
129
132
|
}
|
|
@@ -14,7 +14,7 @@ export interface DataflowClusterQueryResult extends BaseQueryResult {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const ClusterQueryDefinition: {
|
|
16
16
|
readonly executor: typeof executeDataflowClusterQuery;
|
|
17
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
18
|
readonly name: "parse";
|
|
19
19
|
readonly humanReadableName: "parse with R shell";
|
|
20
20
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ClusterQueryDefinition = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
8
|
const joi_1 = __importDefault(require("joi"));
|
|
9
9
|
const cluster_query_executor_1 = require("./cluster-query-executor");
|
|
10
10
|
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import { executeConfigQuery } from './config-query-executor';
|
|
3
|
-
import { type OutputFormatter } from '../../../util/ansi';
|
|
3
|
+
import { type OutputFormatter } from '../../../util/text/ansi';
|
|
4
4
|
import Joi from 'joi';
|
|
5
5
|
import type { FlowrConfigOptions } from '../../../config';
|
|
6
6
|
export interface ConfigQuery extends BaseQueryFormat {
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ConfigQueryDefinition = void 0;
|
|
7
7
|
const config_query_executor_1 = require("./config-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
const json_1 = require("../../../util/json");
|
|
12
12
|
exports.ConfigQueryDefinition = {
|
|
@@ -14,7 +14,7 @@ export interface DataflowLensQueryResult extends BaseQueryResult {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const DataflowLensQueryDefinition: {
|
|
16
16
|
readonly executor: typeof executeDataflowLensQuery;
|
|
17
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
18
|
readonly name: "parse";
|
|
19
19
|
readonly humanReadableName: "parse with R shell";
|
|
20
20
|
readonly description: "Parse the given R code into an AST";
|