@eagleoutice/flowr 2.14.3 → 2.15.0
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 +76 -63
- package/abstract-interpretation/absint-inference.d.ts +347 -0
- package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
- package/abstract-interpretation/abstract-semantics.d.ts +246 -0
- package/abstract-interpretation/abstract-semantics.js +3 -0
- package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
- package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1656 -0
- package/abstract-interpretation/data-frame/resolve-args.js +4 -4
- package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
- package/abstract-interpretation/data-frame/semantics.js +27 -29
- package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
- package/abstract-interpretation/data-frame/shape-inference.js +14 -79
- package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
- package/abstract-interpretation/domains/interval-domain.js +25 -33
- package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
- package/abstract-interpretation/domains/partial-product-domain.js +26 -43
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
- package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
- package/abstract-interpretation/domains/set-range-domain.js +29 -62
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
- package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
- package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
- package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
- package/abstract-interpretation/value-semantics.d.ts +113 -0
- package/abstract-interpretation/value-semantics.js +115 -0
- package/benchmark/slicer.js +12 -6
- package/benchmark/stats/feature-counts.d.ts +2 -1
- package/benchmark/stats/feature-counts.js +25 -1
- package/benchmark/stats/stats.d.ts +4 -0
- package/benchmark/summarizer/second-phase/graph.js +7 -0
- package/cli/repl/commands/repl-parse.js +11 -22
- package/cli/repl/parser/slice-query-parser.d.ts +2 -0
- package/cli/repl/parser/slice-query-parser.js +1 -0
- package/config.d.ts +30 -205
- package/config.js +37 -3
- package/control-flow/cfg-properties.d.ts +5 -0
- package/control-flow/cfg-properties.js +25 -7
- package/control-flow/control-flow-graph.d.ts +11 -37
- package/control-flow/control-flow-graph.js +33 -77
- package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
- package/control-flow/semantic-cfg-guided-visitor.js +65 -320
- package/dataflow/environments/built-in-config.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in-props.d.ts +192 -82
- package/dataflow/environments/built-in-props.js +336 -106
- package/dataflow/environments/built-in.d.ts +21 -9
- package/dataflow/environments/built-in.js +43 -12
- package/dataflow/environments/default-builtin-config.d.ts +3219 -328
- package/dataflow/environments/default-builtin-config.js +804 -1031
- package/dataflow/environments/environment.d.ts +26 -49
- package/dataflow/environments/environment.js +34 -47
- package/dataflow/environments/group-generics.d.ts +36 -0
- package/dataflow/environments/group-generics.js +58 -0
- package/dataflow/environments/identifier.d.ts +106 -6
- package/dataflow/environments/identifier.js +19 -1
- package/dataflow/environments/query-fn-props.d.ts +16 -8
- package/dataflow/environments/query-fn-props.js +45 -21
- package/dataflow/environments/resolve-by-name.js +9 -2
- package/dataflow/environments/scoping.d.ts +5 -0
- package/dataflow/environments/scoping.js +11 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +20 -2
- package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
- package/dataflow/eval/resolve/resolve-numbers.js +44 -9
- package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
- package/dataflow/eval/resolve/resolve-strings.js +16 -7
- package/dataflow/eval/resolve/resolve.d.ts +5 -22
- package/dataflow/eval/resolve/resolve.js +24 -34
- package/dataflow/eval/values/general.d.ts +7 -1
- package/dataflow/eval/values/general.js +17 -3
- package/dataflow/eval/values/string/string-constants.d.ts +16 -15
- package/dataflow/eval/values/string/string-constants.js +59 -27
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +16 -4
- package/dataflow/fn/argument-roles.d.ts +35 -0
- package/dataflow/fn/argument-roles.js +252 -0
- package/dataflow/fn/class-declaration.d.ts +148 -0
- package/dataflow/fn/class-declaration.js +317 -0
- package/dataflow/fn/condition-handlers.d.ts +5 -0
- package/dataflow/fn/condition-handlers.js +13 -0
- package/dataflow/fn/exceptions-of-function.d.ts +21 -7
- package/dataflow/fn/exceptions-of-function.js +74 -43
- package/dataflow/fn/frame-reflection.d.ts +46 -0
- package/dataflow/fn/frame-reflection.js +169 -0
- package/dataflow/fn/function-props.d.ts +32 -0
- package/dataflow/fn/function-props.js +160 -0
- package/dataflow/fn/higher-order-function.d.ts +23 -5
- package/dataflow/fn/higher-order-function.js +64 -18
- package/dataflow/fn/strict-function.d.ts +24 -2
- package/dataflow/fn/strict-function.js +49 -19
- package/dataflow/graph/call-graph.js +10 -2
- package/dataflow/graph/df-helper.d.ts +1 -12
- package/dataflow/graph/df-helper.js +2 -19
- package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +39 -188
- package/dataflow/graph/graph.js +46 -163
- package/dataflow/graph/match-args.d.ts +34 -2
- package/dataflow/graph/match-args.js +45 -12
- package/dataflow/graph/vertex.d.ts +8 -0
- package/dataflow/info.d.ts +7 -5
- package/dataflow/info.js +1 -5
- package/dataflow/internal/control-flow.js +20 -17
- package/dataflow/internal/linker.d.ts +8 -37
- package/dataflow/internal/linker.js +22 -55
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
- package/dataflow/internal/process/functions/call/common.d.ts +4 -6
- package/dataflow/internal/process/functions/call/common.js +2 -2
- package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
- package/dataflow/internal/process/functions/call/deferred.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
- package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
- package/dataflow/internal/process/functions/call/quoted.js +144 -28
- package/dataflow/origin/dfg-get-origin.js +23 -10
- package/dataflow/processor.d.ts +2 -1
- package/dataflow/processor.js +6 -0
- package/documentation/data/interface/doc-writing-code.js +2 -0
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/wiki-absint.d.ts +11 -14
- package/documentation/wiki-absint.js +73 -59
- package/documentation/wiki-core.js +64 -24
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-query.js +82 -264
- package/documentation/wiki-signature-database.js +23 -6
- package/gas.d.ts +91 -47
- package/gas.js +97 -13
- package/index.d.ts +31 -0
- package/index.js +52 -0
- package/linter/linter-rules.d.ts +87 -23
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +10 -8
- package/linter/rules/dead-code.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +14 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +13 -2
- package/linter/rules/network-functions.d.ts +10 -5
- package/linter/rules/network-functions.js +48 -36
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/problematic-inputs.d.ts +1 -1
- package/linter/rules/problematic-inputs.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +3 -2
- package/linter/rules/seeded-randomness.js +7 -3
- package/linter/rules/software-has-license.d.ts +1 -1
- package/linter/rules/software-has-tests.d.ts +1 -1
- package/linter/rules/stop-with-call-arg.d.ts +1 -1
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/unclosed-connection.d.ts +3 -3
- package/linter/rules/unclosed-connection.js +3 -4
- package/linter/rules/undefined-symbol.d.ts +1 -1
- package/linter/rules/unescaped-arguments.d.ts +161 -0
- package/linter/rules/unescaped-arguments.js +293 -0
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +51 -6
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +3 -198
- package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
- package/project/context/flowr-analyzer-environment-context.js +33 -1
- package/project/context/flowr-analyzer-files-context.d.ts +24 -1
- package/project/context/flowr-analyzer-files-context.js +42 -21
- package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
- package/project/context/flowr-analyzer-functions-context.js +2 -0
- package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
- package/project/context/flowr-analyzer-gas-context.js +21 -0
- package/project/context/flowr-file.d.ts +16 -1
- package/project/context/flowr-file.js +26 -2
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
- package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
- package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
- package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
- package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
- package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
- package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
- package/project/plugins/package-version-plugins/package.js +2 -1
- package/project/plugins/plugin-registry.d.ts +3 -1
- package/project/plugins/plugin-registry.js +11 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
- package/project/sigdb/build.d.ts +9 -15
- package/project/sigdb/build.js +63 -42
- package/project/sigdb/decode.d.ts +10 -4
- package/project/sigdb/decode.js +60 -21
- package/project/sigdb/memory-source.d.ts +4 -0
- package/project/sigdb/memory-source.js +8 -0
- package/project/sigdb/reader.d.ts +50 -100
- package/project/sigdb/reader.js +84 -105
- package/project/sigdb/schema.d.ts +102 -26
- package/project/sigdb/schema.js +14 -6
- package/project/sigdb/signature-db.d.ts +4 -0
- package/project/sigdb/signature-db.js +8 -1
- package/queries/base-query-format.d.ts +7 -0
- package/queries/base-query-format.js +29 -0
- package/queries/catalog/absint-query/absint-query-executor.js +8 -6
- package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
- package/queries/catalog/absint-query/absint-query-format.js +32 -19
- package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
- package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
- package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
- package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
- package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
- package/queries/catalog/dependencies-query/link-devices.js +6 -7
- package/queries/catalog/dice-query/dice-query-executor.js +1 -1
- package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
- package/queries/catalog/files-query/files-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
- package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +9 -9
- package/queries/catalog/signature-query/signature-query-executor.js +104 -95
- package/queries/catalog/signature-query/signature-query-format.d.ts +34 -8
- package/queries/catalog/signature-query/signature-query-format.js +16 -4
- package/queries/catalog/signature-query/signature-query-render.js +24 -4
- package/queries/catalog/slice-query-options.d.ts +14 -0
- package/queries/catalog/slice-query-options.js +15 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
- package/queries/query-function-filter.d.ts +8 -3
- package/queries/query-function-filter.js +16 -6
- package/queries/query.d.ts +38 -38
- package/queries/query.js +30 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/model.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +17 -9
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
- package/reconstruct/reconstruct.d.ts +9 -20
- package/reconstruct/reconstruct.js +66 -28
- package/search/flowr-search-filters.d.ts +7 -6
- package/search/flowr-search-filters.js +6 -4
- package/search/search-executor/search-enrichers.d.ts +10 -10
- package/search/search-executor/search-enrichers.js +32 -3
- package/search/search-executor/search-transformer.js +15 -23
- package/slicing/criterion/parse.js +2 -12
- package/slicing/static/slice-call.js +1 -8
- package/slicing/static/static-slicer.js +1 -1
- package/util/collections/bimap.js +14 -6
- package/util/objects.js +16 -17
- package/util/r-value.d.ts +5 -4
- package/util/record.d.ts +38 -3
- package/util/record.js +48 -1
- package/util/simple-df/dfg-ascii.js +1 -1
- package/util/text/name-rank.js +8 -2
- package/util/text/strings.d.ts +5 -0
- package/util/text/strings.js +10 -0
- package/util/version.js +2 -2
- package/abstract-interpretation/absint-visitor.d.ts +0 -223
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
package/config.d.ts
CHANGED
|
@@ -55,51 +55,18 @@ export declare enum DropPathsOption {
|
|
|
55
55
|
/** try to drop every folder of the path */
|
|
56
56
|
All = "all"
|
|
57
57
|
}
|
|
58
|
+
/** see {@link FlowrConfig.Schema}'s `resolveSource` for the per-field descriptions (kept there once, as that is what generates the published config docs) */
|
|
58
59
|
export interface FlowrLaxSourcingOptions extends MergeableRecord {
|
|
59
|
-
/**
|
|
60
|
-
* search for filenames matching in the lowercase
|
|
61
|
-
*/
|
|
62
60
|
readonly ignoreCapitalization: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* try to infer the working directory from the main or any script to analyze.
|
|
65
|
-
*/
|
|
66
61
|
readonly inferWorkingDirectory: InferWorkingDirectory;
|
|
67
|
-
/**
|
|
68
|
-
* Additionally search in these paths
|
|
69
|
-
*/
|
|
70
62
|
readonly searchPath: string[];
|
|
71
|
-
/**
|
|
72
|
-
* Allow to drop the first or all parts of the sourced path,
|
|
73
|
-
* if it is relative.
|
|
74
|
-
*/
|
|
75
63
|
readonly dropPaths: DropPathsOption;
|
|
76
|
-
/**
|
|
77
|
-
* How often the same file can be sourced within a single run?
|
|
78
|
-
* Please be aware: in case of cyclic sources this may not reach a fixpoint so give this a sensible limit.
|
|
79
|
-
*/
|
|
80
64
|
readonly repeatedSourceLimit?: number;
|
|
81
65
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* Every replacement consists of a record that maps a regex to a replacement string.
|
|
85
|
-
* @example
|
|
86
|
-
* ```ts
|
|
87
|
-
* [
|
|
88
|
-
* { }, // no replacement -> still try the original name/path
|
|
89
|
-
* { '.*\\.R$': 'main.R' }, // replace all .R files with main.R
|
|
90
|
-
* { '\s' : '_' }, // replace all spaces with underscores
|
|
91
|
-
* { '\s' : '-', 'oo': 'aa' }, // replace all spaces with dashes and oo with aa
|
|
92
|
-
* ]
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* Given a `source("foo bar.R")` this configuration will search for (in this order):
|
|
96
|
-
* - `foo bar.R` (original name)
|
|
97
|
-
* - `main.R` (replaced with main.R)
|
|
98
|
-
* - `foo_bar.R` (replaced spaces)
|
|
99
|
-
* - `faa-bar.R` (replaced spaces and oo)
|
|
66
|
+
* Regex replacements to try against a sourced file's candidate name, tried in order alongside the original
|
|
67
|
+
* name, e.g. `{ '.*\\.R$': 'main.R' }` makes `source("foo bar.R")` also try `main.R`.
|
|
100
68
|
*/
|
|
101
69
|
readonly applyReplacements?: Record<string, string>[];
|
|
102
|
-
/** Assume a sourced file is always there, making what it defines certain instead of conditional on the `source` call. */
|
|
103
70
|
readonly assumeFilesExist?: boolean;
|
|
104
71
|
}
|
|
105
72
|
export type ConfigPlugin<T extends BuiltInFlowrPluginName | string> = T | string | (T extends BuiltInFlowrPluginName ? [T, BuiltInFlowrPluginArgs<T>] : [string, unknown[]]);
|
|
@@ -114,38 +81,22 @@ export type SpecializeConfigEntry = DeepPartial<FlowrConfig> & {
|
|
|
114
81
|
*/
|
|
115
82
|
export interface FlowrConfig {
|
|
116
83
|
readonly logLevel?: LogLevelName;
|
|
117
|
-
/**
|
|
118
|
-
* Whether source calls should be ignored, causing {@link processSourceCall}'s behavior to be skipped
|
|
119
|
-
*/
|
|
120
84
|
readonly ignoreSourceCalls: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Whether load calls should be ignored, causing {@link processLoadCall}'s behavior to be skipped
|
|
123
|
-
*/
|
|
124
85
|
readonly ignoreLoadCalls: boolean;
|
|
125
|
-
/** Configure language semantics and how flowR handles them */
|
|
126
86
|
readonly semantics: {
|
|
127
|
-
/** Semantics regarding the handling of the environment */
|
|
128
87
|
readonly environment: {
|
|
129
|
-
/** Do you want to overwrite (parts) of the builtin definition? */
|
|
130
88
|
readonly overwriteBuiltIns: {
|
|
131
|
-
/** Should the default configuration still be loaded? */
|
|
132
89
|
readonly loadDefaults?: boolean;
|
|
133
|
-
/** The definitions to load */
|
|
134
90
|
readonly definitions: BuiltInDefinitions;
|
|
135
91
|
};
|
|
136
92
|
};
|
|
137
93
|
};
|
|
138
|
-
/** Plugins to load by default when creating a new FlowrAnalyzer */
|
|
139
94
|
readonly defaultPlugins: ConfigPlugin<string>[];
|
|
140
|
-
/** Configuration options for the REPL */
|
|
141
95
|
readonly repl: {
|
|
142
|
-
/** Whether to show quick stats in the REPL after each evaluation */
|
|
143
96
|
quickStats: boolean;
|
|
144
|
-
/** This instruments the dataflow processors to count how often each processor is called */
|
|
145
97
|
dfProcessorHeat: boolean;
|
|
146
98
|
/** Whether to show dim inline hints (e.g. `:help`) on the empty prompt; automatically disabled on non-interactive terminals */
|
|
147
99
|
hints: boolean;
|
|
148
|
-
/** Plugins to load in REPL mode */
|
|
149
100
|
plugins: (ConfigPlugin<string> | 'flowr:default')[];
|
|
150
101
|
/** Automatically use the file protocol for inputs that look like paths (default `true`) */
|
|
151
102
|
autoUseFileProtocol?: boolean;
|
|
@@ -155,111 +106,61 @@ export interface FlowrConfig {
|
|
|
155
106
|
showPlugins?: boolean;
|
|
156
107
|
};
|
|
157
108
|
readonly project: {
|
|
158
|
-
/** Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files */
|
|
159
109
|
resolveUnknownPathsOnDisk: boolean;
|
|
160
|
-
/** Whether a directory that cannot be traversed during file discovery (e.g. due to permissions) aborts the analysis; when `false` (the default) such paths are logged and skipped. */
|
|
161
110
|
failOnInaccessiblePath?: boolean;
|
|
162
|
-
/** Overwrite the {@link ProjectKind} flowR would otherwise infer from the analyzed files, e.g. when auto-detection guesses wrong. */
|
|
163
111
|
useProjectType?: ProjectKind;
|
|
164
|
-
/**
|
|
165
|
-
* Whether the top level of the analyzed code is echoed, so that every visible result printed there counts as an
|
|
166
|
-
* output (the `print` category of the dependencies query). Defaults to `true` and is set to `false` for a
|
|
167
|
-
* {@link ProjectKind.Package}, whose top-level code runs at install time.
|
|
168
|
-
*/
|
|
112
|
+
/** Whether the top level's visible results count as an output (the `print` category); off by default for a {@link ProjectKind.Package}, whose top level runs at install time. */
|
|
169
113
|
assumeImplicitEcho?: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* The packages considered part of R itself, used e.g. by the project query to classify dependencies. If
|
|
172
|
-
* unset, flowR derives them (for the assumed R version) from the signature database via `baseRPackages`.
|
|
173
|
-
*/
|
|
114
|
+
/** The packages considered part of R itself; if unset, flowR derives them (for the assumed R version) from the signature database via `baseRPackages`. */
|
|
174
115
|
basePackages?: string[];
|
|
175
|
-
/**
|
|
176
|
-
* Files a framework loads on its own, without any `source()` call (e.g. `global.R` in a shiny app), in load
|
|
177
|
-
* order. Entries are case-insensitive globs (`R/*.R`) matched against the path, a plain name matches any file
|
|
178
|
-
* with that name; entries matching nothing are warned about. Usually set per {@link ProjectKind} via
|
|
179
|
-
* {@link FlowrConfig.specializeConfig}.
|
|
180
|
-
*/
|
|
181
116
|
implicitSources?: string[];
|
|
182
|
-
/** Scoping options for the default project discovery. */
|
|
183
117
|
discovery?: {
|
|
184
|
-
/** Collect every file below the project root (greedy) instead of only the files the detected {@link ProjectKind} needs (default `false`). */
|
|
185
118
|
full?: boolean;
|
|
186
|
-
/** Per-{@link ProjectKind} include/exclude glob overrides layered on the default scoping. */
|
|
187
119
|
perKind?: Partial<Record<ProjectKind, {
|
|
188
120
|
include?: string[];
|
|
189
121
|
exclude?: string[];
|
|
190
122
|
}>>;
|
|
191
|
-
/** Case-insensitive globs that drop matching files from the intelligent discovery, regardless of kind (e.g. `.Renviron` to ignore environment files). */
|
|
192
123
|
ignore?: string[];
|
|
193
124
|
};
|
|
194
|
-
/** Overrides for the signals flowR uses to classify the {@link ProjectKind}; unset fields keep the built-in defaults. */
|
|
195
125
|
classification?: {
|
|
196
126
|
/** DESCRIPTION `Type:` values that mark a shiny app (default `shiny`, `shiny-app`, `shinyapp`). */
|
|
197
127
|
shinyDescriptionTypes?: string[];
|
|
198
128
|
/** File names a shiny app is assembled from (default `app.R`, `ui.R`, `server.R`, `global.R`). */
|
|
199
129
|
shinyEntryFiles?: string[];
|
|
200
|
-
/** Regex source evidencing shiny usage in an entry file. */
|
|
201
130
|
shinyUsagePattern?: string;
|
|
202
131
|
/** File extensions marking a notebook (default `ipynb`, `rmd`, `rmarkdown`, `qmd`, `rnw`). */
|
|
203
132
|
notebookExtensions?: string[];
|
|
204
133
|
};
|
|
205
134
|
};
|
|
206
|
-
/** Linter configuration, usually specialized per {@link ProjectKind} via {@link FlowrConfig.specializeConfig}. */
|
|
207
135
|
readonly linter: {
|
|
208
|
-
/** Rule names excluded from the *default* rule set (a rule requested explicitly still runs). */
|
|
209
136
|
readonly disabledRules: string[];
|
|
210
137
|
};
|
|
211
138
|
/**
|
|
212
|
-
* Teaches the {@link InputSourcesQuery|input-sources} analysis
|
|
213
|
-
*
|
|
214
|
-
* `input` even when you declare your own. Usually set per {@link ProjectKind} via {@link specializeConfig}.
|
|
215
|
-
* @see {@link InputClassifierConfig} - for what the entries mean
|
|
139
|
+
* Teaches the {@link InputSourcesQuery|input-sources} analysis further frameworks; entries are *added* to what
|
|
140
|
+
* flowR knows already. Usually set per {@link ProjectKind} via {@link specializeConfig}. See {@link InputClassifierConfig}.
|
|
216
141
|
*/
|
|
217
142
|
readonly inputSources?: DeepWritable<InputClassifierConfig<string[]>>;
|
|
218
143
|
/**
|
|
219
|
-
* Overwrite (parts of) this configuration
|
|
220
|
-
*
|
|
221
|
-
* with the entry's own keys winning) to avoid repeating it. Resolve it with {@link FlowrConfig.forKind}.
|
|
144
|
+
* Overwrite (parts of) this configuration per {@link ProjectKind}; an entry may `inherit` another kind's
|
|
145
|
+
* overwrite first (own keys win). Resolve with {@link FlowrConfig.forKind}.
|
|
222
146
|
*/
|
|
223
147
|
readonly specializeConfig?: Partial<Record<ProjectKind, SpecializeConfigEntry>>;
|
|
224
|
-
/**
|
|
225
|
-
* The engines to use for interacting with R code. Currently, supports {@link TreeSitterEngineConfig} and {@link RShellEngineConfig}.
|
|
226
|
-
* An empty array means all available engines will be used.
|
|
227
|
-
*/
|
|
148
|
+
/** Engines to use for interacting with R code ({@link TreeSitterEngineConfig}, {@link RShellEngineConfig}); empty means all available engines. */
|
|
228
149
|
readonly engines: EngineConfig[];
|
|
229
|
-
/**
|
|
230
|
-
* The default engine to use for interacting with R code. If this is undefined, an arbitrary engine from {@link engines} will be used.
|
|
231
|
-
*/
|
|
150
|
+
/** The default engine to use. If undefined, an arbitrary one from {@link engines} is used. */
|
|
232
151
|
readonly defaultEngine?: EngineConfig['type'];
|
|
233
|
-
/** How to resolve constants, constraints, cells, … */
|
|
234
152
|
readonly solver: {
|
|
235
|
-
/**
|
|
236
|
-
* How to resolve variables and their values
|
|
237
|
-
*/
|
|
238
153
|
readonly variables: VariableResolve;
|
|
239
|
-
/**
|
|
240
|
-
* Should we include eval(parse(text="...")) calls in the dataflow graph?
|
|
241
|
-
*/
|
|
242
154
|
readonly evalStrings: boolean;
|
|
243
|
-
/**
|
|
244
|
-
* Track user-created environments (`new.env()`, `assign(..., envir=e)`, `get(..., envir=e)`,
|
|
245
|
-
* `local({}, envir=e)`, `e$x <- v`, `attach(e)`) with precise per-variable envState.
|
|
246
|
-
* When disabled all envir-style calls fall through to the conservative global treatment.
|
|
247
|
-
*/
|
|
248
155
|
readonly trackEnvironments: boolean;
|
|
249
|
-
/** Resolving `library()`/`use()` exports from a signature database (e.g. the bundled `flowr-sigdb`). */
|
|
250
156
|
readonly sigdb: {
|
|
251
|
-
/** Resolve library exports from a signature database (default `true`); when `false` no database is consulted. */
|
|
252
157
|
readonly enabled: boolean;
|
|
253
|
-
/** Load the project's declared dependencies from its metadata files (`DESCRIPTION` Imports/Depends, `rproject.toml`, `uvr.toml`, `renv.lock`, `rv.lock`, `uvr.lock`) into the dependency context (default `true`); when `false` these files are not read, so neither the undefined-symbol linter nor {@link linkDescriptionDependencies} sees any project-declared dependency. */
|
|
254
158
|
readonly loadProjectDependencies: boolean;
|
|
255
|
-
/** Parse the database up front rather than on the first package load (default `false`, ignored if disabled). */
|
|
256
159
|
readonly eagerlyLoad: boolean;
|
|
257
|
-
/** Add a vertex for every export on load rather than on demand (default `false`); keeps the graph small. */
|
|
258
160
|
readonly eagerlyLoadExports: boolean;
|
|
259
161
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* engine reports none, e.g. the tree-sitter engine). Resolve it with {@link resolveAssumedRVersion}.
|
|
162
|
+
* R version assumed when resolving versioned (base-R) exports: a pin, or `"auto"` to detect the installed R
|
|
163
|
+
* (falling back to {@link DefaultAssumedRVersion} if none, e.g. tree-sitter). See {@link resolveAssumedRVersion}.
|
|
263
164
|
*/
|
|
264
165
|
readonly assumedRVersion?: string;
|
|
265
166
|
/** Eagerly attach base-R namespaces (from a signature database) so bare base calls resolve without `library()` (default `false`; changes every analysis; needs a base-R signature database). */
|
|
@@ -272,144 +173,71 @@ export interface FlowrConfig {
|
|
|
272
173
|
readonly linkPackageCalls?: boolean;
|
|
273
174
|
/** Decompress the hot shards (base + most-downloaded) in a background task on startup, so the first `library()` lookup is warm (default `false`; useful for long-running servers/REPLs, not one-shot runs). */
|
|
274
175
|
readonly warmInBackground?: boolean;
|
|
275
|
-
/** Extra directories (or bundle/manifest files) searched for signature databases, alongside the shipped default and `$FLOWR_SIGDB_DIR`. A downloaded full-history bundle placed here is mounted automatically. */
|
|
276
176
|
readonly additionalPaths?: string[];
|
|
277
|
-
/** GitHub `owner/repo` the full-history bundle is downloaded from (`:signature download`); default `flowr-analysis/flowr`, release tag `sigdb-v<flowR-version>`. */
|
|
278
177
|
readonly downloadRepo?: string;
|
|
279
|
-
/** On startup, compare the cache against the committed `sigdb.remote.json` link file and re-download changed shards in the background (default `false`; needs network, so opt-in — a `git pull` that updates the pointer then re-syncs automatically). */
|
|
280
178
|
readonly autoSync?: boolean;
|
|
281
|
-
/** When a project constrains a dependency, resolve to the `newest` (default) or `oldest` version satisfying the constraint, or the `system`-installed version (needs R; falls back to `newest` when unavailable). Base-R packages always resolve against the assumed R version. */
|
|
282
179
|
readonly versionSelection?: VersionSelection;
|
|
283
180
|
/** Force an exact version for specific packages (mapping a package name to a version), overriding both the project constraint and the {@link versionSelection} policy; a version missing from the database falls back with a warning (default `{}`). */
|
|
284
181
|
readonly versionOverrides?: Record<string, string>;
|
|
285
182
|
/**
|
|
286
|
-
* Recovering a package no signature database knows (
|
|
287
|
-
*
|
|
288
|
-
* as it reads directories outside the analyzed project and ties the analysis to what is installed here.
|
|
183
|
+
* Recovering a package no signature database knows (e.g. `maptools`) from its local install: `DESCRIPTION`
|
|
184
|
+
* states the version, `NAMESPACE` the exports. Opt-in, since it reads outside the analyzed project.
|
|
289
185
|
*/
|
|
290
186
|
readonly installedLibrary?: {
|
|
291
|
-
/** Consult installed packages at all (default `false`). */
|
|
292
187
|
readonly enabled: boolean;
|
|
293
|
-
/** The library directories to search; when empty they are discovered as configured below (default `[]`). */
|
|
294
188
|
readonly paths?: string[];
|
|
295
|
-
/** Search the libraries `R_LIBS_USER`/`R_LIBS`/`R_LIBS_SITE` name (default `true`, ignored when {@link paths} is given). */
|
|
296
189
|
readonly useEnvironment?: boolean;
|
|
297
|
-
/** Search a project-local `renv`/`packrat` library (default `true`, ignored when {@link paths} is given). */
|
|
298
190
|
readonly useProjectLibrary?: boolean;
|
|
299
|
-
/** How far to descend into the nested layout of a project-local library (default `3`). */
|
|
300
191
|
readonly maxDepth?: number;
|
|
301
|
-
/** Only recover packages whose name matches one of these regular expressions; empty means any (default `[]`). */
|
|
302
192
|
readonly packages?: string[];
|
|
303
193
|
};
|
|
304
194
|
};
|
|
305
|
-
/** Policies for reasoning about dependency versions (independent of how the signature database is loaded). */
|
|
306
195
|
readonly versionManagement?: {
|
|
307
|
-
/** Groups of packages that must resolve to the same version (like the base packages, which share the R version); version guessing intersects each group so its members stay mutually compatible (default `[]`). */
|
|
308
196
|
readonly linkedVersionGroups?: string[][];
|
|
309
197
|
};
|
|
310
|
-
|
|
198
|
+
readonly transitiveSideEffectRounds?: number;
|
|
199
|
+
readonly assumeAttachedPackages?: string[];
|
|
311
200
|
readonly instrument: {
|
|
312
201
|
/**
|
|
313
|
-
* Modify the dataflow processors used during
|
|
314
|
-
*
|
|
315
|
-
* This may have arbitrary consequences on the analysis precision and performance, consider focusing on decorating existing processors instead of replacing them.
|
|
202
|
+
* Modify the dataflow processors used during analysis; keep every processor correctness requires present.
|
|
203
|
+
* May affect precision/performance arbitrarily -- prefer decorating existing processors over replacing them.
|
|
316
204
|
*/
|
|
317
205
|
dataflowExtractors?: (extractor: DataflowProcessors<ParentInformation>, ctx: FlowrAnalyzerContext) => DataflowProcessors<ParentInformation>;
|
|
318
206
|
};
|
|
319
|
-
/**
|
|
320
|
-
* If lax source calls are active, flowR searches for sourced files much more freely,
|
|
321
|
-
* based on the configurations you give it.
|
|
322
|
-
* This option is only in effect if {@link ignoreSourceCalls} is set to false.
|
|
323
|
-
*/
|
|
324
207
|
readonly resolveSource?: FlowrLaxSourcingOptions;
|
|
325
|
-
/**
|
|
326
|
-
* The configuration for flowR's slicer
|
|
327
|
-
*/
|
|
328
208
|
slicer?: {
|
|
329
|
-
/**
|
|
330
|
-
* The maximum number of iterations to perform on a single function call during slicing
|
|
331
|
-
*/
|
|
332
209
|
readonly threshold?: number;
|
|
333
|
-
/**
|
|
334
|
-
* If set, the slicer will gain an additional post-pass
|
|
335
|
-
*/
|
|
336
210
|
readonly autoExtend?: boolean;
|
|
337
211
|
};
|
|
338
212
|
};
|
|
339
|
-
/**
|
|
340
|
-
* Configuration options for abstract interpretation
|
|
341
|
-
*/
|
|
342
213
|
readonly abstractInterpretation: {
|
|
343
|
-
/**
|
|
344
|
-
* The threshold for the number of visitations of a node at which widening should be performed to ensure the termination of the fixpoint iteration
|
|
345
|
-
*/
|
|
346
214
|
readonly wideningThreshold: number;
|
|
347
|
-
/**
|
|
348
|
-
* Whether the abstract interpretation is interprocedural, i.e. whether it steps into the functions a call
|
|
349
|
-
* may dispatch to instead of describing the call by its result alone
|
|
350
|
-
*/
|
|
351
215
|
readonly followCalls: boolean;
|
|
352
|
-
/**
|
|
353
|
-
* The configuration of the shape inference for data frames
|
|
354
|
-
*/
|
|
355
216
|
readonly dataFrame: {
|
|
356
|
-
/**
|
|
357
|
-
* The maximum number of columns names to infer for data frames before over-approximating the column names to top
|
|
358
|
-
*/
|
|
359
217
|
readonly maxColNames: number;
|
|
360
|
-
/**
|
|
361
|
-
* Configuration options for reading data frame shapes from loaded external data files, such as CSV files
|
|
362
|
-
*/
|
|
363
218
|
readonly readLoadedData: {
|
|
364
|
-
/**
|
|
365
|
-
* Whether data frame shapes should be extracted from loaded external data files, such as CSV files
|
|
366
|
-
*/
|
|
367
219
|
readonly readExternalFiles: boolean;
|
|
368
|
-
/**
|
|
369
|
-
* The maximum number of lines to read when extracting data frame shapes from loaded files, such as CSV files
|
|
370
|
-
*/
|
|
371
220
|
readonly maxReadLines: number;
|
|
372
221
|
};
|
|
373
222
|
};
|
|
374
223
|
};
|
|
375
224
|
readonly incremental: {
|
|
376
|
-
/**
|
|
377
|
-
* Always take the incremental path, regardless of heuristics
|
|
378
|
-
*/
|
|
379
225
|
readonly alwaysIncremental: boolean;
|
|
380
226
|
readonly parsing: {
|
|
381
227
|
readonly activated: boolean;
|
|
382
228
|
readonly heuristics: {
|
|
383
229
|
readonly activated: boolean;
|
|
384
|
-
/**
|
|
385
|
-
* Skip reparsing entirely if the file's modification time is unchanged since the last parse
|
|
386
|
-
*/
|
|
387
230
|
readonly mtime: boolean;
|
|
388
|
-
/**
|
|
389
|
-
* Only consider incremental parsing for files with at least this many lines
|
|
390
|
-
*/
|
|
391
231
|
readonly linesFrom: number;
|
|
392
|
-
/**
|
|
393
|
-
* Only consider incremental parsing for files with at least this many bytes
|
|
394
|
-
*/
|
|
395
232
|
readonly bytesFrom: number;
|
|
396
|
-
/**
|
|
397
|
-
* Always take the incremental path whenever there is a computed edit region, regardless of the other thresholds
|
|
398
|
-
*/
|
|
399
233
|
readonly alwaysWithEdits: boolean;
|
|
400
|
-
/**
|
|
401
|
-
* Only apply these heuristics once the project has at least this many files loaded
|
|
402
|
-
*/
|
|
403
234
|
readonly minFiles: number;
|
|
404
235
|
};
|
|
405
236
|
};
|
|
406
237
|
};
|
|
407
238
|
/**
|
|
408
|
-
* Resource-usage guard (gas) configuration
|
|
409
|
-
*
|
|
410
|
-
* Set a `feature factor > 0` to enable checking for that feature.
|
|
411
|
-
* @see {@link FlowrGasConfig}
|
|
412
|
-
* @see {@link ReadOnlyFlowrAnalyzerGasContext}
|
|
239
|
+
* Resource-usage guard (gas) configuration; disabled by default (every feature factor `0`), enable by setting a
|
|
240
|
+
* feature's factor `> 0`. See {@link FlowrGasConfig}, {@link ReadOnlyFlowrAnalyzerGasContext}.
|
|
413
241
|
*/
|
|
414
242
|
readonly gas: FlowrGasConfig;
|
|
415
243
|
}
|
|
@@ -420,6 +248,13 @@ export interface FlowrConfig {
|
|
|
420
248
|
export type ValidFlowrConfigPaths = AutocompletablePaths<FlowrConfig>;
|
|
421
249
|
/** Whether library exports should be resolved from a signature database (`solver.sigdb.enabled`). */
|
|
422
250
|
export declare function isSigDbEnabled(config: FlowrConfig | undefined): boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Default of `gas.countedCheckEvery`: how many calls one accounting of an armed dataflow budget covers.
|
|
253
|
+
* A budget only has to catch work that has run away, so the sampling is deliberately coarse.
|
|
254
|
+
*/
|
|
255
|
+
export declare const DefaultCountedCheckEvery = 64;
|
|
256
|
+
/** Default of `solver.transitiveSideEffectRounds`: round cap for the transitive side-effect fixpoint in {@link produceDataFlowGraph}, which stops on its own once a round adds nothing. */
|
|
257
|
+
export declare const DefaultTransitiveSideEffectRounds = 32;
|
|
423
258
|
/**
|
|
424
259
|
* R version assumed for analysis when `solver.sigdb.assumedRVersion` is `"auto"` and none could be detected.
|
|
425
260
|
* Kept in step with the newest base-R release in the bundled sigdb (see `newestRVersion` in the generated
|
|
@@ -434,24 +269,14 @@ export declare const DefaultAssumedRVersion = "4.5.3";
|
|
|
434
269
|
export declare function resolveAssumedRVersion(config: FlowrConfig | undefined, detected?: string): string;
|
|
435
270
|
export interface TreeSitterEngineConfig extends MergeableRecord {
|
|
436
271
|
readonly type: 'tree-sitter';
|
|
437
|
-
/**
|
|
438
|
-
* The path to the tree-sitter-r WASM binary to use. If this is undefined, {@link DEFAULT_TREE_SITTER_R_WASM_PATH} will be used.
|
|
439
|
-
*/
|
|
272
|
+
/** The path to the tree-sitter-r WASM binary to use; defaults to {@link DEFAULT_TREE_SITTER_R_WASM_PATH}. */
|
|
440
273
|
readonly wasmPath?: string;
|
|
441
|
-
/**
|
|
442
|
-
* The path to the tree-sitter WASM binary to use. If this is undefined, the path specified by the tree-sitter package will be used.
|
|
443
|
-
*/
|
|
444
274
|
readonly treeSitterWasmPath?: string;
|
|
445
|
-
/**
|
|
446
|
-
* Whether to use the lax parser for parsing R code (allowing for syntax errors). If this is undefined, the strict parser will be used.
|
|
447
|
-
*/
|
|
448
275
|
readonly lax?: boolean;
|
|
449
276
|
}
|
|
450
277
|
export interface RShellEngineConfig extends MergeableRecord {
|
|
451
278
|
readonly type: 'r-shell';
|
|
452
|
-
/**
|
|
453
|
-
* The path to the R executable to use. If this is undefined, {@link DEFAULT_R_PATH} will be used.
|
|
454
|
-
*/
|
|
279
|
+
/** The path to the R executable to use; defaults to {@link DEFAULT_R_PATH}. */
|
|
455
280
|
readonly rPath?: string;
|
|
456
281
|
}
|
|
457
282
|
export type EngineConfig = TreeSitterEngineConfig | RShellEngineConfig;
|
package/config.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FlowrConfig = exports.FlowrDefaultPlugins = exports.DefaultAssumedRVersion = exports.DropPathsOption = exports.InferWorkingDirectory = exports.VersionSelection = exports.VariableResolve = void 0;
|
|
6
|
+
exports.FlowrConfig = exports.FlowrDefaultPlugins = exports.DefaultAssumedRVersion = exports.DefaultTransitiveSideEffectRounds = exports.DefaultCountedCheckEvery = exports.DropPathsOption = exports.InferWorkingDirectory = exports.VersionSelection = exports.VariableResolve = void 0;
|
|
7
7
|
exports.isSigDbEnabled = isSigDbEnabled;
|
|
8
8
|
exports.resolveAssumedRVersion = resolveAssumedRVersion;
|
|
9
9
|
exports.globalConfigFilePath = globalConfigFilePath;
|
|
@@ -71,6 +71,13 @@ var DropPathsOption;
|
|
|
71
71
|
function isSigDbEnabled(config) {
|
|
72
72
|
return config?.solver.sigdb.enabled === true;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Default of `gas.countedCheckEvery`: how many calls one accounting of an armed dataflow budget covers.
|
|
76
|
+
* A budget only has to catch work that has run away, so the sampling is deliberately coarse.
|
|
77
|
+
*/
|
|
78
|
+
exports.DefaultCountedCheckEvery = 64;
|
|
79
|
+
/** Default of `solver.transitiveSideEffectRounds`: round cap for the transitive side-effect fixpoint in {@link produceDataFlowGraph}, which stops on its own once a round adds nothing. */
|
|
80
|
+
exports.DefaultTransitiveSideEffectRounds = 32;
|
|
74
81
|
/**
|
|
75
82
|
* R version assumed for analysis when `solver.sigdb.assumedRVersion` is `"auto"` and none could be detected.
|
|
76
83
|
* Kept in step with the newest base-R release in the bundled sigdb (see `newestRVersion` in the generated
|
|
@@ -123,6 +130,15 @@ exports.FlowrDefaultPlugins = [
|
|
|
123
130
|
'file:ipynb',
|
|
124
131
|
'file:namespace',
|
|
125
132
|
'file:news',
|
|
133
|
+
/* the macro plugin before the page one, so `man/macros/` never reads as a page */
|
|
134
|
+
'file:rd-macros',
|
|
135
|
+
'file:rd',
|
|
136
|
+
'file:rd-index',
|
|
137
|
+
'file:rd-topics',
|
|
138
|
+
'file:rd-meta',
|
|
139
|
+
'file:datalist',
|
|
140
|
+
/* the sysdata plugin before the rda one, so `R/sysdata.rda` never reads as a plain workspace */
|
|
141
|
+
'file:sysdata',
|
|
126
142
|
'file:rda',
|
|
127
143
|
'file:license',
|
|
128
144
|
'file:virtualenv',
|
|
@@ -286,6 +302,7 @@ exports.FlowrConfig = {
|
|
|
286
302
|
repeatedSourceLimit: 2,
|
|
287
303
|
assumeFilesExist: false
|
|
288
304
|
},
|
|
305
|
+
transitiveSideEffectRounds: exports.DefaultTransitiveSideEffectRounds,
|
|
289
306
|
instrument: {
|
|
290
307
|
dataflowExtractors: undefined
|
|
291
308
|
},
|
|
@@ -430,6 +447,8 @@ exports.FlowrConfig = {
|
|
|
430
447
|
versionManagement: joi_1.default.object({
|
|
431
448
|
linkedVersionGroups: joi_1.default.array().items(joi_1.default.array().items(joi_1.default.string())).optional().description('Groups of packages that must resolve to the same version; version guessing intersects each group so its members stay mutually compatible (default []).')
|
|
432
449
|
}).description('Policies for reasoning about dependency versions.'),
|
|
450
|
+
assumeAttachedPackages: joi_1.default.array().items(joi_1.default.string()).optional().description('Packages to treat as attached without a `library()` call, so what the built-in configuration states about them applies to the analyzed code.'),
|
|
451
|
+
transitiveSideEffectRounds: joi_1.default.number().min(1).optional().description(`How many rounds the transitive side-effect fixpoint may run before it is cut off (default ${exports.DefaultTransitiveSideEffectRounds}); the propagation stops on its own as soon as a round adds nothing.`),
|
|
433
452
|
instrument: joi_1.default.object({
|
|
434
453
|
dataflowExtractors: joi_1.default.any().optional().description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
|
|
435
454
|
}),
|
|
@@ -487,9 +506,24 @@ exports.FlowrConfig = {
|
|
|
487
506
|
}).pattern(joi_1.default.string(), joi_1.default.object({
|
|
488
507
|
problematic: joi_1.default.number().min(0).optional().description('Elapsed ms above which Problematic is returned for this feature.'),
|
|
489
508
|
critical: joi_1.default.number().min(0).optional().description('Elapsed ms above which Critical is returned for this feature.')
|
|
490
|
-
})).optional().description('Elapsed analysis time thresholds in milliseconds, either shared or given per feature key (with `default` covering the rest).')
|
|
509
|
+
})).optional().description('Elapsed analysis time thresholds in milliseconds, either shared or given per feature key (with `default` covering the rest).'),
|
|
510
|
+
steps: joi_1.default.object({
|
|
511
|
+
problematic: joi_1.default.number().min(0).optional().description('Processed AST nodes above which Problematic is returned, for every feature without an entry of its own.'),
|
|
512
|
+
critical: joi_1.default.number().min(0).optional().description('Processed AST nodes above which the extraction is cut short, for every feature without an entry of its own.')
|
|
513
|
+
}).pattern(joi_1.default.string(), joi_1.default.object({
|
|
514
|
+
problematic: joi_1.default.number().min(0).optional().description('Processed AST nodes above which Problematic is returned for this feature.'),
|
|
515
|
+
critical: joi_1.default.number().min(0).optional().description('Processed AST nodes above which the extraction is cut short for this feature.')
|
|
516
|
+
})).optional().description('Processed-AST-node thresholds, counted rather than sampled; only a key that arms a budget (`dataflow`) reads them.'),
|
|
517
|
+
vertices: joi_1.default.object({
|
|
518
|
+
problematic: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which Problematic is returned, for every feature without an entry of its own.'),
|
|
519
|
+
critical: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which the extraction is cut short, for every feature without an entry of its own.')
|
|
520
|
+
}).pattern(joi_1.default.string(), joi_1.default.object({
|
|
521
|
+
problematic: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which Problematic is returned for this feature.'),
|
|
522
|
+
critical: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which the extraction is cut short for this feature.')
|
|
523
|
+
})).optional().description('Created-dataflow-vertex thresholds, counted like `steps`.')
|
|
491
524
|
}).optional().description('Thresholds for all gas checks (scaled by per-feature factor), boundable per feature.'),
|
|
492
|
-
features: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.number().min(0).optional()).optional().description('Per-feature sensitivity factors. 0 or absent disables gas checking for that feature. A factor of 2 makes the feature twice as sensitive. Recognised keys: `source`, `side-effect-linking`, `linter`, `slicer`.'),
|
|
525
|
+
features: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.number().min(0).optional()).optional().description('Per-feature sensitivity factors. 0 or absent disables gas checking for that feature. A factor of 2 makes the feature twice as sensitive. Recognised keys: `source`, `side-effect-linking`, `linter`, `slicer`, `dataflow`.'),
|
|
526
|
+
countedCheckEvery: joi_1.default.number().min(1).optional().description(`How many counted steps pass between two clock reads while an armed budget also carries a timeMs bound (default ${exports.DefaultCountedCheckEvery}); trades overshoot against the cost of reading the clock.`),
|
|
493
527
|
heapProvider: joi_1.default.function().optional().description('Custom heap statistics source (programmatic configs only), overriding the built-in v8/performance.memory detection.')
|
|
494
528
|
}).optional().description(`Resource-usage guard (gas) configuration. All feature factors default to 0 (disabled). See ${gas_1.GasWikiRef}.`)
|
|
495
529
|
}).description('The configuration file format for flowR.'),
|
|
@@ -13,6 +13,11 @@ declare const CfgProperties: {
|
|
|
13
13
|
export type CfgProperty = keyof typeof CfgProperties;
|
|
14
14
|
declare function checkSingleEntryAndExit(cfg: ControlFlowInformation): boolean;
|
|
15
15
|
declare function hasEntryAndExit(cfg: ControlFlowInformation): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Every vertex reaches somewhere control stops, so the walk back starts at all of those: the exits the analysis
|
|
18
|
+
* names, and every vertex control reaches and never leaves again. An argument after one that raises ends at such
|
|
19
|
+
* a vertex, since a call whose parameter is never forced carries on to the call itself.
|
|
20
|
+
*/
|
|
16
21
|
declare function checkExitIsReachedByAll(cfg: ControlFlowInformation): boolean;
|
|
17
22
|
declare function checkEntryReachesAll(cfg: ControlFlowInformation): boolean;
|
|
18
23
|
/** either returns true or the name of the property that is not satisfied */
|
|
@@ -29,16 +29,21 @@ function checkSingleEntryAndExit(cfg) {
|
|
|
29
29
|
function hasEntryAndExit(cfg) {
|
|
30
30
|
return cfg.entryPoints.every(e => cfg.graph.hasVertex(e)) && cfg.exitPoints.every(e => cfg.graph.hasVertex(e));
|
|
31
31
|
}
|
|
32
|
-
function checkReachFrom(label, cfg,
|
|
33
|
-
|
|
32
|
+
function checkReachFrom(label, cfg, starts, collect) {
|
|
33
|
+
// we only require the roots to be there
|
|
34
|
+
const allVertices = cfg.graph.rootIds();
|
|
35
|
+
if (allVertices.size === 0) {
|
|
36
|
+
/* an empty file, one holding nothing but comments, and one that does not parse all yield an empty graph,
|
|
37
|
+
for which every vertex trivially satisfies the property */
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
if (starts.length === 0) {
|
|
34
41
|
return false;
|
|
35
42
|
}
|
|
36
43
|
const collected = new Set();
|
|
37
|
-
collect(cfg.graph, [
|
|
44
|
+
collect(cfg.graph, [...starts], node => {
|
|
38
45
|
collected.add(node);
|
|
39
46
|
});
|
|
40
|
-
// we only require the roots to be there
|
|
41
|
-
const allVertices = cfg.graph.rootIds();
|
|
42
47
|
const diff = (0, set_1.setMinus)(allVertices, collected);
|
|
43
48
|
if (diff.size > 0) {
|
|
44
49
|
log_1.log.error(`Unreachable vertices from ${label}:`, diff);
|
|
@@ -46,11 +51,24 @@ function checkReachFrom(label, cfg, start, collect) {
|
|
|
46
51
|
}
|
|
47
52
|
return true;
|
|
48
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Every vertex reaches somewhere control stops, so the walk back starts at all of those: the exits the analysis
|
|
56
|
+
* names, and every vertex control reaches and never leaves again. An argument after one that raises ends at such
|
|
57
|
+
* a vertex, since a call whose parameter is never forced carries on to the call itself.
|
|
58
|
+
*/
|
|
49
59
|
function checkExitIsReachedByAll(cfg) {
|
|
50
|
-
|
|
60
|
+
const ends = new Set(cfg.exitPoints);
|
|
61
|
+
if (cfg.entryPoints.length > 0) {
|
|
62
|
+
(0, simple_visitor_1.visitCfgInOrder)(cfg.graph, [...cfg.entryPoints], node => {
|
|
63
|
+
if ((cfg.graph.outgoingEdges(node)?.size ?? 0) === 0) {
|
|
64
|
+
ends.add(node);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return checkReachFrom('exit', cfg, [...ends], simple_visitor_1.visitCfgInReverseOrder);
|
|
51
69
|
}
|
|
52
70
|
function checkEntryReachesAll(cfg) {
|
|
53
|
-
return checkReachFrom('entry', cfg, cfg.entryPoints
|
|
71
|
+
return checkReachFrom('entry', cfg, cfg.entryPoints, simple_visitor_1.visitCfgInOrder);
|
|
54
72
|
}
|
|
55
73
|
function _checkFdIOCount(cfg, dir, type, limit) {
|
|
56
74
|
const counts = new Map();
|