@eagleoutice/flowr 2.14.4 → 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 -313
- package/dataflow/environments/default-builtin-config.js +803 -1012
- package/dataflow/environments/environment.d.ts +26 -49
- package/dataflow/environments/environment.js +34 -47
- package/dataflow/environments/group-generics.d.ts +11 -2
- package/dataflow/environments/group-generics.js +22 -3
- 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 +17 -5
- 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 +49 -4
- 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 +90 -26
- package/project/sigdb/schema.js +12 -6
- 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/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 +5 -10
- package/queries/catalog/signature-query/signature-query-executor.js +87 -93
- package/queries/catalog/signature-query/signature-query-format.d.ts +20 -5
- package/queries/catalog/signature-query/signature-query-format.js +16 -4
- package/queries/catalog/signature-query/signature-query-render.js +18 -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/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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NETWORK_FUNCTIONS = void 0;
|
|
4
|
+
exports.networkFunctions = networkFunctions;
|
|
4
5
|
const linter_format_1 = require("../linter-format");
|
|
5
6
|
const function_finder_util_1 = require("./function-finder-util");
|
|
6
7
|
const linter_tags_1 = require("../linter-tags");
|
|
@@ -10,13 +11,57 @@ const source_functions_1 = require("../../queries/catalog/dependencies-query/fun
|
|
|
10
11
|
const write_functions_1 = require("../../queries/catalog/dependencies-query/function-info/write-functions");
|
|
11
12
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
12
13
|
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
13
|
-
const
|
|
14
|
+
const built_in_props_1 = require("../../dataflow/environments/built-in-props");
|
|
15
|
+
const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
|
|
16
|
+
/**
|
|
17
|
+
* What an address looks like when one is written down. A call is only a network operation for the argument it
|
|
18
|
+
* is actually handed, so this is what decides that per call site rather than the name alone.
|
|
19
|
+
*/
|
|
20
|
+
const UrlPattern = /^(https?|ftps?):\/\//;
|
|
21
|
+
/** the parameter names that mean "the address", preferred over any other resource the same call names */
|
|
22
|
+
const AddressNames = new Set(['url', 'urls', 'uri', 'href', 'link', 'address', 'repo', 'repo_spec', 'pull']);
|
|
23
|
+
/**
|
|
24
|
+
* The resource parameter of a call that carries its address: the one named like an address where the call has
|
|
25
|
+
* one, else the first resource it names. `curl_upload(file, url)` reads a file and sends it somewhere, so the
|
|
26
|
+
* address is its second parameter rather than its first.
|
|
27
|
+
*/
|
|
28
|
+
function addressParam(params) {
|
|
29
|
+
return params.find(p => AddressNames.has(p.name)) ?? params[0];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Every built-in that may reach the network, read back from the {@link DefaultBuiltinConfig}: the ones labeled
|
|
33
|
+
* {@link SemanticCallTag.Network} always do, and any call naming an {@link ArgProp.Resource} does whenever that
|
|
34
|
+
* resource is a url rather than a path -- which is what {@link UrlPattern} decides per call site. Label a
|
|
35
|
+
* built-in `Network` or give it a resource parameter and it shows up here; nothing is listed twice.
|
|
36
|
+
*/
|
|
37
|
+
function networkFunctions(index = query_fn_props_1.BuiltInIndex.default()) {
|
|
38
|
+
const resources = new Map();
|
|
39
|
+
for (const param of index.params(built_in_props_1.ArgProp.Resource)) {
|
|
40
|
+
const key = identifier_1.Identifier.toString(param.call);
|
|
41
|
+
resources.set(key, [...resources.get(key) ?? [], param]);
|
|
42
|
+
}
|
|
43
|
+
const names = new Map(index.with(built_in_props_1.SemanticCallTag.Network).map(call => [identifier_1.Identifier.toString(call), call]));
|
|
44
|
+
for (const [key, [param]] of resources) {
|
|
45
|
+
if (!names.has(key)) {
|
|
46
|
+
names.set(key, param.call);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return [...names].map(([key, name]) => {
|
|
50
|
+
const params = resources.get(key);
|
|
51
|
+
const address = params === undefined ? undefined : addressParam(params);
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
...(address === undefined ? {} : { info: { argIdx: address.index, argName: address.name, resolveValue: true } }),
|
|
55
|
+
onlyTriggerWithArgument: UrlPattern
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
14
59
|
exports.NETWORK_FUNCTIONS = {
|
|
15
60
|
createSearch: (config) => function_finder_util_1.functionFinderUtil.createSearch(config.fns.map(f => identifier_1.Identifier.is(f) ? f : f.name)),
|
|
16
61
|
processSearchResult: async (e, c, d) => {
|
|
17
62
|
const df = await d.dataflow();
|
|
18
63
|
const fnPool = new Map([
|
|
19
|
-
...
|
|
64
|
+
...read_functions_1.ReadFunctions.concat(source_functions_1.SourceFunctions, write_functions_1.WriteFunctions).map(f => [identifier_1.Identifier.toString(identifier_1.Identifier.make(f.name, f.package)), f]),
|
|
20
65
|
...c.fns.flatMap(f => identifier_1.Identifier.is(f) ? [] : f.info === undefined ? [] : [[identifier_1.Identifier.toString(f.name), { name: identifier_1.Identifier.toString(f.name), ...f.info }]])
|
|
21
66
|
]);
|
|
22
67
|
const onlyTriggerLookup = new Map(c.fns.flatMap(f => identifier_1.Identifier.is(f) ? [] : [[identifier_1.Identifier.toString(f.name), f.onlyTriggerWithArgument]]));
|
|
@@ -48,40 +93,7 @@ exports.NETWORK_FUNCTIONS = {
|
|
|
48
93
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
49
94
|
description: 'Marks network functions that execute network operations, such as downloading files or making HTTP requests.',
|
|
50
95
|
defaultConfig: {
|
|
51
|
-
fns:
|
|
52
|
-
// subset of default network functions provided by manually reviewed results from analysis based on the signature database, see the dirty-network-funcs-test branch there
|
|
53
|
-
...['oauth_endpoint', 'DELETE', 'PATCH', 'HEAD', 'GET', 'POST', 'PUT', 'BROWSE', 'RETRY', 'VERB', 'content', 'handle', 'get_callback', 'VERB'].map(f => identifier_1.Identifier.make(f, 'httr')),
|
|
54
|
-
...['read.table', 'read.csv', 'read.csv2', 'read.delim', 'read.delim2', 'download.file'].map(f => identifier_1.Identifier.make(f, 'utils')),
|
|
55
|
-
...['socketConnection', 'readRDS', 'url', 'gzcon', 'readlines', 'readLines', 'source', 'load', 'scan'].map(f => identifier_1.Identifier.make(f, 'base')),
|
|
56
|
-
...['nslookup', 'new_handle', 'multi_download', 'curl', 'curl_upload', 'curl_echo', 'curl_download', 'curl_fetch_memory'].map(f => identifier_1.Identifier.make(f, 'curl')),
|
|
57
|
-
...['read_html', 'read_xml'].map(f => identifier_1.Identifier.make(f, 'xml2')),
|
|
58
|
-
...['download_html', 'html_nodes', 'html_text'].map(f => identifier_1.Identifier.make(f, 'rvest')),
|
|
59
|
-
...['shared_drive_get', 'shared_drive_rm', 'drive_download', 'drive_get'].map(f => identifier_1.Identifier.make(f, 'googledrive')),
|
|
60
|
-
...['s3read_using', 's3write_using'].map(f => identifier_1.Identifier.make(f, 'aws.s3')),
|
|
61
|
-
...['url_filename', 'url_accessible', 'url_destination'].map(f => identifier_1.Identifier.make(f, 'xfun')),
|
|
62
|
-
...['source_url', 'source_gist'].map(f => identifier_1.Identifier.make(f, 'devtools')),
|
|
63
|
-
...['install_bioc', 'install_bitbucket', 'install_cran', 'install_dev', 'install_git', 'install_github', 'install_gitlab', 'install_svn', 'install_url', 'install_version'].flatMap(f => [identifier_1.Identifier.make(f, 'devtools'), identifier_1.Identifier.make(f, 'remotes')]),
|
|
64
|
-
...['github_pull', 'update_packages'].map(f => identifier_1.Identifier.make(f, 'remotes')),
|
|
65
|
-
...['viewer', 'getDelegatedAzureToken'].map(f => identifier_1.Identifier.make(f, 'rstudioapi')),
|
|
66
|
-
...['runGist', 'runUrl', 'httpResponse', 'session'].map(f => identifier_1.Identifier.make(f, 'shiny')),
|
|
67
|
-
...['create_from_github', 'use_git_remote', 'use_github_action', 'use_github_file', 'use_tidy_thanks'].map(f => identifier_1.Identifier.make(f, 'usethis')),
|
|
68
|
-
identifier_1.Identifier.make('copy_to', 'dplyr'),
|
|
69
|
-
identifier_1.Identifier.make('getURL', 'RCurl'),
|
|
70
|
-
identifier_1.Identifier.make('fread', 'data.table'),
|
|
71
|
-
identifier_1.Identifier.make('getForm', 'rBDAT'),
|
|
72
|
-
identifier_1.Identifier.make('fromJSON', 'jsonlite'),
|
|
73
|
-
identifier_1.Identifier.make('read.xlsx', 'openxlsx'),
|
|
74
|
-
identifier_1.Identifier.make('storage_download', 'googleCloudStorageR'),
|
|
75
|
-
identifier_1.Identifier.make('AnnotationHub', 'AnnotationHub'),
|
|
76
|
-
identifier_1.Identifier.make('ExperimentHub', 'ExperimentHub'),
|
|
77
|
-
identifier_1.Identifier.make('datasource', 'readr'),
|
|
78
|
-
identifier_1.Identifier.make('melt_csv', 'meltr'),
|
|
79
|
-
identifier_1.Identifier.make('addServer', 'rsconnect'),
|
|
80
|
-
identifier_1.Identifier.make('vroom', 'vroom'),
|
|
81
|
-
].map(f => ({
|
|
82
|
-
name: f,
|
|
83
|
-
onlyTriggerWithArgument: /^(https?|ftps?):\/\//
|
|
84
|
-
}))
|
|
96
|
+
fns: networkFunctions()
|
|
85
97
|
}
|
|
86
98
|
}
|
|
87
99
|
};
|
|
@@ -15,7 +15,7 @@ export interface NoLeakedCredentialsMetadata extends MergeableRecord {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const NO_LEAKED_CREDENTIALS: {
|
|
17
17
|
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
18
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: NoLeakedCredentialsConfig, data: import("
|
|
18
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: NoLeakedCredentialsConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
19
19
|
results: NoLeakedCredentialsResult[];
|
|
20
20
|
".meta": NoLeakedCredentialsMetadata;
|
|
21
21
|
}>;
|
|
@@ -19,7 +19,7 @@ export interface ProblematicInputsConfig extends MergeableRecord {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const PROBLEMATIC_INPUTS: {
|
|
21
21
|
readonly createSearch: (config: ProblematicInputsConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
22
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: ProblematicInputsConfig, data: import("
|
|
22
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: ProblematicInputsConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
23
23
|
results: ProblematicInputsResult[];
|
|
24
24
|
}>;
|
|
25
25
|
readonly prettyPrint: {
|
|
@@ -13,7 +13,7 @@ const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
|
|
|
13
13
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
14
14
|
const defaultConsider = [
|
|
15
15
|
'^eval$',
|
|
16
|
-
...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.
|
|
16
|
+
...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.SemanticCallTag.Process).map(n => `^${identifier_1.Identifier.getName(n)}$`)
|
|
17
17
|
];
|
|
18
18
|
const defaultPipeCommandFunctions = [
|
|
19
19
|
{ pattern: '^pdf$', argIdx: 0, argName: 'file' },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type LintingResult, LintingResultCertainty, LintingRuleCertainty } from '../linter-format';
|
|
2
2
|
import type { MergeableRecord } from '../../util/objects';
|
|
3
3
|
import type { BrandedIdentifier } from '../../dataflow/environments/identifier';
|
|
4
|
+
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
5
|
import { LintingRuleTag } from '../linter-tags';
|
|
5
6
|
export interface SeededRandomnessResult extends LintingResult {
|
|
6
7
|
function: string;
|
|
@@ -29,9 +30,9 @@ export interface SeededRandomnessMeta extends MergeableRecord {
|
|
|
29
30
|
}
|
|
30
31
|
export declare const SEEDED_RANDOMNESS: {
|
|
31
32
|
readonly createSearch: (config: SeededRandomnessConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter", "with", "filter", "with"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
32
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: SeededRandomnessConfig, data: import("
|
|
33
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: SeededRandomnessConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
33
34
|
results: {
|
|
34
|
-
involvedId:
|
|
35
|
+
involvedId: NodeId;
|
|
35
36
|
certainty: LintingResultCertainty;
|
|
36
37
|
function: BrandedIdentifier;
|
|
37
38
|
loc: [startLine: number, startColumn: number, endLine: number, endColumn: number, f?: string | undefined];
|
|
@@ -98,7 +98,7 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
98
98
|
for (const a of assignment ?? []) {
|
|
99
99
|
const argIdx = assignmentArgIndexes.get(identifier_1.Identifier.getName(a.name));
|
|
100
100
|
const dest = graph_1.FunctionArgument.getReference(a.args[argIdx]);
|
|
101
|
-
if (dest !== undefined && assignmentProducers.has(
|
|
101
|
+
if (dest !== undefined && assignmentProducers.has(node_id_1.NodeId.recoverName(dest, dataflow.graph.idMap))) {
|
|
102
102
|
// we either have arg index 0 or 1 for the assignmentProducers destination, so we select the assignment value as 1-argIdx here
|
|
103
103
|
if (isConstantArgument(dataflow.graph, a, 1 - argIdx, data.inspectContext())) {
|
|
104
104
|
const aCds = new Set(a.cds).difference(cds);
|
|
@@ -124,9 +124,13 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
124
124
|
if (cdsOfProduces.size > 0) {
|
|
125
125
|
metadata.callsWithOtherBranchProducers++;
|
|
126
126
|
}
|
|
127
|
+
/* a call within a function body is seeded by whatever its callers did first, which the control
|
|
128
|
+
flow of this body does not show: `set.seed(1); sapply(1:3, function(i) runif(1))` is seeded.
|
|
129
|
+
Only a call the program itself reaches can be stated as unseeded for certain. */
|
|
130
|
+
const nested = !dataflow.graph.isRoot(element.searchElement.node.info.id);
|
|
127
131
|
return [{
|
|
128
132
|
involvedId: element.involvedId,
|
|
129
|
-
certainty: cdsOfProduces.size > 0 ? linter_format_1.LintingResultCertainty.Uncertain : linter_format_1.LintingResultCertainty.Certain,
|
|
133
|
+
certainty: cdsOfProduces.size > 0 || nested ? linter_format_1.LintingResultCertainty.Uncertain : linter_format_1.LintingResultCertainty.Certain,
|
|
130
134
|
function: element.target,
|
|
131
135
|
loc: element.loc
|
|
132
136
|
}];
|
|
@@ -138,7 +142,7 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
138
142
|
defaultConfig: {
|
|
139
143
|
randomnessProducers: RandomnessProducers,
|
|
140
144
|
randomnessConsumers: [
|
|
141
|
-
...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.
|
|
145
|
+
...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.SemanticCallTag.Random).map(identifier_1.Identifier.getName)
|
|
142
146
|
.filter(n => !RandomnessProducers.some(p => p.name === n)),
|
|
143
147
|
'princomp', 'pointLabel', 'some', 'rbernoulli', 'rdunif', 'generateSeedVectors', 'rvonmises',
|
|
144
148
|
'rxor', 'rmvnorm', 'randomForest',
|
|
@@ -11,7 +11,7 @@ export interface SoftwareHasLicenseConfig extends MergeableRecord {
|
|
|
11
11
|
export type SoftwareHasLicenseMetadata = MergeableRecord;
|
|
12
12
|
export declare const SOFTWARE_HAS_LICENSE: {
|
|
13
13
|
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
14
|
-
readonly processSearchResult: (_elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: SoftwareHasLicenseConfig, data: import("
|
|
14
|
+
readonly processSearchResult: (_elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: SoftwareHasLicenseConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => {
|
|
15
15
|
results: SoftwareHasLicenseResult[];
|
|
16
16
|
'.meta': {};
|
|
17
17
|
};
|
|
@@ -15,7 +15,7 @@ export interface SoftwareHasTestsMetadata extends MergeableRecord {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const SOFTWARE_HAS_TESTS: {
|
|
17
17
|
readonly createSearch: (config: SoftwareHasTestsConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
18
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: SoftwareHasTestsConfig, data: import("
|
|
18
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: SoftwareHasTestsConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => {
|
|
19
19
|
results: SoftwareHasTestsResult[];
|
|
20
20
|
'.meta': {
|
|
21
21
|
testFilesFound: number;
|
|
@@ -9,7 +9,7 @@ export interface StopWithCallMetadata extends MergeableRecord {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const STOP_WITH_CALL_ARG: {
|
|
11
11
|
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"get", ["filter"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
12
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: MergeableRecord, data: import("
|
|
12
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: MergeableRecord, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
13
13
|
results: Writable<StopWithCallResult>[];
|
|
14
14
|
'.meta': StopWithCallMetadata;
|
|
15
15
|
}>;
|
|
@@ -47,7 +47,7 @@ export interface SyntaxErrorFixPattern {
|
|
|
47
47
|
export declare const SyntaxErrorFixPatterns: SyntaxErrorFixPattern[];
|
|
48
48
|
export declare const SYNTACTICALLY_VALID: {
|
|
49
49
|
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from", [], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
50
|
-
readonly processSearchResult: (_elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: SyntacticallyValidConfig, data: import("
|
|
50
|
+
readonly processSearchResult: (_elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: SyntacticallyValidConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
51
51
|
results: SyntacticallyValidResult[];
|
|
52
52
|
".meta": SyntacticallyValidMetadata;
|
|
53
53
|
}>;
|
|
@@ -13,14 +13,14 @@ export interface UnclosedConnectionMetadata extends MergeableRecord {
|
|
|
13
13
|
totalClosed: number;
|
|
14
14
|
}
|
|
15
15
|
export interface UnclosedConnectionConfig extends MergeableRecord {
|
|
16
|
-
/** functions opening a connection, besides the ones flowR states {@link
|
|
16
|
+
/** functions opening a connection, besides the ones flowR states {@link SemanticCallTag.Opens} for */
|
|
17
17
|
openFns: readonly Identifier[];
|
|
18
|
-
/** functions closing the connection they are handed, besides the ones flowR states {@link
|
|
18
|
+
/** functions closing the connection they are handed, besides the ones flowR states {@link SemanticCallTag.Closes} for */
|
|
19
19
|
closeFns: readonly Identifier[];
|
|
20
20
|
}
|
|
21
21
|
export declare const UNCLOSED_CONNECTION: {
|
|
22
22
|
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<ParentInformation, [] | FlowrSearchElement<ParentInformation>[]>>>;
|
|
23
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, config: UnclosedConnectionConfig, data: import("
|
|
23
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, config: UnclosedConnectionConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
24
24
|
results: LintingResult[];
|
|
25
25
|
'.meta': {
|
|
26
26
|
totalOpened: number;
|
|
@@ -69,7 +69,7 @@ function enclosingStatement(idMap, id) {
|
|
|
69
69
|
function closeFix(graph, open) {
|
|
70
70
|
const idMap = graph.idMap;
|
|
71
71
|
const definition = bindingOf(graph, open);
|
|
72
|
-
const name = idMap && definition !== undefined ?
|
|
72
|
+
const name = idMap && definition !== undefined ? node_id_1.NodeId.recoverName(definition, idMap) : undefined;
|
|
73
73
|
if (idMap === undefined || definition === undefined || name === undefined) {
|
|
74
74
|
return undefined;
|
|
75
75
|
}
|
|
@@ -128,13 +128,12 @@ function connectionCalls(elements, dataflow, config) {
|
|
|
128
128
|
if (stated === undefined) {
|
|
129
129
|
continue;
|
|
130
130
|
}
|
|
131
|
-
const props = stated.props ?? 0;
|
|
132
131
|
const name = identifier_1.Identifier.toString(stated.name);
|
|
133
132
|
const loc = range_1.SourceLocation.fromNode(node);
|
|
134
|
-
if (loc !== undefined && ((
|
|
133
|
+
if (loc !== undefined && (built_in_props_1.CallProps.hasAny(stated, built_in_props_1.SemanticCallTag.Opens) || opensByName?.test(name))) {
|
|
135
134
|
opens.set(node.info.id, loc);
|
|
136
135
|
}
|
|
137
|
-
else if ((
|
|
136
|
+
else if (built_in_props_1.CallProps.hasAny(stated, built_in_props_1.SemanticCallTag.Closes) || closesByName?.test(name)) {
|
|
138
137
|
const vertex = dataflow.graph.getVertex(node.info.id);
|
|
139
138
|
if (vertex_1.FunctionCallVertex.is(vertex)) {
|
|
140
139
|
closes.push([vertex, stated.sig]);
|
|
@@ -58,7 +58,7 @@ export interface UndefinedSymbolMetadata extends MergeableRecord {
|
|
|
58
58
|
*/
|
|
59
59
|
export declare const UNDEFINED_SYMBOL: {
|
|
60
60
|
readonly createSearch: (_config: UndefinedSymbolConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<ParentInformation, [] | FlowrSearchElement<ParentInformation>[]>>>;
|
|
61
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, config: UndefinedSymbolConfig, data: import("
|
|
61
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, config: UndefinedSymbolConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
62
62
|
results: UndefinedSymbolResult[];
|
|
63
63
|
'.meta': UndefinedSymbolMetadata;
|
|
64
64
|
}>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { ArgProps, PropSelector } from '../../dataflow/environments/built-in-props';
|
|
2
|
+
import { ArgProp, SemanticCallTag } from '../../dataflow/environments/built-in-props';
|
|
3
|
+
import { Identifier } from '../../dataflow/environments/identifier';
|
|
4
|
+
import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer';
|
|
5
|
+
import type { InputSources } from '../../queries/catalog/input-sources-query/simple-input-classifier';
|
|
6
|
+
import { InputType } from '../../queries/catalog/input-sources-query/simple-input-classifier';
|
|
7
|
+
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
8
|
+
import type { FlowrSearchElement } from '../../search/flowr-search';
|
|
9
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
10
|
+
import type { LintingResult } from '../linter-format';
|
|
11
|
+
import { LintingRuleCertainty } from '../linter-format';
|
|
12
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
13
|
+
/**
|
|
14
|
+
* The kinds of critical operations to check for unescaped arguments.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum UnescapedArgumentCategory {
|
|
17
|
+
/** Functions performing system commands, e.g. `system` */
|
|
18
|
+
System = "system",
|
|
19
|
+
/** Functions dynamically evaluating R code, e.g. `eval` */
|
|
20
|
+
Eval = "eval",
|
|
21
|
+
/** Functions querying databases, e.g. `DBI::dbGetQuery` */
|
|
22
|
+
Database = "database",
|
|
23
|
+
/** Functions producing raw HTML, e.g. `shiny::HTML` */
|
|
24
|
+
Html = "html",
|
|
25
|
+
/** Functions generating/running JavaScript code, e.g. `shinyjs::runjs` */
|
|
26
|
+
JavaScript = "javascript"
|
|
27
|
+
}
|
|
28
|
+
interface UnescapedArgumentsEntry {
|
|
29
|
+
/**
|
|
30
|
+
* The call properties of critical functions calls that perform a critical operation
|
|
31
|
+
* @see {@link PropSelector}
|
|
32
|
+
*/
|
|
33
|
+
readonly criticalCalls: PropSelector;
|
|
34
|
+
/**
|
|
35
|
+
* The argument properties of critical arguments of critical functions
|
|
36
|
+
* @see {@link ArgProps}
|
|
37
|
+
*/
|
|
38
|
+
readonly criticalArgs: ArgProps;
|
|
39
|
+
/**
|
|
40
|
+
* The functions that escape an unescaped argument of a critical function
|
|
41
|
+
*/
|
|
42
|
+
readonly sanitizers: readonly Identifier[];
|
|
43
|
+
/**
|
|
44
|
+
* The function to wrap an unescaped expression in as quick fix
|
|
45
|
+
* @see {@link EscapeQuickFix}
|
|
46
|
+
*/
|
|
47
|
+
readonly quickFix?: EscapeQuickFix;
|
|
48
|
+
}
|
|
49
|
+
/** A quick fix to escape an unescaped expression */
|
|
50
|
+
export interface EscapeQuickFix extends MergeableRecord {
|
|
51
|
+
/** The escape function the unescaped expression should be wrapped in */
|
|
52
|
+
readonly call: Identifier;
|
|
53
|
+
/** The role of the argument of the critical call to use as first argument for the escape function */
|
|
54
|
+
readonly firstArg?: ArgProps;
|
|
55
|
+
/** Whether the fix should only be applied to parts of the critical argument and not the whole argument */
|
|
56
|
+
readonly partsOnly?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface UnescapedArgumentsResult extends LintingResult {
|
|
59
|
+
/** The category of the critical function call */
|
|
60
|
+
readonly category: UnescapedArgumentCategory;
|
|
61
|
+
/** The identifier of the critical function call */
|
|
62
|
+
readonly function: Identifier;
|
|
63
|
+
/** The unescaped input sources reaching the critical function call */
|
|
64
|
+
readonly sources: InputSources;
|
|
65
|
+
/** The critical input types reaching the argument */
|
|
66
|
+
readonly input: readonly InputType[];
|
|
67
|
+
}
|
|
68
|
+
export interface UnescapedArgumentsMetadata extends MergeableRecord {
|
|
69
|
+
/** The number of critical arguments that were checked */
|
|
70
|
+
totalCriticalArguments: number;
|
|
71
|
+
/** The number of critical arguments that are constant or are already properly escaped */
|
|
72
|
+
totalEscapedArguments: number;
|
|
73
|
+
}
|
|
74
|
+
export interface UnescapedArgumentsConfig extends MergeableRecord {
|
|
75
|
+
/**
|
|
76
|
+
* The target, critical functions, critical arguments, sanitizers and quick fixes for each category
|
|
77
|
+
*/
|
|
78
|
+
readonly categories: Record<UnescapedArgumentCategory, UnescapedArgumentsEntry>;
|
|
79
|
+
/**
|
|
80
|
+
* The categories that should be disabled and not checked
|
|
81
|
+
* @see {@link UnescapedArgumentCategory}
|
|
82
|
+
*/
|
|
83
|
+
readonly disabledCategories: readonly UnescapedArgumentCategory[];
|
|
84
|
+
/**
|
|
85
|
+
* The input types that count as already escaped
|
|
86
|
+
* @see {@link InputType}
|
|
87
|
+
*/
|
|
88
|
+
readonly acceptedInputs: readonly InputType[];
|
|
89
|
+
/**
|
|
90
|
+
* The maximum depth to descent to find unescaped parts of an argument
|
|
91
|
+
*/
|
|
92
|
+
readonly maxDecentDepth: number;
|
|
93
|
+
}
|
|
94
|
+
export declare const UNESCAPED_ARGUMENTS: {
|
|
95
|
+
readonly createSearch: (config: UnescapedArgumentsConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], ParentInformation, import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>>;
|
|
96
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, config: UnescapedArgumentsConfig, data: ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
97
|
+
results: UnescapedArgumentsResult[];
|
|
98
|
+
'.meta': {
|
|
99
|
+
totalCriticalArguments: number;
|
|
100
|
+
totalEscapedArguments: number;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
readonly prettyPrint: {
|
|
104
|
+
readonly query: (result: UnescapedArgumentsResult) => string;
|
|
105
|
+
readonly full: (result: UnescapedArgumentsResult) => string;
|
|
106
|
+
};
|
|
107
|
+
readonly info: {
|
|
108
|
+
readonly name: "Unescaped Arguments";
|
|
109
|
+
readonly tags: readonly [LintingRuleTag.Security, LintingRuleTag.Smell, LintingRuleTag.Shiny, LintingRuleTag.QuickFix];
|
|
110
|
+
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
111
|
+
readonly description: "Detects arguments of critical system, evaluation, database, and HTML/JavaScript calls that are not properly escaped.";
|
|
112
|
+
readonly defaultConfig: {
|
|
113
|
+
readonly categories: {
|
|
114
|
+
readonly system: {
|
|
115
|
+
readonly criticalCalls: SemanticCallTag.Process;
|
|
116
|
+
readonly criticalArgs: ArgProp.Injectable;
|
|
117
|
+
readonly sanitizers: readonly [Identifier];
|
|
118
|
+
readonly quickFix: {
|
|
119
|
+
readonly call: "shQuote";
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
readonly eval: {
|
|
123
|
+
readonly criticalCalls: SemanticCallTag.Eval;
|
|
124
|
+
readonly criticalArgs: ArgProp.Injectable;
|
|
125
|
+
readonly sanitizers: readonly [Identifier, Identifier, Identifier];
|
|
126
|
+
};
|
|
127
|
+
readonly database: {
|
|
128
|
+
readonly criticalCalls: SemanticCallTag.Database;
|
|
129
|
+
readonly criticalArgs: ArgProp.Injectable;
|
|
130
|
+
readonly sanitizers: readonly [Identifier, Identifier, Identifier, Identifier, Identifier, Identifier];
|
|
131
|
+
readonly quickFix: {
|
|
132
|
+
readonly call: Identifier;
|
|
133
|
+
readonly firstArg: ArgProp.Handle;
|
|
134
|
+
readonly partsOnly: true;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly html: {
|
|
138
|
+
readonly criticalCalls: SemanticCallTag.Html;
|
|
139
|
+
readonly criticalArgs: ArgProp.Injectable;
|
|
140
|
+
readonly sanitizers: readonly [Identifier, Identifier, Identifier];
|
|
141
|
+
readonly quickFix: {
|
|
142
|
+
readonly call: Identifier;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly javascript: {
|
|
146
|
+
readonly criticalCalls: SemanticCallTag.JavaScript;
|
|
147
|
+
readonly criticalArgs: ArgProp.Injectable;
|
|
148
|
+
readonly sanitizers: readonly [Identifier, Identifier, Identifier, Identifier];
|
|
149
|
+
readonly quickFix: {
|
|
150
|
+
readonly call: Identifier;
|
|
151
|
+
readonly partsOnly: true;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly disabledCategories: readonly [];
|
|
156
|
+
readonly acceptedInputs: readonly InputType[];
|
|
157
|
+
readonly maxDecentDepth: 5;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
export {};
|