@eagleoutice/flowr 2.16.6 → 2.16.8
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 +21 -15
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +2 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +3 -1
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -7
- package/abstract-interpretation/data-frame/resolve-args.js +2 -11
- package/cli/repl/commands/repl-cfg.js +5 -19
- package/cli/repl/commands/repl-code-command.d.ts +10 -0
- package/cli/repl/commands/repl-code-command.js +18 -0
- package/cli/repl/commands/repl-dataflow.js +34 -59
- package/cli/repl/commands/repl-normalize.js +24 -41
- package/cli/repl/commands/repl-query.js +10 -17
- package/config.js +3 -3
- package/control-flow/cfg-dead-code.js +15 -2
- package/control-flow/useless-loop.js +1 -2
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/dataflow/environments/ambient-state-name.d.ts +80 -0
- package/dataflow/environments/ambient-state-name.js +113 -0
- package/dataflow/environments/built-in-eval-name.d.ts +3 -1
- package/dataflow/environments/built-in-eval-name.js +2 -0
- package/dataflow/environments/built-in-props.d.ts +27 -7
- package/dataflow/environments/built-in-props.js +59 -44
- package/dataflow/environments/built-in.d.ts +5 -2
- package/dataflow/environments/built-in.js +22 -5
- package/dataflow/environments/default-builtin-config.d.ts +538 -14
- package/dataflow/environments/default-builtin-config.js +189 -123
- package/dataflow/environments/environment.d.ts +7 -1
- package/dataflow/environments/environment.js +19 -1
- package/dataflow/environments/identifier.d.ts +12 -1
- package/dataflow/environments/reference-to-maybe.js +1 -6
- package/dataflow/eval/resolve/alias-tracking.d.ts +13 -3
- package/dataflow/eval/resolve/alias-tracking.js +66 -37
- package/dataflow/eval/resolve/resolve-argument.d.ts +4 -2
- package/dataflow/eval/resolve/resolve-argument.js +23 -11
- package/dataflow/eval/resolve/resolve.d.ts +5 -0
- package/dataflow/eval/resolve/resolve.js +25 -3
- package/dataflow/eval/values/r-value.d.ts +4 -2
- package/dataflow/eval/values/r-value.js +3 -1
- package/dataflow/eval/values/string/string-constants.d.ts +7 -1
- package/dataflow/eval/values/string/string-constants.js +38 -36
- package/dataflow/extractor.js +105 -2
- package/dataflow/fn/argument-roles.js +22 -8
- package/dataflow/fn/function-semantics.d.ts +3 -2
- package/dataflow/fn/strict-function.js +13 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +4 -4
- package/dataflow/graph/df-helper.d.ts +14 -1
- package/dataflow/graph/df-helper.js +37 -4
- package/dataflow/graph/graph.d.ts +6 -0
- package/dataflow/graph/graph.js +9 -10
- package/dataflow/graph/vertex.d.ts +1 -1
- package/dataflow/hooks.d.ts +1 -1
- package/dataflow/info.d.ts +3 -3
- package/dataflow/internal/linker.d.ts +4 -1
- package/dataflow/internal/linker.js +12 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +88 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +21 -46
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +125 -158
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +35 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +10 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +21 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +8 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +11 -12
- 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 +6 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +43 -7
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +11 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +29 -4
- package/dataflow/internal/process/functions/call/common.js +3 -4
- package/dataflow/internal/process/functions/call/deferred.d.ts +3 -2
- package/dataflow/internal/process/functions/call/deferred.js +17 -9
- package/dataflow/internal/process/functions/call/quoted.js +1 -1
- package/dataflow/processor.d.ts +1 -1
- package/documentation/doc-capabilities.js +3 -2
- package/documentation/doc-readme.js +1 -2
- package/documentation/doc-util/doc-dfg.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +3 -1
- package/documentation/doc-util/doc-query.js +4 -4
- package/documentation/wiki-create-linting-rules.js +1 -1
- package/documentation/wiki-linter.js +16 -206
- package/documentation/wiki-linting-and-testing.js +31 -64
- package/documentation/wiki-query.js +41 -0
- package/index.d.ts +1 -0
- package/index.js +5 -1
- package/linter/linter-format.d.ts +6 -0
- package/linter/linter-format.js +10 -0
- package/linter/linter-rules.d.ts +155 -103
- package/linter/linter-rules.js +2 -0
- package/linter/linter-util.d.ts +23 -0
- package/linter/linter-util.js +58 -0
- package/linter/rules/absolute-path.d.ts +2 -2
- package/linter/rules/absolute-path.js +1 -4
- package/linter/rules/cmd-check/bogus-return.d.ts +2 -2
- package/linter/rules/cmd-check/bogus-return.js +3 -7
- package/linter/rules/cmd-check/call-arguments.d.ts +2 -2
- package/linter/rules/cmd-check/class-string-comparison.d.ts +2 -2
- package/linter/rules/cmd-check/class-string-comparison.js +3 -7
- package/linter/rules/cmd-check/cmd-check-util.d.ts +8 -9
- package/linter/rules/cmd-check/cmd-check-util.js +14 -26
- package/linter/rules/cmd-check/compiled-code.d.ts +8 -3
- package/linter/rules/cmd-check/compiled-code.js +3 -13
- package/linter/rules/cmd-check/dependency-declaration.d.ts +2 -2
- package/linter/rules/cmd-check/dependency-declaration.js +6 -7
- package/linter/rules/cmd-check/description-metadata.d.ts +4 -4
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +2 -2
- package/linter/rules/cmd-check/documentation-mismatch.js +4 -11
- package/linter/rules/cmd-check/file-checks.d.ts +19 -6
- package/linter/rules/cmd-check/file-checks.js +13 -5
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +2 -2
- package/linter/rules/cmd-check/global-environment-modification.d.ts +2 -2
- package/linter/rules/cmd-check/global-environment-modification.js +3 -2
- package/linter/rules/cmd-check/namespace-tampering.d.ts +2 -2
- package/linter/rules/cmd-check/namespace-tampering.js +9 -9
- package/linter/rules/cmd-check/non-ascii-code.d.ts +2 -2
- package/linter/rules/cmd-check/package-data.d.ts +11 -5
- package/linter/rules/cmd-check/package-data.js +5 -12
- package/linter/rules/cmd-check/package-files.js +4 -10
- package/linter/rules/cmd-check/package-hooks.d.ts +2 -2
- package/linter/rules/cmd-check/package-hooks.js +10 -8
- package/linter/rules/cmd-check/package-metafiles.d.ts +8 -3
- package/linter/rules/cmd-check/package-metafiles.js +3 -12
- package/linter/rules/cmd-check/package-runtime.d.ts +18 -5
- package/linter/rules/cmd-check/package-runtime.js +64 -20
- package/linter/rules/cmd-check/package-structure.d.ts +11 -5
- package/linter/rules/cmd-check/package-structure.js +4 -12
- package/linter/rules/cmd-check/rd-files.d.ts +8 -3
- package/linter/rules/cmd-check/rd-files.js +4 -14
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +2 -2
- package/linter/rules/cmd-check/s-three-method-consistency.js +3 -4
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.js +5 -8
- package/linter/rules/dead-code.d.ts +5 -4
- package/linter/rules/dead-code.js +25 -14
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/deprecated-functions.js +16 -23
- package/linter/rules/file-path-validity.d.ts +2 -2
- package/linter/rules/file-path-validity.js +3 -6
- package/linter/rules/function-finder-util.d.ts +3 -3
- package/linter/rules/function-finder-util.js +7 -14
- package/linter/rules/namespace-access.d.ts +2 -2
- package/linter/rules/namespace-access.js +6 -9
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +1 -4
- package/linter/rules/network-functions.d.ts +3 -3
- package/linter/rules/no-leaked-credentials.d.ts +2 -2
- package/linter/rules/no-leaked-credentials.js +1 -4
- package/linter/rules/overwritten-file.d.ts +38 -0
- package/linter/rules/overwritten-file.js +102 -0
- package/linter/rules/problematic-inputs.d.ts +16 -6
- package/linter/rules/problematic-inputs.js +78 -34
- package/linter/rules/roxygen-arguments.d.ts +2 -2
- package/linter/rules/roxygen-arguments.js +1 -4
- package/linter/rules/seeded-randomness.d.ts +3 -3
- package/linter/rules/seeded-randomness.js +6 -23
- package/linter/rules/software-has-license.d.ts +2 -2
- package/linter/rules/software-has-license.js +1 -4
- package/linter/rules/software-has-tests.d.ts +2 -2
- package/linter/rules/software-has-tests.js +1 -4
- package/linter/rules/stop-with-call-arg.d.ts +2 -2
- package/linter/rules/stop-with-call-arg.js +4 -11
- package/linter/rules/syntactically-valid.d.ts +4 -2
- package/linter/rules/syntactically-valid.js +29 -10
- package/linter/rules/unclosed-connection.d.ts +2 -2
- package/linter/rules/unclosed-connection.js +1 -4
- package/linter/rules/undefined-symbol.d.ts +2 -2
- package/linter/rules/undefined-symbol.js +25 -22
- package/linter/rules/unescaped-arguments.d.ts +2 -2
- package/linter/rules/unescaped-arguments.js +1 -4
- package/linter/rules/unused-definition.d.ts +2 -2
- package/linter/rules/unused-definition.js +37 -25
- package/linter/rules/unused-import.d.ts +2 -2
- package/linter/rules/unused-import.js +9 -14
- package/linter/rules/useless-loop.d.ts +7 -6
- package/linter/rules/useless-loop.js +4 -8
- package/package.json +5 -3
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +15 -11
- package/project/context/flowr-analyzer-files-context.d.ts +3 -0
- package/project/context/flowr-analyzer-files-context.js +6 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +6 -1
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +35 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +2 -1
- package/project/plugins/file-plugins/files/flowr-rsession-file.d.ts +26 -0
- package/project/plugins/file-plugins/files/flowr-rsession-file.js +44 -0
- package/project/plugins/file-plugins/files/r-session.d.ts +20 -0
- package/project/plugins/file-plugins/files/r-session.js +58 -0
- package/project/plugins/file-plugins/files/recorded-runs.d.ts +18 -0
- package/project/plugins/file-plugins/files/recorded-runs.js +8 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rsession-file-plugin.d.ts +20 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rsession-file-plugin.js +28 -0
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/project/sigdb/spec-query.d.ts +73 -0
- package/project/sigdb/spec-query.js +339 -0
- package/queries/base-query-format.d.ts +1 -1
- package/queries/base-query-format.js +2 -2
- package/queries/catalog/absint-query/absint-query-executor.js +3 -6
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +113 -73
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +2 -3
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -3
- package/queries/catalog/config-query/config-query-format.d.ts +0 -1
- package/queries/catalog/config-query/config-query-format.js +1 -2
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -4
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +0 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -2
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -3
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +7 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +72 -42
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +24 -6
- package/queries/catalog/dependencies-query/dependencies-query-format.js +108 -3
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +6 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +6 -6
- package/queries/catalog/dependencies-query/function-info/write-functions.js +13 -7
- package/queries/catalog/dependencies-query/implicit-echo.js +21 -7
- package/queries/catalog/dice-query/dice-query-executor.js +2 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -3
- package/queries/catalog/files-query/files-query-executor.js +2 -3
- package/queries/catalog/function-info-query/function-info-query-executor.js +2 -1
- package/queries/catalog/function-info-query/function-info-query-format.d.ts +0 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +1 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +3 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +0 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -3
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +0 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -2
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -3
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +0 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -2
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +3 -4
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.js +60 -13
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -3
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +2 -3
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +2 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -7
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -9
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +8 -33
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +1 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +8 -31
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -3
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +0 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +0 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -5
- package/queries/catalog/origin-query/origin-query-executor.js +3 -11
- package/queries/catalog/project-query/project-query-executor.js +23 -7
- package/queries/catalog/project-query/project-query-format.d.ts +5 -0
- package/queries/catalog/project-query/project-query-format.js +20 -2
- package/queries/catalog/provenance-query/provenance-query-executor.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +0 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -2
- package/queries/catalog/search-query/search-query-executor.js +2 -3
- package/queries/catalog/signature-query/signature-query-executor.js +39 -0
- package/queries/catalog/signature-query/signature-query-format.d.ts +7 -1
- package/queries/catalog/signature-query/signature-query-format.js +15 -1
- package/queries/catalog/signature-query/signature-query-render.js +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -3
- package/queries/query-function-property.d.ts +28 -0
- package/queries/query-function-property.js +48 -0
- package/queries/query-meta.d.ts +3 -0
- package/queries/query-meta.js +8 -0
- package/queries/query.d.ts +13 -18
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +4 -3
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +6 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +9 -0
- package/r-bridge/lang-4.x/ast/model/syntax-version.d.ts +8 -0
- package/r-bridge/lang-4.x/ast/model/syntax-version.js +49 -0
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/type.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +4 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.js +1 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +1 -1
- package/reconstruct/reconstruct.js +35 -1
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/static/fingerprint.js +7 -3
- package/slicing/static/static-slicer.js +6 -0
- package/util/assert.js +2 -2
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +11 -0
- package/util/collections/defaultmap.d.ts +5 -1
- package/util/collections/defaultmap.js +6 -1
- package/util/files.js +26 -5
- package/util/flowr-version.d.ts +10 -0
- package/util/flowr-version.js +20 -0
- package/util/glob.js +6 -4
- package/util/r-regex.d.ts +6 -0
- package/util/r-regex.js +17 -0
- package/util/text/args.d.ts +5 -0
- package/util/text/args.js +28 -22
- package/util/text/name-rank.d.ts +2 -0
- package/util/text/name-rank.js +3 -1
- package/util/text/regex.d.ts +10 -0
- package/util/text/regex.js +29 -0
- package/util/version.d.ts +1 -6
- package/util/version.js +6 -14
- package/documentation/doc-util/doc-functions.d.ts +0 -24
- package/documentation/doc-util/doc-functions.js +0 -65
|
@@ -4,6 +4,7 @@ exports.executeAbsintQuery = executeAbsintQuery;
|
|
|
4
4
|
const absint_inference_1 = require("../../../abstract-interpretation/absint-inference");
|
|
5
5
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
6
6
|
const log_1 = require("../../../util/log");
|
|
7
|
+
const query_meta_1 = require("../../query-meta");
|
|
7
8
|
const absint_query_format_1 = require("./absint-query-format");
|
|
8
9
|
/**
|
|
9
10
|
* Executes the given abstract interpretation queries using the provided analyzer.
|
|
@@ -27,9 +28,7 @@ async function executeAbsintQuery({ analyzer }, queries) {
|
|
|
27
28
|
if (queries.length === 1 && queries[0].criteria === undefined) {
|
|
28
29
|
const state = ('domain' in inference ? interpreter.getEndState(inference.domain) : interpreter.getEndState());
|
|
29
30
|
return {
|
|
30
|
-
|
|
31
|
-
timing: Date.now() - start
|
|
32
|
-
},
|
|
31
|
+
...(0, query_meta_1.metaSince)(start),
|
|
33
32
|
result: state
|
|
34
33
|
};
|
|
35
34
|
}
|
|
@@ -55,9 +54,7 @@ async function executeAbsintQuery({ analyzer }, queries) {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
return {
|
|
58
|
-
|
|
59
|
-
timing: Date.now() - start
|
|
60
|
-
},
|
|
57
|
+
...(0, query_meta_1.metaSince)(start),
|
|
61
58
|
result: result
|
|
62
59
|
};
|
|
63
60
|
}
|
|
@@ -3,6 +3,7 @@ import type { BasicQueryData } from '../../base-query-format';
|
|
|
3
3
|
export type PromotedCallTest = (t: string) => boolean;
|
|
4
4
|
/**
|
|
5
5
|
* Convert a name to a predicate that checks whether an input conforms to this name.
|
|
6
|
+
* A regex is only compiled once the predicate is first asked, as most of the many a query run promotes never are.
|
|
6
7
|
*/
|
|
7
8
|
export declare function promoteCallName(callName: CallNameTypes, exact?: boolean): PromotedCallTest;
|
|
8
9
|
export type PromotedLinkTo<LT = LinkTo> = Omit<LT, 'callName'> & {
|
|
@@ -4,10 +4,13 @@ exports.promoteCallName = promoteCallName;
|
|
|
4
4
|
exports.executeCallContextQueries = executeCallContextQueries;
|
|
5
5
|
const arrays_1 = require("../../../util/collections/arrays");
|
|
6
6
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
7
|
+
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
8
|
+
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
7
9
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
8
10
|
const edge_1 = require("../../../dataflow/graph/edge");
|
|
9
11
|
const two_layer_collector_1 = require("../../two-layer-collector");
|
|
10
12
|
const objects_1 = require("../../../util/objects");
|
|
13
|
+
const query_meta_1 = require("../../query-meta");
|
|
11
14
|
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
12
15
|
const identify_link_to_relation_1 = require("./identify-link-to-relation");
|
|
13
16
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
@@ -39,25 +42,19 @@ function isSubCallQuery(query) {
|
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
44
|
* Convert a name to a predicate that checks whether an input conforms to this name.
|
|
45
|
+
* A regex is only compiled once the predicate is first asked, as most of the many a query run promotes never are.
|
|
42
46
|
*/
|
|
43
47
|
function promoteCallName(callName, exact = false) {
|
|
44
48
|
if (Array.isArray(callName)) {
|
|
45
49
|
const s = new Set(callName);
|
|
46
50
|
return (t) => s.has(t);
|
|
47
51
|
}
|
|
48
|
-
else if (typeof callName === 'string') {
|
|
49
|
-
|
|
50
|
-
return (t) => t === callName;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const r = new RegExp(callName);
|
|
54
|
-
return (t) => r.test(t);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
const r = new RegExp(exact ? '^' + callName.source + '$' : callName.source);
|
|
59
|
-
return (t) => r.test(t);
|
|
52
|
+
else if (typeof callName === 'string' && exact) {
|
|
53
|
+
return (t) => t === callName;
|
|
60
54
|
}
|
|
55
|
+
const source = typeof callName === 'string' ? callName : exact ? '^' + callName.source + '$' : callName.source;
|
|
56
|
+
let r;
|
|
57
|
+
return (t) => (r ??= new RegExp(source)).test(t);
|
|
61
58
|
}
|
|
62
59
|
/** string arrays always match exactly, plain strings only if the query requests an exact match */
|
|
63
60
|
function exactNamesOf(callName, exact) {
|
|
@@ -68,6 +65,8 @@ function exactNamesOf(callName, exact) {
|
|
|
68
65
|
}
|
|
69
66
|
function promoteQueryCallNames(queries) {
|
|
70
67
|
let requiresCfg = false;
|
|
68
|
+
/* many queries share one link, like every plot addon linking to the plot it draws onto */
|
|
69
|
+
const promoteLink = (0, defaultmap_1.memoize)((l) => ({ ...l, callName: promoteCallName(l.callName) }));
|
|
71
70
|
const promotedQueries = queries.map((q, idx) => {
|
|
72
71
|
const promoted = {
|
|
73
72
|
...q,
|
|
@@ -85,20 +84,60 @@ function promoteQueryCallNames(queries) {
|
|
|
85
84
|
requiresCfg = true;
|
|
86
85
|
return {
|
|
87
86
|
...promoted,
|
|
88
|
-
linkTo: q.linkTo ? (0, arrays_1.isArray)(q.linkTo) ? q.linkTo.map(
|
|
89
|
-
...l,
|
|
90
|
-
callName: promoteCallName(l.callName)
|
|
91
|
-
})) : {
|
|
92
|
-
...q.linkTo,
|
|
93
|
-
/* we have to add another promotion layer whenever we add something without this call name */
|
|
94
|
-
callName: promoteCallName(q.linkTo.callName)
|
|
95
|
-
} : undefined
|
|
87
|
+
linkTo: q.linkTo ? (0, arrays_1.isArray)(q.linkTo) ? q.linkTo.map(promoteLink) : promoteLink(q.linkTo) : undefined
|
|
96
88
|
};
|
|
97
89
|
});
|
|
98
90
|
return { promotedQueries, requiresCfg };
|
|
99
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Where the function of a call comes from: the functions it calls and the definition of its name, or the expression
|
|
94
|
+
* computing its callee (`m$r` in `m$r()`). Not its arguments, like the function `lapply(x, function(y) print(y))`
|
|
95
|
+
* is handed, not the other values it reads, like the plot `lines()` draws into or the pipe a pipe continues, and not
|
|
96
|
+
* the built-ins a call of a function definition reaches through its body, like the anonymous call of
|
|
97
|
+
* `lapply(x, function(y) data[y])` does.
|
|
98
|
+
*/
|
|
99
|
+
function calleesOf(id, call, outgoing, graph) {
|
|
100
|
+
const node = graph.idMap?.get(id);
|
|
101
|
+
const callee = r_function_call_1.RFunctionCall.isUnnamed(node) ? node.calledFunction.info.id : undefined;
|
|
102
|
+
const name = identifier_1.Identifier.getName(call.name);
|
|
103
|
+
const isBinding = (target) => callee === undefined ? vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(target)) && node_id_1.NodeId.recoverBareName(target, graph.idMap) === name : target === callee;
|
|
104
|
+
const callsDefinition = outgoing.entries().some(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Calls) && !node_id_1.NodeId.isBuiltIn(t));
|
|
105
|
+
return outgoing.entries().filter(([target, edge]) => edge_1.DfEdge.doesNotIncludeType(edge, edge_1.EdgeType.Argument) && (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Calls)
|
|
106
|
+
? !node_id_1.NodeId.isBuiltIn(target) || !callsDefinition
|
|
107
|
+
: edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads) && isBinding(target))).map(([target]) => target).toArray();
|
|
108
|
+
}
|
|
100
109
|
/* maybe we want to add caches to this */
|
|
101
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Whether the name at a vertex the alias walk reaches names a function there: a built-in, a function definition,
|
|
112
|
+
* and a use reading one, a function definition's binding, or nothing (an unknown function), like the `print` of
|
|
113
|
+
* `f <- print`. Not a binding, which holds what its value names, nor a use of one, like the `print` of
|
|
114
|
+
* `print <- gar; f <- print`, which names `gar`.
|
|
115
|
+
*/
|
|
116
|
+
function namesFunction(id, graph) {
|
|
117
|
+
const vertex = graph.get(id);
|
|
118
|
+
if (vertex === undefined || vertex_1.DfgVertex.isFunctionDefinition(vertex[0])) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
else if (!vertex_1.DfgVertex.isUse(vertex[0])) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
let reads = false;
|
|
125
|
+
for (const [target, edge] of vertex[1]) {
|
|
126
|
+
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads)) {
|
|
127
|
+
reads = true;
|
|
128
|
+
if (node_id_1.NodeId.isBuiltIn(target) || graph.edgesFrom(target).entries().some(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy) && vertex_1.DfgVertex.isFunctionDefinition(graph.getVertex(t)))) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return !reads;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The names of the functions the call at `nodeId` may be a call of, each with the vertices naming it.
|
|
137
|
+
* Without `follow`, only what the call reaches directly, which is all there is when no function of interest is ever
|
|
138
|
+
* used as a value (`f <- read.csv`, `g(read.csv)`, `get("read.csv")`), as then nothing can be an alias of one.
|
|
139
|
+
*/
|
|
140
|
+
function retrieveAllCallAliases(nodeId, graph, follow) {
|
|
102
141
|
/* we want the names of all functions called at the source id, including synonyms and returns */
|
|
103
142
|
const aliases = new Map();
|
|
104
143
|
const visited = new Set();
|
|
@@ -111,12 +150,17 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
111
150
|
}
|
|
112
151
|
visited.add(id);
|
|
113
152
|
if (id !== nodeId) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
present
|
|
153
|
+
if (namesFunction(id, graph)) {
|
|
154
|
+
const present = aliases.get(str);
|
|
155
|
+
if (present) {
|
|
156
|
+
present.push(id);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
aliases.set(str, [id]);
|
|
160
|
+
}
|
|
117
161
|
}
|
|
118
|
-
|
|
119
|
-
|
|
162
|
+
if (!follow) {
|
|
163
|
+
continue;
|
|
120
164
|
}
|
|
121
165
|
}
|
|
122
166
|
const vertex = graph.get(id);
|
|
@@ -124,7 +168,11 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
124
168
|
continue;
|
|
125
169
|
}
|
|
126
170
|
const [info, outgoing] = vertex;
|
|
127
|
-
if (
|
|
171
|
+
if (vertex_1.DfgVertex.isFunctionDefinition(info)) {
|
|
172
|
+
/* the function itself, what it reads (like the `library` call providing a package's) makes no alias */
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
else if (!vertex_1.DfgVertex.isFunctionCall(info)) {
|
|
128
176
|
const wantedTypes = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall;
|
|
129
177
|
const x = outgoing.entries()
|
|
130
178
|
.filter(([, e]) => edge_1.DfEdge.includesType(e, wantedTypes))
|
|
@@ -136,13 +184,9 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
136
184
|
}
|
|
137
185
|
continue;
|
|
138
186
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
const out = outgoing.entries()
|
|
144
|
-
.filter(([, e]) => edge_1.DfEdge.includesType(e, track) && (nodeId !== id || edge_1.DfEdge.doesNotIncludeType(e, edge_1.EdgeType.Argument)))
|
|
145
|
-
.map(([t]) => t);
|
|
187
|
+
/* a call reached on the way is an alias only for what it hands back, not for what it reads or calls */
|
|
188
|
+
const out = id === nodeId ? calleesOf(id, info, outgoing, graph)
|
|
189
|
+
: outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).map(([t]) => t);
|
|
146
190
|
for (const call of out) {
|
|
147
191
|
queue.enqueue([node_id_1.NodeId.recoverContent(call, graph) ?? node_id_1.NodeId.recoverContent(id, graph) ?? '', call]);
|
|
148
192
|
}
|
|
@@ -232,58 +276,56 @@ async function executeCallContextQueries({ analyzer }, queries) {
|
|
|
232
276
|
cfg = await analyzer.controlflow(undefined);
|
|
233
277
|
}
|
|
234
278
|
const calls = cfg ? new Map(dataflow.graph.verticesOfType(vertex_1.VertexType.FunctionCall)) : undefined;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
const nonAliasPatterns = [];
|
|
279
|
+
/* index exact-name queries so each name costs one map lookup instead of a predicate check per query */
|
|
280
|
+
const byName = new Map();
|
|
281
|
+
const patterns = [];
|
|
239
282
|
for (const query of promotedQueries) {
|
|
240
|
-
if (query.includeAliases) {
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
283
|
if (query.exactNames) {
|
|
244
284
|
for (const name of query.exactNames) {
|
|
245
|
-
const present =
|
|
285
|
+
const present = byName.get(name);
|
|
246
286
|
if (present) {
|
|
247
287
|
present.push(query);
|
|
248
288
|
}
|
|
249
289
|
else {
|
|
250
|
-
|
|
290
|
+
byName.set(name, [query]);
|
|
251
291
|
}
|
|
252
292
|
}
|
|
253
293
|
}
|
|
254
294
|
else {
|
|
255
|
-
|
|
295
|
+
patterns.push(query);
|
|
256
296
|
}
|
|
257
297
|
}
|
|
298
|
+
const queriesFor = (name) => {
|
|
299
|
+
const exact = byName.get(name) ?? [];
|
|
300
|
+
return patterns.length === 0 ? exact : [...exact, ...patterns.filter(q => q.callName(name))];
|
|
301
|
+
};
|
|
302
|
+
const aliasQueries = promotedQueries.filter(q => q.includeAliases);
|
|
303
|
+
/* an alias of a function needs the function used as a value somewhere, like `read.csv` in `f <- read.csv` */
|
|
304
|
+
const followAliases = aliasQueries.length > 0 && dataflow.graph.verticesOfType(vertex_1.VertexType.Use).some(([id]) => {
|
|
305
|
+
const value = node_id_1.NodeId.recoverContent(id, dataflow.graph);
|
|
306
|
+
return value !== undefined && queriesFor(value).some(q => q.includeAliases);
|
|
307
|
+
});
|
|
258
308
|
for (const [nodeId, info] of dataflow.graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
|
|
259
|
-
|
|
260
|
-
if
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
for (const query of queriesWhichWantAliases) {
|
|
269
|
-
if (query.callName(l)) {
|
|
270
|
-
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({ id: nodeId, name: info.name, aliasRoots: ids }));
|
|
309
|
+
const n = identifier_1.Identifier.getName(info.name);
|
|
310
|
+
/* each query matching the call by its name or, if it asks for them, by the functions it is an alias of */
|
|
311
|
+
const matched = new Map(queriesFor(n).map(q => [q, undefined]));
|
|
312
|
+
/* without a function used as a value, a call is only one of its own name, whose roots only matter if it matches */
|
|
313
|
+
if (followAliases || matched.keys().some(q => q.includeAliases)) {
|
|
314
|
+
for (const [alias, ids] of retrieveAllCallAliases(nodeId, dataflow.graph, followAliases)) {
|
|
315
|
+
for (const query of queriesFor(alias)) {
|
|
316
|
+
if (query.includeAliases) {
|
|
317
|
+
matched.set(query, [...matched.get(query) ?? [], ...ids]);
|
|
271
318
|
}
|
|
272
319
|
}
|
|
273
320
|
}
|
|
274
321
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
let matching;
|
|
278
|
-
if (nonAliasPatterns.length === 0) {
|
|
279
|
-
matching = byName;
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
const patternMatches = nonAliasPatterns.filter(q => q.callName(n));
|
|
283
|
-
matching = byName.length === 0 ? patternMatches
|
|
284
|
-
: [...byName, ...patternMatches].sort((a, b) => a.idx - b.idx);
|
|
322
|
+
if (matched.size === 0) {
|
|
323
|
+
continue;
|
|
285
324
|
}
|
|
286
|
-
|
|
325
|
+
const matching = [...matched.entries()].sort(([a], [b]) => a.idx - b.idx);
|
|
326
|
+
/* if the call is quoted, we do not want to link to it */
|
|
327
|
+
const quoted = df_helper_1.Dataflow.isQuoted(nodeId, dataflow.graph) && !(0, query_fn_props_1.quotedForWorker)(nodeId, dataflow.graph, analyzer.inspectContext().env.builtInIndex);
|
|
328
|
+
for (const [query, aliasRoots] of matching) {
|
|
287
329
|
const file = ast.idMap.get(nodeId)?.info.file;
|
|
288
330
|
if (!doesFilepathMatch(file, query.fileFilter)) {
|
|
289
331
|
continue;
|
|
@@ -303,8 +345,7 @@ async function executeCallContextQueries({ analyzer }, queries) {
|
|
|
303
345
|
continue;
|
|
304
346
|
}
|
|
305
347
|
}
|
|
306
|
-
if (
|
|
307
|
-
/* if the call is quoted, we do not want to link to it */
|
|
348
|
+
if (quoted) {
|
|
308
349
|
continue;
|
|
309
350
|
}
|
|
310
351
|
else if (query.ignoreParameterValues && isParameterDefaultValue(nodeId, ast)) {
|
|
@@ -333,15 +374,14 @@ async function executeCallContextQueries({ analyzer }, queries) {
|
|
|
333
374
|
id: nodeId,
|
|
334
375
|
name: info.name,
|
|
335
376
|
calls: targets,
|
|
336
|
-
linkedIds: linkedIds ? Array.from(linkedIds) : undefined
|
|
377
|
+
linkedIds: linkedIds ? Array.from(linkedIds) : undefined,
|
|
378
|
+
aliasRoots: aliasRoots
|
|
337
379
|
}));
|
|
338
380
|
}
|
|
339
381
|
}
|
|
340
382
|
removeIdenticalDuplicates(initialIdCollector);
|
|
341
383
|
return {
|
|
342
|
-
|
|
343
|
-
timing: Date.now() - now,
|
|
344
|
-
},
|
|
384
|
+
...(0, query_meta_1.metaSince)(now),
|
|
345
385
|
kinds: makeReport(initialIdCollector)
|
|
346
386
|
};
|
|
347
387
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeCallGraphQuery = executeCallGraphQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
+
const query_meta_1 = require("../../query-meta");
|
|
5
6
|
const expand_library_internals_1 = require("./expand-library-internals");
|
|
6
7
|
const call_graph_1 = require("../../../dataflow/graph/call-graph");
|
|
7
8
|
/**
|
|
@@ -15,9 +16,7 @@ async function executeCallGraphQuery({ analyzer }, queries) {
|
|
|
15
16
|
const graph = await analyzer.callGraph();
|
|
16
17
|
const expand = queries.some(q => q.expandLibraryInternals);
|
|
17
18
|
return {
|
|
18
|
-
|
|
19
|
-
timing: Date.now() - startTime
|
|
20
|
-
},
|
|
19
|
+
...(0, query_meta_1.metaSince)(startTime),
|
|
21
20
|
graph: expand ? (0, expand_library_internals_1.expandCallGraphLibraryInternals)(graph, analyzer.inspectContext().deps) : graph,
|
|
22
21
|
unreachable: queries.some(q => q.reportUnreachable) ? call_graph_1.CallGraph.unreachableCalls(graph) : undefined
|
|
23
22
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeDataflowClusterQuery = executeDataflowClusterQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
5
|
const cluster_1 = require("../../../dataflow/cluster");
|
|
6
|
+
const query_meta_1 = require("../../query-meta");
|
|
6
7
|
/**
|
|
7
8
|
* Executes the given dataflow cluster queries using the provided analyzer.
|
|
8
9
|
*/
|
|
@@ -13,9 +14,7 @@ async function executeDataflowClusterQuery({ analyzer }, queries) {
|
|
|
13
14
|
const start = Date.now();
|
|
14
15
|
const clusters = (0, cluster_1.findAllClusters)((await analyzer.dataflow()).graph);
|
|
15
16
|
return {
|
|
16
|
-
|
|
17
|
-
timing: Date.now() - start
|
|
18
|
-
},
|
|
17
|
+
...(0, query_meta_1.metaSince)(start),
|
|
19
18
|
clusters
|
|
20
19
|
};
|
|
21
20
|
}
|
|
@@ -344,7 +344,6 @@ exports.ConfigQueryDefinition = {
|
|
|
344
344
|
update: joi_1.default.object().optional().description('An optional partial configuration to update the current configuration with before returning it. Only the provided fields will be updated, all other fields will remain unchanged.'),
|
|
345
345
|
inspect: joi_1.default.array().items(joi_1.default.string()).optional().description('An optional `.`-separated path (as a string array) to read a single configuration value instead of returning the whole configuration.'),
|
|
346
346
|
reset: joi_1.default.boolean().optional().description('If true, discard every prior update and revert to the config the analyzer was created with, before returning it.')
|
|
347
|
-
}).description('The config query retrieves the current configuration of the flowR instance and optionally also updates it.')
|
|
348
|
-
flattenInvolvedNodes: () => []
|
|
347
|
+
}).description('The config query retrieves the current configuration of the flowR instance and optionally also updates it.')
|
|
349
348
|
};
|
|
350
349
|
//# sourceMappingURL=config-query-format.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeControlFlowQuery = executeControlFlowQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
+
const query_meta_1 = require("../../query-meta");
|
|
5
6
|
/**
|
|
6
7
|
* Executes the control flow query with the given simplification passes.
|
|
7
8
|
*/
|
|
@@ -13,9 +14,7 @@ async function executeControlFlowQuery({ analyzer }, queries) {
|
|
|
13
14
|
const start = Date.now();
|
|
14
15
|
const controlFlow = await analyzer.controlflow(query.config?.simplificationPasses);
|
|
15
16
|
return {
|
|
16
|
-
|
|
17
|
-
timing: Date.now() - start
|
|
18
|
-
},
|
|
17
|
+
...(0, query_meta_1.metaSince)(start),
|
|
19
18
|
controlFlow
|
|
20
19
|
};
|
|
21
20
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDataflowLensQuery = executeDataflowLensQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
+
const query_meta_1 = require("../../query-meta");
|
|
5
6
|
const dfg_view_1 = require("../../../util/simple-df/dfg-view");
|
|
6
7
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
8
|
const arguments_1 = require("../../../abstract-interpretation/data-frame/arguments");
|
|
@@ -31,11 +32,8 @@ async function executeDataflowLensQuery({ analyzer }, queries) {
|
|
|
31
32
|
blacklistWithName: true
|
|
32
33
|
}
|
|
33
34
|
}, analyzer.inspectContext().env.makeCleanEnv());
|
|
34
|
-
const timing = Date.now() - now;
|
|
35
35
|
return {
|
|
36
|
-
|
|
37
|
-
timing
|
|
38
|
-
},
|
|
36
|
+
...(0, query_meta_1.metaSince)(now),
|
|
39
37
|
simplifiedGraph
|
|
40
38
|
};
|
|
41
39
|
}
|
|
@@ -17,5 +17,4 @@ export declare const DataflowLensQueryDefinition: {
|
|
|
17
17
|
readonly executor: typeof executeDataflowLensQuery;
|
|
18
18
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
19
19
|
readonly schema: Joi.ObjectSchema<any>;
|
|
20
|
-
readonly flattenInvolvedNodes: () => never[];
|
|
21
20
|
};
|
|
@@ -19,7 +19,6 @@ exports.DataflowLensQueryDefinition = {
|
|
|
19
19
|
},
|
|
20
20
|
schema: joi_1.default.object({
|
|
21
21
|
type: joi_1.default.string().valid('dataflow-lens').required().description('The type of the query.'),
|
|
22
|
-
}).description('The dataflow-lens query returns a simplified view on the dataflow graph')
|
|
23
|
-
flattenInvolvedNodes: () => []
|
|
22
|
+
}).description('The dataflow-lens query returns a simplified view on the dataflow graph')
|
|
24
23
|
};
|
|
25
24
|
//# sourceMappingURL=dataflow-lens-query-format.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDataflowQuery = executeDataflowQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
+
const query_meta_1 = require("../../query-meta");
|
|
5
6
|
/**
|
|
6
7
|
* Executes the given dataflow queries.
|
|
7
8
|
*/
|
|
@@ -12,9 +13,7 @@ async function executeDataflowQuery({ analyzer }, queries) {
|
|
|
12
13
|
const startTime = Date.now();
|
|
13
14
|
const { graph } = await analyzer.dataflow();
|
|
14
15
|
return {
|
|
15
|
-
|
|
16
|
-
timing: Date.now() - startTime
|
|
17
|
-
},
|
|
16
|
+
...(0, query_meta_1.metaSince)(startTime),
|
|
18
17
|
graph: queries.every(q => q.environments === false) ? graph.withoutEnvironments() : graph
|
|
19
18
|
};
|
|
20
19
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type DependenciesQuery, type DependenciesQueryResult } from './dependencies-query-format';
|
|
2
2
|
import { type DataflowGraphVertexFunctionCall } from '../../../dataflow/graph/vertex';
|
|
3
3
|
import { Identifier } from '../../../dataflow/environments/identifier';
|
|
4
|
+
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
5
|
import type { BasicQueryData } from '../../base-query-format';
|
|
5
6
|
import type { DataflowInformation } from '../../../dataflow/info';
|
|
6
7
|
import type { FlowrConfig } from '../../../config';
|
|
7
8
|
import type { NormalizedAst } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
8
9
|
import { type FlowMemo } from './data-flow';
|
|
10
|
+
import type { CallContext } from '../../../dataflow/eval/resolve/alias-tracking';
|
|
9
11
|
/**
|
|
10
12
|
* Executes a dependencies query.
|
|
11
13
|
*/
|
|
@@ -21,4 +23,9 @@ export interface QueryRun {
|
|
|
21
23
|
readonly memo: FlowMemo;
|
|
22
24
|
/** the formals of the call, give its qualified name if known already */
|
|
23
25
|
readonly formals: (vertex: DataflowGraphVertexFunctionCall, qualified?: Identifier) => readonly string[] | undefined;
|
|
26
|
+
/** how the values of the entries of a call come about, so a call of the function around it can ask again for its own */
|
|
27
|
+
readonly revalue: Map<NodeId, Revalue>;
|
|
24
28
|
}
|
|
29
|
+
/** the values the entries of a call get when the functions around it are resolved for the calls the context names */
|
|
30
|
+
type Revalue = (callContext: CallContext) => readonly string[] | undefined;
|
|
31
|
+
export {};
|