@eagleoutice/flowr 2.16.2 → 2.16.4
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 +15 -15
- package/abstract-interpretation/data-frame/arguments.js +4 -3
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1 -2
- package/abstract-interpretation/data-frame/semantics.d.ts +2 -2
- package/abstract-interpretation/data-frame/semantics.js +2 -6
- package/benchmark/slicer.js +1 -3
- package/benchmark/summarizer/first-phase/input.js +1 -12
- package/benchmark/summarizer/second-phase/process.d.ts +7 -0
- package/benchmark/summarizer/second-phase/process.js +15 -12
- package/cli/repl/commands/repl-cfg.js +18 -49
- package/cli/repl/commands/repl-clipboard.d.ts +2 -0
- package/cli/repl/commands/repl-clipboard.js +5 -0
- package/cli/repl/commands/repl-commands.js +2 -2
- package/cli/repl/commands/repl-dataflow.js +21 -55
- package/cli/repl/commands/repl-normalize.js +15 -28
- package/cli/repl/commands/repl-parse.js +2 -2
- package/cli/repl/commands/repl-query.js +10 -10
- package/cli/repl/commands/repl-signature.js +4 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +8 -30
- package/cli/repl/server/messages/message-analysis.js +1 -1
- package/config.d.ts +6 -0
- package/config.js +7 -4
- package/control-flow/cfg-dead-code.js +5 -14
- package/control-flow/cfg-to-basic-blocks.js +1 -6
- package/control-flow/control-flow-graph.d.ts +2 -16
- package/control-flow/control-flow-graph.js +8 -66
- package/control-flow/diff-cfg.js +10 -23
- package/control-flow/semantic-cfg-guided-visitor.js +5 -11
- package/control-flow/simple-visitor.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +138 -138
- package/data/r-base-packages.generated.js +0 -1
- package/data/r-base-primitives.generated.js +0 -1
- package/data/r-s3-generics.generated.d.ts +5 -0
- package/data/r-s3-generics.generated.js +103 -0
- package/dataflow/cluster.js +2 -1
- package/dataflow/environments/append.d.ts +1 -0
- package/dataflow/environments/built-in-props.d.ts +10 -0
- package/dataflow/environments/built-in-props.js +25 -1
- package/dataflow/environments/built-in.js +15 -9
- package/dataflow/environments/clone.d.ts +1 -0
- package/dataflow/environments/clone.js +1 -0
- package/dataflow/environments/default-builtin-config.d.ts +188 -14
- package/dataflow/environments/default-builtin-config.js +125 -65
- package/dataflow/environments/define.d.ts +1 -0
- package/dataflow/environments/define.js +1 -0
- package/dataflow/environments/environment.d.ts +27 -0
- package/dataflow/environments/environment.js +37 -16
- package/dataflow/environments/frame-memory.d.ts +9 -1
- package/dataflow/environments/frame-memory.js +12 -1
- package/dataflow/environments/identifier.d.ts +0 -2
- package/dataflow/environments/identifier.js +5 -7
- package/dataflow/environments/overwrite.js +1 -0
- package/dataflow/environments/query-fn-props.js +4 -4
- package/dataflow/environments/scoping.d.ts +3 -0
- package/dataflow/environments/scoping.js +3 -0
- package/dataflow/eval/resolve/alias-tracking.js +3 -3
- package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
- package/dataflow/eval/resolve/resolve-argument.js +16 -11
- package/dataflow/eval/resolve/resolve-numbers.js +5 -2
- package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
- package/dataflow/eval/resolve/resolve.js +3 -8
- package/dataflow/eval/values/intervals/interval-constants.js +1 -6
- package/dataflow/eval/values/r-value.js +1 -6
- package/dataflow/extractor.js +17 -17
- package/dataflow/fn/argument-roles.js +15 -15
- package/dataflow/fn/class-declaration.js +7 -7
- package/dataflow/fn/frame-reflection.d.ts +1 -23
- package/dataflow/fn/frame-reflection.js +8 -95
- package/dataflow/fn/function-props.d.ts +0 -3
- package/dataflow/fn/function-props.js +9 -11
- package/dataflow/fn/function-semantics.d.ts +1 -0
- package/dataflow/fn/strict-function.js +15 -14
- package/dataflow/graph/call-graph.d.ts +8 -0
- package/dataflow/graph/call-graph.js +40 -25
- package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
- package/dataflow/graph/dataflowgraph-builder.js +15 -135
- package/dataflow/graph/df-helper.d.ts +56 -4
- package/dataflow/graph/df-helper.js +116 -1
- package/dataflow/graph/diff-dataflow-graph.js +13 -15
- package/dataflow/graph/graph-helper.d.ts +20 -0
- package/dataflow/graph/graph-helper.js +18 -0
- package/dataflow/graph/graph.js +3 -8
- package/dataflow/graph/match-args.d.ts +1 -1
- package/dataflow/graph/match-args.js +3 -3
- package/dataflow/internal/linker.d.ts +4 -10
- package/dataflow/internal/linker.js +21 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
- package/dataflow/internal/process/functions/call/common.d.ts +3 -1
- package/dataflow/internal/process/functions/call/common.js +6 -7
- package/dataflow/internal/process/functions/call/deferred.js +8 -8
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
- package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
- package/dataflow/internal/process/functions/call/named-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/nse.js +4 -4
- package/dataflow/internal/process/functions/call/quoted.js +16 -14
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +2 -2
- package/dataflow/internal/process/process-named-call.js +1 -1
- package/dataflow/origin/dfg-get-origin.js +2 -2
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
- package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
- package/documentation/data/faq/wiki-faq-store.js +2 -2
- package/documentation/doc-capabilities.js +2 -1
- package/documentation/doc-util/doc-functions.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +1 -1
- package/documentation/doc-util/doc-query.js +3 -1
- package/documentation/doc-util/doc-repl.js +4 -4
- package/documentation/doc-util/doc-timings.js +3 -2
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/wiki-absint.js +2 -1
- package/documentation/wiki-cfg.js +2 -1
- package/documentation/wiki-create-linting-rules.js +2 -2
- package/documentation/wiki-dataflow-graph.js +6 -6
- package/documentation/wiki-interface.js +3 -2
- package/documentation/wiki-linter.d.ts +14 -0
- package/documentation/wiki-linter.js +353 -88
- package/documentation/wiki-mk/doc-maker.js +1 -2
- package/documentation/wiki-query.js +25 -0
- package/documentation/wiki-search.js +2 -1
- package/documentation/wiki-signature-database.js +0 -2
- package/linter/linter-executor.js +4 -0
- package/linter/linter-rules.d.ts +552 -35
- package/linter/linter-rules.js +39 -1
- package/linter/linter-tags.d.ts +6 -0
- package/linter/linter-tags.js +6 -0
- package/linter/rules/absolute-path.d.ts +1 -1
- package/linter/rules/absolute-path.js +9 -6
- package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
- package/linter/rules/cmd-check/bogus-return.js +63 -0
- package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
- package/linter/rules/cmd-check/call-arguments.js +216 -0
- package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
- package/linter/rules/cmd-check/class-string-comparison.js +135 -0
- package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
- package/linter/rules/cmd-check/cmd-check-util.js +169 -0
- package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
- package/linter/rules/cmd-check/compiled-code.js +350 -0
- package/linter/rules/cmd-check/conformance.d.ts +51 -0
- package/linter/rules/cmd-check/conformance.js +166 -0
- package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
- package/linter/rules/cmd-check/dependency-declaration.js +299 -0
- package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
- package/linter/rules/cmd-check/description-metadata.js +393 -0
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +60 -0
- package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
- package/linter/rules/cmd-check/file-checks.d.ts +29 -0
- package/linter/rules/cmd-check/file-checks.js +34 -0
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
- package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
- package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
- package/linter/rules/cmd-check/global-environment-modification.js +237 -0
- package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
- package/linter/rules/cmd-check/namespace-tampering.js +162 -0
- package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
- package/linter/rules/cmd-check/non-ascii-code.js +112 -0
- package/linter/rules/cmd-check/package-code.d.ts +30 -0
- package/linter/rules/cmd-check/package-code.js +141 -0
- package/linter/rules/cmd-check/package-data.d.ts +51 -0
- package/linter/rules/cmd-check/package-data.js +181 -0
- package/linter/rules/cmd-check/package-files.d.ts +41 -0
- package/linter/rules/cmd-check/package-files.js +157 -0
- package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
- package/linter/rules/cmd-check/package-hooks.js +173 -0
- package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
- package/linter/rules/cmd-check/package-metafiles.js +292 -0
- package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
- package/linter/rules/cmd-check/package-runtime.js +284 -0
- package/linter/rules/cmd-check/package-structure.d.ts +85 -0
- package/linter/rules/cmd-check/package-structure.js +320 -0
- package/linter/rules/cmd-check/rd-files.d.ts +83 -0
- package/linter/rules/cmd-check/rd-files.js +621 -0
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
- package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
- package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +1 -1
- package/linter/rules/dead-code.d.ts +4 -4
- package/linter/rules/dead-code.js +19 -4
- package/linter/rules/deprecated-functions.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +5 -5
- package/linter/rules/file-path-validity.d.ts +6 -2
- package/linter/rules/file-path-validity.js +7 -3
- package/linter/rules/namespace-access.d.ts +3 -3
- package/linter/rules/namespace-access.js +12 -3
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +14 -15
- package/linter/rules/network-functions.d.ts +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/no-leaked-credentials.js +5 -5
- package/linter/rules/problematic-inputs.d.ts +2 -2
- package/linter/rules/problematic-inputs.js +4 -3
- package/linter/rules/roxygen-arguments.d.ts +2 -2
- package/linter/rules/roxygen-arguments.js +2 -2
- package/linter/rules/seeded-randomness.d.ts +2 -2
- package/linter/rules/seeded-randomness.js +7 -7
- package/linter/rules/software-has-license.d.ts +3 -3
- package/linter/rules/software-has-license.js +3 -3
- package/linter/rules/software-has-tests.d.ts +2 -2
- package/linter/rules/software-has-tests.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +3 -3
- package/linter/rules/stop-with-call-arg.js +21 -4
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/syntactically-valid.js +1 -1
- package/linter/rules/unclosed-connection.d.ts +2 -2
- package/linter/rules/unclosed-connection.js +5 -5
- package/linter/rules/undefined-symbol-util.js +16 -32
- package/linter/rules/undefined-symbol.d.ts +3 -1
- package/linter/rules/undefined-symbol.js +34 -4
- package/linter/rules/unescaped-arguments.d.ts +1 -1
- package/linter/rules/unescaped-arguments.js +11 -10
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +14 -20
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/unused-import.js +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/linter/rules/useless-loop.js +1 -1
- package/package.json +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/context/flowr-analyzer-context.js +1 -1
- package/project/context/flowr-analyzer-environment-context.d.ts +2 -2
- package/project/context/flowr-analyzer-environment-context.js +2 -1
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +15 -11
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
- package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
- package/project/context/flowr-file.d.ts +4 -0
- package/project/context/flowr-file.js +4 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
- package/project/sigdb/build.js +16 -30
- package/project/sigdb/dict.d.ts +4 -6
- package/project/sigdb/dict.js +125 -31
- package/project/sigdb/reader.js +2 -18
- package/project/sigdb/sigdb-download.js +14 -23
- package/queries/base-query-format.d.ts +2 -0
- package/queries/base-query-format.js +10 -2
- package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
- package/queries/catalog/absint-query/absint-query-format.js +5 -7
- package/queries/catalog/call-context-query/call-context-query-executor.js +24 -32
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
- package/queries/catalog/config-query/config-query-format.js +3 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
- package/queries/catalog/dependencies-query/data-flow.d.ts +45 -0
- package/queries/catalog/dependencies-query/data-flow.js +179 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
- package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
- package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
- package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
- package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
- package/queries/catalog/dependencies-query/implicit-echo.js +36 -35
- package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
- package/queries/catalog/dependencies-query/link-devices.js +9 -6
- package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
- package/queries/catalog/dependencies-query/plot-description.js +119 -0
- package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
- package/queries/catalog/dependencies-query/plot-objects.js +61 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
- package/queries/catalog/dice-query/dice-query-format.js +3 -40
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.js +28 -29
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
- package/queries/catalog/linter-query/linter-query-executor.js +10 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
- package/queries/catalog/linter-query/linter-query-format.js +32 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
- package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.js +4 -5
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
- package/queries/catalog/search-query/search-query-format.js +1 -3
- package/queries/catalog/signature-query/signature-query-executor.js +3 -3
- package/queries/catalog/signature-query/signature-query-format.js +2 -2
- package/queries/catalog/slice-query-options.d.ts +16 -0
- package/queries/catalog/slice-query-options.js +28 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
- package/queries/query-print.d.ts +4 -0
- package/queries/query-print.js +17 -1
- package/queries/query.d.ts +3 -3
- package/queries/query.js +3 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
- package/r-bridge/lang-4.x/ast/model/model.js +28 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
- package/r-bridge/retriever.d.ts +0 -4
- package/r-bridge/retriever.js +0 -13
- package/r-bridge/roxygen2/documentation-provider.js +3 -7
- package/r-bridge/shell.js +3 -8
- package/reconstruct/auto-select/magic-comments.js +8 -7
- package/reconstruct/inline/source-inline-map.d.ts +3 -0
- package/reconstruct/inline/source-inline-map.js +8 -7
- package/reconstruct/reconstruct.d.ts +1 -1
- package/reconstruct/reconstruct.js +33 -109
- package/search/flowr-search-printer.js +4 -15
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/filters/all-variables.js +1 -2
- package/slicing/static/fingerprint.js +11 -2
- package/slicing/static/slice-call.d.ts +2 -8
- package/slicing/static/slice-call.js +8 -18
- package/slicing/static/static-slicer.js +81 -6
- package/util/collections/arrays.js +1 -1
- package/util/collections/set.js +1 -1
- package/util/diff-graph.d.ts +4 -0
- package/util/diff-graph.js +12 -0
- package/util/files.js +2 -6
- package/util/json.js +1 -15
- package/util/mermaid/cfg.js +10 -17
- package/util/mermaid/dfg.js +6 -8
- package/util/objects.d.ts +1 -1
- package/util/quads.js +4 -13
- package/util/r-author.js +5 -5
- package/util/range.d.ts +9 -0
- package/util/range.js +11 -0
- package/util/schema.js +3 -3
- package/util/simple-df/dfg-view.js +2 -1
- package/util/text/ansi.js +1 -2
- package/util/text/playground-link.js +2 -1
- package/util/text/r-highlight.js +2 -1
- package/util/text/strings.d.ts +2 -0
- package/util/text/strings.js +5 -0
- package/util/text/time.js +1 -2
- package/util/version.js +4 -3
- package/dataflow/fn/recursive-function.d.ts +0 -6
- package/dataflow/fn/recursive-function.js +0 -32
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FILE_PATH_VALIDITY = void 0;
|
|
4
|
+
exports.pathArgStringNode = pathArgStringNode;
|
|
4
5
|
const linter_format_1 = require("../linter-format");
|
|
5
6
|
const strings_1 = require("../../util/text/strings");
|
|
6
7
|
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
@@ -30,6 +31,7 @@ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
|
|
|
30
31
|
const resolve_argument_1 = require("../../dataflow/eval/resolve/resolve-argument");
|
|
31
32
|
const r_base_packages_1 = require("../../util/r-base-packages");
|
|
32
33
|
const secure_mode_1 = require("../../util/secure-mode");
|
|
34
|
+
const files_1 = require("../../util/files");
|
|
33
35
|
const DataSetExtensions = ['R', 'r', 'RData', 'rdata', 'rda', 'tab', 'txt', 'TXT', 'tab.gz', 'tab.bz2', 'tab.xz', 'txt.gz', 'txt.bz2', 'txt.xz', 'csv', 'CSV'];
|
|
34
36
|
function namesPackage(node) {
|
|
35
37
|
return r_function_call_1.RFunctionCall.is(node) && node.arguments.some(a => a !== r_function_call_1.EmptyArgument && a.name !== undefined && ['package', 'lib.loc'].includes(identifier_1.Identifier.getName(a.name.content)));
|
|
@@ -152,7 +154,7 @@ exports.FILE_PATH_VALIDITY = {
|
|
|
152
154
|
},
|
|
153
155
|
info: {
|
|
154
156
|
name: 'File Path Validity',
|
|
155
|
-
description: '
|
|
157
|
+
description: 'Finds file paths used in read and write operations that are invalid or do not point to existing files.',
|
|
156
158
|
// checks all found paths for whether they're valid to ensure correctness, but doesn't handle non-constant paths so not all will be returned
|
|
157
159
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
158
160
|
tags: [linter_tags_1.LintingRuleTag.Robustness, linter_tags_1.LintingRuleTag.Reproducibility, linter_tags_1.LintingRuleTag.Bug, linter_tags_1.LintingRuleTag.QuickFix],
|
|
@@ -220,11 +222,13 @@ function buildDidYouMeanFix(idMap, callId, value, found) {
|
|
|
220
222
|
/* a fix that names no place or changes nothing cannot be carried out, so none is offered */
|
|
221
223
|
return undefined;
|
|
222
224
|
}
|
|
225
|
+
/* R reads a backslash in a string as an escape, so a windows path is written with forward slashes */
|
|
226
|
+
const fixed = files_1.RPath.of(found);
|
|
223
227
|
return [{
|
|
224
228
|
type: 'replace',
|
|
225
229
|
loc,
|
|
226
|
-
description: `Replace with existing path \`${
|
|
227
|
-
replacement: str.content.quotes +
|
|
230
|
+
description: `Replace with existing path \`${fixed}\``,
|
|
231
|
+
replacement: str.content.quotes + fixed + str.content.quotes
|
|
228
232
|
}];
|
|
229
233
|
}
|
|
230
234
|
//# sourceMappingURL=file-path-validity.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type MergeableRecord } from '../../util/objects';
|
|
2
2
|
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
3
3
|
import { LintingRuleTag } from '../linter-tags';
|
|
4
4
|
/** kind of mismatch between the `::`/`:::` written and what the package actually exports */
|
|
@@ -35,8 +35,8 @@ export declare const NAMESPACE_ACCESS: {
|
|
|
35
35
|
readonly info: {
|
|
36
36
|
readonly name: "Namespace Access Validity";
|
|
37
37
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
38
|
-
readonly description: "
|
|
39
|
-
readonly tags: readonly [LintingRuleTag.Bug];
|
|
38
|
+
readonly description: "Finds `pkg:::name` where `name` is actually exported by `pkg` (so `::` would do), and `pkg::name` where the signature database knows `name` is not exported (which fails at runtime in R). Stays silent whenever the database has no definite answer for the name.";
|
|
39
|
+
readonly tags: readonly [LintingRuleTag.Bug, LintingRuleTag.QuickFix];
|
|
40
40
|
readonly defaultConfig: () => {};
|
|
41
41
|
};
|
|
42
42
|
};
|
|
@@ -5,10 +5,12 @@ const identifier_1 = require("../../dataflow/environments/identifier");
|
|
|
5
5
|
const r_symbol_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
6
6
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
7
7
|
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
8
|
+
const objects_1 = require("../../util/objects");
|
|
8
9
|
const range_1 = require("../../util/range");
|
|
9
10
|
const linter_format_1 = require("../linter-format");
|
|
10
11
|
const linter_tags_1 = require("../linter-tags");
|
|
11
12
|
const schema_1 = require("../../project/sigdb/schema");
|
|
13
|
+
const SyntacticName = /^(?:[A-Za-z]|\.(?![0-9]))[A-Za-z0-9._]*$/;
|
|
12
14
|
/**
|
|
13
15
|
* Cross-checks every `pkg::name`/`pkg:::name` against the signature database's exported bit.
|
|
14
16
|
* An absent entry (unknown package, unresolved version, uncatalogued name) is never read as "not exported" -
|
|
@@ -41,7 +43,14 @@ exports.NAMESPACE_ACCESS = {
|
|
|
41
43
|
: (raw.exported ? undefined : 'not-exported');
|
|
42
44
|
const loc = range_1.SourceLocation.fromNode(node);
|
|
43
45
|
if (kind !== undefined && loc !== undefined) {
|
|
44
|
-
|
|
46
|
+
/* a name that needs backticks is left alone, the replacement spells it plainly */
|
|
47
|
+
const operator = kind === 'unnecessary-internal' ? '::' : ':::';
|
|
48
|
+
/* the access runs from the package to the end of the name, a call around it reaches further */
|
|
49
|
+
const [startLine, startColumn] = range_1.SourceLocation.getRange(loc);
|
|
50
|
+
const own = range_1.SourceRange.ownFromNode(node);
|
|
51
|
+
const access = own === undefined ? undefined : range_1.SourceLocation.from([startLine, startColumn, own[2], own[3]], node.info.file);
|
|
52
|
+
const quickFix = SyntacticName.test(name) && access !== undefined ? [{ type: 'replace', loc: access, description: `Use \`${pkg}${operator}${name}\``, replacement: `${pkg}${operator}${name}` }] : undefined;
|
|
53
|
+
results.push((0, objects_1.compactRecord)({ certainty: linter_format_1.LintingResultCertainty.Certain, involvedId: node.info.id, loc, pkg, name, kind, quickFix }));
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
return { results, '.meta': { unresolved } };
|
|
@@ -58,8 +67,8 @@ exports.NAMESPACE_ACCESS = {
|
|
|
58
67
|
info: {
|
|
59
68
|
name: 'Namespace Access Validity',
|
|
60
69
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
61
|
-
description: '
|
|
62
|
-
tags: [linter_tags_1.LintingRuleTag.Bug],
|
|
70
|
+
description: 'Finds `pkg:::name` where `name` is actually exported by `pkg` (so `::` would do), and `pkg::name` where the signature database knows `name` is not exported (which fails at runtime in R). Stays silent whenever the database has no definite answer for the name.',
|
|
71
|
+
tags: [linter_tags_1.LintingRuleTag.Bug, linter_tags_1.LintingRuleTag.QuickFix],
|
|
63
72
|
defaultConfig: () => ({})
|
|
64
73
|
}
|
|
65
74
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
1
2
|
import type { DataflowGraph } from '../../dataflow/graph/graph';
|
|
2
|
-
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import type { MergeableRecord } from '../../util/objects';
|
|
4
4
|
import { type LintingResult, type LintQuickFixReplacement, LintingRuleCertainty } from '../linter-format';
|
|
5
5
|
import { LintingRuleTag } from '../linter-tags';
|
|
@@ -72,7 +72,7 @@ export declare const NAMING_CONVENTION: {
|
|
|
72
72
|
readonly info: {
|
|
73
73
|
readonly name: "Naming Convention";
|
|
74
74
|
readonly certainty: LintingRuleCertainty.OverApproximative;
|
|
75
|
-
readonly description: "
|
|
75
|
+
readonly description: "Finds symbols that do not follow the naming convention of the code.";
|
|
76
76
|
readonly tags: readonly [LintingRuleTag.Style, LintingRuleTag.QuickFix];
|
|
77
77
|
readonly activeByDefault: false;
|
|
78
78
|
readonly defaultConfig: () => {
|
|
@@ -6,14 +6,16 @@ exports.detectCasing = detectCasing;
|
|
|
6
6
|
exports.getMostUsedCasing = getMostUsedCasing;
|
|
7
7
|
exports.fixCasing = fixCasing;
|
|
8
8
|
exports.createNamingConventionQuickFixes = createNamingConventionQuickFixes;
|
|
9
|
+
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
10
|
+
const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
9
11
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
10
|
-
const dfg_get_symbol_refs_1 = require("../../dataflow/origin/dfg-get-symbol-refs");
|
|
11
12
|
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
12
13
|
const assert_1 = require("../../util/assert");
|
|
13
14
|
const range_1 = require("../../util/range");
|
|
14
15
|
const linter_format_1 = require("../linter-format");
|
|
15
16
|
const linter_tags_1 = require("../linter-tags");
|
|
16
17
|
const unused_definition_1 = require("./unused-definition");
|
|
18
|
+
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
17
19
|
var CasingConvention;
|
|
18
20
|
(function (CasingConvention) {
|
|
19
21
|
CasingConvention["CamelCase"] = "camelCase";
|
|
@@ -122,22 +124,18 @@ function fixCasing(identifier, convention, ignorePrefix) {
|
|
|
122
124
|
(0, assert_1.assertUnreachable)(convention);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
function unquoteName(lexeme) {
|
|
126
|
-
const quoted = /^(["'`])(.*)\1$/s.exec(lexeme);
|
|
127
|
-
return quoted ? { quote: quoted[1], name: quoted[2] } : { quote: '', name: lexeme };
|
|
128
|
-
}
|
|
129
127
|
/**
|
|
130
128
|
* Creates quick fixes for renaming all references to the given node to match the provided replacement.
|
|
131
129
|
*/
|
|
132
130
|
function createNamingConventionQuickFixes(graph, nodeId, replacement, conv) {
|
|
133
|
-
const refs =
|
|
131
|
+
const refs = df_helper_1.Dataflow.refsToSymbol(graph, nodeId);
|
|
134
132
|
const idMap = graph.idMap;
|
|
135
133
|
if (refs === undefined || idMap === undefined) {
|
|
136
134
|
return undefined;
|
|
137
135
|
}
|
|
138
136
|
/* the name as it is written, which is the only text a rename may overwrite */
|
|
139
|
-
const lexeme =
|
|
140
|
-
const original = lexeme === undefined ? undefined :
|
|
137
|
+
const lexeme = node_id_1.NodeId.recoverName(nodeId, idMap);
|
|
138
|
+
const original = lexeme === undefined ? undefined : r_string_1.RString.splitQuotes(lexeme).content;
|
|
141
139
|
if (original === undefined || original === replacement) {
|
|
142
140
|
/* a replacement equal to what is already there is no fix at all */
|
|
143
141
|
return undefined;
|
|
@@ -145,19 +143,20 @@ function createNamingConventionQuickFixes(graph, nodeId, replacement, conv) {
|
|
|
145
143
|
const result = [];
|
|
146
144
|
for (const ref of refs) {
|
|
147
145
|
const node = idMap.get(ref);
|
|
148
|
-
const written = node?.lexeme === undefined ? undefined :
|
|
149
|
-
if (node?.lexeme === undefined || written?.
|
|
146
|
+
const written = node?.lexeme === undefined ? undefined : r_string_1.RString.splitQuotes(node.lexeme);
|
|
147
|
+
if (node?.lexeme === undefined || written?.content !== original) {
|
|
150
148
|
/* a reference reached through something else, as `myfield(x) <- v` reaches `x` through the call it
|
|
151
149
|
names, sits at a place holding another name, and writing over it would rename that one instead */
|
|
152
150
|
continue;
|
|
153
151
|
}
|
|
152
|
+
const quote = written.quote ?? '';
|
|
154
153
|
const loc = range_1.SourceLocation.fromNode(node);
|
|
155
154
|
if (loc) {
|
|
156
155
|
// In case of a function call we only need to include the name, not the '()'
|
|
157
156
|
loc[3] = loc[1] + node.lexeme.length - 1;
|
|
158
157
|
result.push({
|
|
159
158
|
type: 'replace',
|
|
160
|
-
replacement: `${
|
|
159
|
+
replacement: `${quote}${replacement}${quote}`,
|
|
161
160
|
description: `Rename to match naming convention ${conv}`,
|
|
162
161
|
loc
|
|
163
162
|
});
|
|
@@ -173,7 +172,7 @@ exports.NAMING_CONVENTION = {
|
|
|
173
172
|
const called = (0, unused_definition_1.collectCalledNames)(dataflow.graph);
|
|
174
173
|
const symbols = elements.getElements()
|
|
175
174
|
.map(m => {
|
|
176
|
-
const name =
|
|
175
|
+
const name = r_string_1.RString.splitQuotes(m.node.lexeme).content;
|
|
177
176
|
return {
|
|
178
177
|
certainty: linter_format_1.LintingResultCertainty.Certain,
|
|
179
178
|
detectedCasing: detectCasing(name, config.ignorePrefix),
|
|
@@ -188,8 +187,8 @@ exports.NAMING_CONVENTION = {
|
|
|
188
187
|
const unambiguous = symbols.filter(s => detectPotentialCasings(s.name, config.ignorePrefix).length === 1);
|
|
189
188
|
const casing = config.caseing === 'auto' ? getMostUsedCasing(unambiguous) : config.caseing;
|
|
190
189
|
const taken = new Set(dataflow.graph.vertices(true).map(([id]) => {
|
|
191
|
-
const lexeme = dataflow.graph.idMap
|
|
192
|
-
return lexeme === undefined ? undefined :
|
|
190
|
+
const lexeme = node_id_1.NodeId.recoverName(id, dataflow.graph.idMap);
|
|
191
|
+
return lexeme === undefined ? undefined : r_string_1.RString.splitQuotes(lexeme).content;
|
|
193
192
|
}));
|
|
194
193
|
const results = casing === CasingConvention.Unknown ? [] : symbols
|
|
195
194
|
/* a name that already reads as the wanted convention is no violation, whatever else it could also be
|
|
@@ -222,7 +221,7 @@ exports.NAMING_CONVENTION = {
|
|
|
222
221
|
name: 'Naming Convention',
|
|
223
222
|
// detects casing heuristically so correctness is not ensured using default config, but checks all identifiers in the code for naming convention match
|
|
224
223
|
certainty: linter_format_1.LintingRuleCertainty.OverApproximative,
|
|
225
|
-
description: '
|
|
224
|
+
description: 'Finds symbols that do not follow the naming convention of the code.',
|
|
226
225
|
tags: [linter_tags_1.LintingRuleTag.Style, linter_tags_1.LintingRuleTag.QuickFix],
|
|
227
226
|
// heuristic and noisy on real package code, so only run when requested explicitly
|
|
228
227
|
activeByDefault: false,
|
|
@@ -51,7 +51,7 @@ export declare const NETWORK_FUNCTIONS: {
|
|
|
51
51
|
readonly name: "Network Functions";
|
|
52
52
|
readonly tags: readonly [LintingRuleTag.Reproducibility, LintingRuleTag.Security, LintingRuleTag.Performance, LintingRuleTag.Smell];
|
|
53
53
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
54
|
-
readonly description: "
|
|
54
|
+
readonly description: "Finds functions that execute network operations, such as downloading files or making HTTP requests.";
|
|
55
55
|
readonly defaultConfig: (ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext) => {
|
|
56
56
|
fns: NetworkFunction[];
|
|
57
57
|
};
|
|
@@ -96,7 +96,7 @@ exports.NETWORK_FUNCTIONS = {
|
|
|
96
96
|
tags: [linter_tags_1.LintingRuleTag.Reproducibility, linter_tags_1.LintingRuleTag.Security, linter_tags_1.LintingRuleTag.Performance, linter_tags_1.LintingRuleTag.Smell],
|
|
97
97
|
// ensures all network functions found are actually network functions through its limited config, but doesn't find all network functions since the config is pre-crawled, and the DFG may be over-approximated
|
|
98
98
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
99
|
-
description: '
|
|
99
|
+
description: 'Finds functions that execute network operations, such as downloading files or making HTTP requests.',
|
|
100
100
|
defaultConfig: ctx => ({
|
|
101
101
|
fns: ctx.env.deriveFromIndex(networkFunctions)
|
|
102
102
|
})
|
|
@@ -29,7 +29,7 @@ export declare const NO_LEAKED_CREDENTIALS: {
|
|
|
29
29
|
};
|
|
30
30
|
readonly info: {
|
|
31
31
|
readonly name: "No Leaked Credentials";
|
|
32
|
-
readonly description: "
|
|
32
|
+
readonly description: "Finds hardcoded credentials assigned to variables or passed as arguments whose names suggest they hold passwords, tokens, or API keys, handed to authentication functions, or whose values match known credential formats (AWS, GitHub, Slack, Stripe, Google, JWT, SSH, URLs with passwords).";
|
|
33
33
|
readonly tags: readonly [LintingRuleTag.Security, LintingRuleTag.Experimental, LintingRuleTag.Smell];
|
|
34
34
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
35
35
|
readonly defaultConfig: () => {
|
|
@@ -12,9 +12,9 @@ const r_access_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-access");
|
|
|
12
12
|
const r_argument_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
13
13
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
14
14
|
const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
15
|
-
const frame_reflection_1 = require("../../dataflow/fn/frame-reflection");
|
|
16
15
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
17
16
|
const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
17
|
+
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
18
18
|
const defaultCredentialNamePattern = '(?:passw(?:or)?d|authorization|passphrase|(?:^|[_.])pass(?:$|[_.])|pwd|secret|api[_.]?key|access[_.]?key|(?:^|[_.])token$|api[_.]?token|access[_.]?token|auth[_.]?token|bearer[_.]?token|private[_.]?key|credential|(?:^|[_.])pat$)';
|
|
19
19
|
const defaultCredentialCallPattern = '(?:auth|login|signin|credential|password|secret|token|key_?set)';
|
|
20
20
|
const defaultCredentialValuePattern = '(?:(?<![A-Za-z0-9_])|(?<=\\\\[nrt]))(?:' +
|
|
@@ -80,11 +80,11 @@ class CredentialContexts {
|
|
|
80
80
|
if (r_function_definition_1.RFunctionDefinition.is(current)) {
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
|
-
const fn = r_function_call_1.RFunctionCall.
|
|
83
|
+
const fn = r_function_call_1.RFunctionCall.calledName(current) ?? '';
|
|
84
84
|
const name = identifier_1.Identifier.getName(fn);
|
|
85
85
|
/* only a value built from its arguments carries a literal on to where it is assigned, `assign` assigns its own */
|
|
86
86
|
const opaque = r_function_call_1.RFunctionCall.is(current) && r_argument_1.RArgument.is(child) && !this.pure.has(identifier_1.Identifier.getNamespace(fn) === undefined ? name : identifier_1.Identifier.toString(fn));
|
|
87
|
-
for (const def of
|
|
87
|
+
for (const def of df_helper_1.Dataflow.sourcesOf(this.dfg, current.info.id, edge_1.EdgeType.DefinedBy)) {
|
|
88
88
|
const defNode = this.idMap.get(def);
|
|
89
89
|
if (defNode !== undefined && vertex_1.DfgVertex.isVariableDefinition(this.dfg.getVertex(def)) && !seen.has(def) && (!opaque || model_1.RNode.iterateParents(defNode, this.idMap).some(p => p === current))) {
|
|
90
90
|
seen.add(def);
|
|
@@ -108,7 +108,7 @@ class CredentialContexts {
|
|
|
108
108
|
return found;
|
|
109
109
|
}
|
|
110
110
|
usesOf(def, hops, seen) {
|
|
111
|
-
return hops >= MaxCredentialHops ? [] :
|
|
111
|
+
return hops >= MaxCredentialHops ? [] : df_helper_1.Dataflow.sourcesOf(this.dfg, def, edge_1.EdgeType.Reads).flatMap(r => {
|
|
112
112
|
const reader = this.idMap.get(r);
|
|
113
113
|
return reader === undefined ? [] : this.of(reader, hops + 1, seen);
|
|
114
114
|
});
|
|
@@ -156,7 +156,7 @@ exports.NO_LEAKED_CREDENTIALS = {
|
|
|
156
156
|
},
|
|
157
157
|
info: {
|
|
158
158
|
name: 'No Leaked Credentials',
|
|
159
|
-
description: '
|
|
159
|
+
description: 'Finds hardcoded credentials assigned to variables or passed as arguments whose names suggest they hold passwords, tokens, or API keys, handed to authentication functions, or whose values match known credential formats (AWS, GitHub, Slack, Stripe, Google, JWT, SSH, URLs with passwords).',
|
|
160
160
|
tags: [linter_tags_1.LintingRuleTag.Security, linter_tags_1.LintingRuleTag.Experimental, linter_tags_1.LintingRuleTag.Smell],
|
|
161
161
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
162
162
|
defaultConfig: () => ({
|
|
@@ -28,8 +28,8 @@ export declare const PROBLEMATIC_INPUTS: {
|
|
|
28
28
|
readonly full: (result: ProblematicInputsResult) => string;
|
|
29
29
|
};
|
|
30
30
|
readonly info: {
|
|
31
|
-
readonly name: "Problematic
|
|
32
|
-
readonly description: "
|
|
31
|
+
readonly name: "Problematic Inputs";
|
|
32
|
+
readonly description: "Finds dynamic calls (e.g. eval, system) with non-constant inputs, and graphics-device calls (pdf, postscript) where a filename starts with '|' indicating a pipe command injection.";
|
|
33
33
|
readonly tags: readonly [LintingRuleTag.Security, LintingRuleTag.Smell, LintingRuleTag.Readability, LintingRuleTag.Performance];
|
|
34
34
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
35
35
|
readonly defaultConfig: (ctx: ReadOnlyFlowrAnalyzerContext) => {
|
|
@@ -14,12 +14,13 @@ const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
|
14
14
|
const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
|
|
15
15
|
const built_in_props_1 = require("../../dataflow/environments/built-in-props");
|
|
16
16
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
17
|
+
const strings_1 = require("../../util/text/strings");
|
|
17
18
|
const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
|
|
18
19
|
const resolve_argument_1 = require("../../dataflow/eval/resolve/resolve-argument");
|
|
19
20
|
/** what runs a command, and what evaluates code beyond looking up a name (`get`) or calling a function it is handed (`do.call`) */
|
|
20
21
|
function defaultConsider(index) {
|
|
21
22
|
const evaluates = index.with(built_in_props_1.SemanticCallTag.Eval).filter(n => ((index.propsOf(n) ?? 0) & built_in_props_1.CallProp.Pure) === 0 && !index.get(n)?.sig?.some(([, p]) => (p & built_in_props_1.ArgProp.Callee) !== 0));
|
|
22
|
-
return [...index.with(built_in_props_1.SemanticCallTag.Process), ...evaluates].map(n => `^${
|
|
23
|
+
return [...index.with(built_in_props_1.SemanticCallTag.Process), ...evaluates].map(n => `^${(0, strings_1.escapeRegex)(identifier_1.Identifier.getName(n))}$`).concat('^fread$');
|
|
23
24
|
}
|
|
24
25
|
const defaultPipeCommandFunctions = [
|
|
25
26
|
{ pattern: '^pdf$', argIdx: 0, argName: 'file' },
|
|
@@ -135,8 +136,8 @@ exports.PROBLEMATIC_INPUTS = {
|
|
|
135
136
|
}
|
|
136
137
|
},
|
|
137
138
|
info: {
|
|
138
|
-
name: 'Problematic
|
|
139
|
-
description: '
|
|
139
|
+
name: 'Problematic Inputs',
|
|
140
|
+
description: 'Finds dynamic calls (e.g. eval, system) with non-constant inputs, and graphics-device calls (pdf, postscript) where a filename starts with \'|\' indicating a pipe command injection.',
|
|
140
141
|
tags: [linter_tags_1.LintingRuleTag.Security, linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Readability, linter_tags_1.LintingRuleTag.Performance],
|
|
141
142
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
142
143
|
defaultConfig: ctx => ({
|
|
@@ -25,9 +25,9 @@ export declare const ROXYGEN_ARGS: {
|
|
|
25
25
|
};
|
|
26
26
|
readonly info: {
|
|
27
27
|
readonly name: "Roxygen Arguments";
|
|
28
|
-
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Documentation
|
|
28
|
+
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Documentation];
|
|
29
29
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
30
|
-
readonly description: "
|
|
30
|
+
readonly description: "Finds function parameters the roxygen documentation leaves out, and documented parameters the function does not have.";
|
|
31
31
|
readonly defaultConfig: () => {};
|
|
32
32
|
};
|
|
33
33
|
};
|
|
@@ -60,9 +60,9 @@ exports.ROXYGEN_ARGS = {
|
|
|
60
60
|
},
|
|
61
61
|
info: {
|
|
62
62
|
name: 'Roxygen Arguments',
|
|
63
|
-
tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Documentation
|
|
63
|
+
tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Documentation],
|
|
64
64
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
65
|
-
description: '
|
|
65
|
+
description: 'Finds function parameters the roxygen documentation leaves out, and documented parameters the function does not have.',
|
|
66
66
|
defaultConfig: () => ({})
|
|
67
67
|
}
|
|
68
68
|
};
|
|
@@ -51,10 +51,10 @@ export declare const SEEDED_RANDOMNESS: {
|
|
|
51
51
|
})[];
|
|
52
52
|
randomnessConsumers: string[];
|
|
53
53
|
};
|
|
54
|
-
readonly tags: readonly [LintingRuleTag.Robustness, LintingRuleTag.Reproducibility];
|
|
54
|
+
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Robustness, LintingRuleTag.Reproducibility];
|
|
55
55
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
56
56
|
readonly name: "Seeded Randomness";
|
|
57
|
-
readonly description: "
|
|
57
|
+
readonly description: "Finds randomness-based function calls not preceded by a random seed generation function. For consistent reproducibility, functions that use randomness should only be called after a constant random seed is set using a function like `set.seed`.";
|
|
58
58
|
};
|
|
59
59
|
readonly prettyPrint: {
|
|
60
60
|
readonly query: (result: SeededRandomnessResult, _meta: SeededRandomnessMeta) => string;
|
|
@@ -18,13 +18,13 @@ const r_value_1 = require("../../dataflow/eval/values/r-value");
|
|
|
18
18
|
const info_1 = require("../../dataflow/info");
|
|
19
19
|
const built_in_proc_name_1 = require("../../dataflow/environments/built-in-proc-name");
|
|
20
20
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
21
|
-
const frame_reflection_1 = require("../../dataflow/fn/frame-reflection");
|
|
22
21
|
const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
|
|
23
22
|
const function_semantics_1 = require("../../dataflow/fn/function-semantics");
|
|
24
23
|
const logic_1 = require("../../util/logic");
|
|
25
24
|
const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
26
25
|
const built_in_props_1 = require("../../dataflow/environments/built-in-props");
|
|
27
26
|
const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
|
|
27
|
+
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
28
28
|
exports.SEEDED_RANDOMNESS = {
|
|
29
29
|
createSearch: config => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall)
|
|
30
30
|
.with(search_enrichers_1.Enrichment.CallTargets, {
|
|
@@ -81,13 +81,13 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
81
81
|
return loops.some(loop => writerCds?.some(cd => info_1.ControlDependency.same(cd, loop)));
|
|
82
82
|
};
|
|
83
83
|
/** a call of a draw by another name, like a parameter `f` bound to `runif` */
|
|
84
|
-
const drawsThrough = (call) =>
|
|
84
|
+
const drawsThrough = (call) => df_helper_1.Dataflow.targetsOf(graph, call, edge_1.EdgeType.Calls).some(t => node_id_1.NodeId.isBuiltIn(t) && consumers.has(node_id_1.NodeId.fromBuiltIn(t))) ? 'draw' : undefined;
|
|
85
85
|
/** the writes a draw reads the generator state from: its own, and those of the calls running the function it sits in, which link what was written before them */
|
|
86
86
|
const statesReadBy = (id) => {
|
|
87
87
|
const within = idMap === undefined ? undefined : model_1.RNode.findEnclosing(id, idMap, r_function_definition_1.RFunctionDefinition.is);
|
|
88
|
-
const callers = within === undefined ? [] :
|
|
89
|
-
const ownReads =
|
|
90
|
-
return [...ownReads, ...callers.flatMap(c =>
|
|
88
|
+
const callers = within === undefined ? [] : df_helper_1.Dataflow.sourcesOf(graph, within, edge_1.EdgeType.Calls);
|
|
89
|
+
const ownReads = df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedByOnCall);
|
|
90
|
+
return [...ownReads, ...callers.flatMap(c => df_helper_1.Dataflow.targetsOf(graph, c, edge_1.EdgeType.DefinedByOnCall))];
|
|
91
91
|
};
|
|
92
92
|
/** follows the draws behind the generator state `id` reads back to where it was seeded */
|
|
93
93
|
const collectSeeding = (id, visiting, seeding) => {
|
|
@@ -179,11 +179,11 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
179
179
|
'permuted', 'permute', 'shuffle', 'shuffleSet', 'data_shuffle', 'sample_frac', 'sample_n',
|
|
180
180
|
],
|
|
181
181
|
}),
|
|
182
|
-
tags: [linter_tags_1.LintingRuleTag.Robustness, linter_tags_1.LintingRuleTag.Reproducibility],
|
|
182
|
+
tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Robustness, linter_tags_1.LintingRuleTag.Reproducibility],
|
|
183
183
|
// only finds proper randomness producers and consumers due to its config, but will not find all producers/consumers since not all existing deprecated functions will be in the config
|
|
184
184
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
185
185
|
name: 'Seeded Randomness',
|
|
186
|
-
description: '
|
|
186
|
+
description: 'Finds randomness-based function calls not preceded by a random seed generation function. For consistent reproducibility, functions that use randomness should only be called after a constant random seed is set using a function like `set.seed`.'
|
|
187
187
|
},
|
|
188
188
|
prettyPrint: {
|
|
189
189
|
[linter_format_1.LintingPrettyPrintContext.Query]: (result, _meta) => `Function \`${result.function}\` at ${range_1.SourceLocation.format(result.loc)}`,
|
|
@@ -10,7 +10,7 @@ export interface SoftwareHasLicenseConfig extends MergeableRecord {
|
|
|
10
10
|
}
|
|
11
11
|
export type SoftwareHasLicenseMetadata = MergeableRecord;
|
|
12
12
|
export declare const SOFTWARE_HAS_LICENSE: {
|
|
13
|
-
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from
|
|
13
|
+
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>[]>>;
|
|
14
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': {};
|
|
@@ -21,8 +21,8 @@ export declare const SOFTWARE_HAS_LICENSE: {
|
|
|
21
21
|
};
|
|
22
22
|
readonly info: {
|
|
23
23
|
readonly name: "Software Has License";
|
|
24
|
-
readonly description: "
|
|
25
|
-
readonly tags: readonly [LintingRuleTag.Documentation, LintingRuleTag.Usability];
|
|
24
|
+
readonly description: "Finds software projects without a license (a LICENSE file or the License field of the DESCRIPTION).";
|
|
25
|
+
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Documentation, LintingRuleTag.Usability];
|
|
26
26
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
27
27
|
readonly defaultConfig: () => {
|
|
28
28
|
checkDescriptionFile: true;
|
|
@@ -8,7 +8,7 @@ const linter_tags_1 = require("../linter-tags");
|
|
|
8
8
|
const flowr_file_1 = require("../../project/context/flowr-file");
|
|
9
9
|
const flowr_description_file_1 = require("../../project/plugins/file-plugins/files/flowr-description-file");
|
|
10
10
|
exports.SOFTWARE_HAS_LICENSE = {
|
|
11
|
-
createSearch: () => flowr_search_builder_1.Q.
|
|
11
|
+
createSearch: () => flowr_search_builder_1.Q.from([]),
|
|
12
12
|
processSearchResult: (_elements, config, data) => {
|
|
13
13
|
const ctx = data.inspectContext();
|
|
14
14
|
const licenseFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.License);
|
|
@@ -35,8 +35,8 @@ exports.SOFTWARE_HAS_LICENSE = {
|
|
|
35
35
|
},
|
|
36
36
|
info: {
|
|
37
37
|
name: 'Software Has License',
|
|
38
|
-
description: '
|
|
39
|
-
tags: [linter_tags_1.LintingRuleTag.Documentation, linter_tags_1.LintingRuleTag.Usability],
|
|
38
|
+
description: 'Finds software projects without a license (a LICENSE file or the License field of the DESCRIPTION).',
|
|
39
|
+
tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Documentation, linter_tags_1.LintingRuleTag.Usability],
|
|
40
40
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
41
41
|
defaultConfig: () => ({
|
|
42
42
|
checkDescriptionFile: true
|
|
@@ -28,8 +28,8 @@ export declare const SOFTWARE_HAS_TESTS: {
|
|
|
28
28
|
};
|
|
29
29
|
readonly info: {
|
|
30
30
|
readonly name: "Software Has Tests";
|
|
31
|
-
readonly description: "
|
|
32
|
-
readonly tags: readonly [LintingRuleTag.Usability, LintingRuleTag.Reproducibility];
|
|
31
|
+
readonly description: "Finds software projects without tests (test files in a test directory or test function calls in R code).";
|
|
32
|
+
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Usability, LintingRuleTag.Reproducibility];
|
|
33
33
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
34
34
|
readonly defaultConfig: () => {
|
|
35
35
|
additionalTestFunctions: never[];
|
|
@@ -37,8 +37,8 @@ exports.SOFTWARE_HAS_TESTS = {
|
|
|
37
37
|
},
|
|
38
38
|
info: {
|
|
39
39
|
name: 'Software Has Tests',
|
|
40
|
-
description: '
|
|
41
|
-
tags: [linter_tags_1.LintingRuleTag.Usability, linter_tags_1.LintingRuleTag.Reproducibility],
|
|
40
|
+
description: 'Finds software projects without tests (test files in a test directory or test function calls in R code).',
|
|
41
|
+
tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Usability, linter_tags_1.LintingRuleTag.Reproducibility],
|
|
42
42
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
43
43
|
defaultConfig: () => ({
|
|
44
44
|
additionalTestFunctions: []
|
|
@@ -20,10 +20,10 @@ export declare const STOP_WITH_CALL_ARG: {
|
|
|
20
20
|
readonly full: (result: LintingResult) => string;
|
|
21
21
|
};
|
|
22
22
|
readonly info: {
|
|
23
|
-
readonly name: "Stop
|
|
24
|
-
readonly tags: readonly [LintingRuleTag.Smell];
|
|
23
|
+
readonly name: "Stop Without Call";
|
|
24
|
+
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.QuickFix];
|
|
25
25
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
26
|
-
readonly description: "
|
|
26
|
+
readonly description: "Finds `stop()` calls that do not set `call.` to `FALSE`.";
|
|
27
27
|
readonly defaultConfig: () => {};
|
|
28
28
|
};
|
|
29
29
|
};
|
|
@@ -15,6 +15,7 @@ const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
|
15
15
|
const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
|
|
16
16
|
const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
17
17
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
18
|
+
const r_logical_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-logical");
|
|
18
19
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
19
20
|
const ConditionConstructors = new Set(['simpleCondition', 'simpleError', 'simpleWarning', 'simpleMessage', 'errorCondition', 'warningCondition']);
|
|
20
21
|
/** whether the call builds a condition object, for which `stop` ignores `call.`: a constructor, or a class naming `condition` */
|
|
@@ -26,6 +27,21 @@ function isConditionObject(signaled, graph, data) {
|
|
|
26
27
|
const classes = vertex_1.DfgVertex.isFunctionCall(vertex) ? (0, resolve_argument_1.getArgumentStringValue)(data.flowrConfig.solver.variables, graph, vertex, undefined, 'class', true, data.inspectContext()) : undefined;
|
|
27
28
|
return classes?.values().some(c => c.has('condition')) ?? false;
|
|
28
29
|
}
|
|
30
|
+
/** `call. = FALSE` added before the closing parenthesis, or a literal `call. = TRUE` turned into it */
|
|
31
|
+
function callFalseFix(call) {
|
|
32
|
+
const args = call.arguments.filter(a => a !== r_function_call_1.EmptyArgument);
|
|
33
|
+
const given = args.find(a => a.name !== undefined && identifier_1.Identifier.getName(a.name.content) === 'call.');
|
|
34
|
+
if (given !== undefined) {
|
|
35
|
+
const loc = range_1.SourceLocation.fromNode(given.value);
|
|
36
|
+
return loc !== undefined && r_logical_1.RLogical.is(given.value) ? [{ type: 'replace', loc, description: 'Set `call.` to `FALSE`', replacement: 'FALSE' }] : undefined;
|
|
37
|
+
}
|
|
38
|
+
const loc = range_1.SourceLocation.fromNode(call);
|
|
39
|
+
if (loc === undefined) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const [, , endLine, endColumn] = range_1.SourceLocation.getRange(loc);
|
|
43
|
+
return [{ type: 'replace', loc: range_1.SourceLocation.from([endLine, endColumn, endLine, endColumn - 1], range_1.SourceLocation.getFile(loc)), description: 'Add `call. = FALSE`', replacement: args.length === 0 ? 'call. = FALSE' : ', call. = FALSE' }];
|
|
44
|
+
}
|
|
29
45
|
exports.STOP_WITH_CALL_ARG = {
|
|
30
46
|
createSearch: () => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall),
|
|
31
47
|
processSearchResult: async (elements, _config, data) => {
|
|
@@ -68,7 +84,8 @@ exports.STOP_WITH_CALL_ARG = {
|
|
|
68
84
|
.map(element => ({
|
|
69
85
|
certainty: linter_format_1.LintingResultCertainty.Uncertain,
|
|
70
86
|
involvedId: element.node.info.id,
|
|
71
|
-
loc: range_1.SourceLocation.fromNode(element.node)
|
|
87
|
+
loc: range_1.SourceLocation.fromNode(element.node),
|
|
88
|
+
quickFix: callFalseFix(element.node)
|
|
72
89
|
}))
|
|
73
90
|
.filter(element => (0, assert_1.isNotUndefined)(element.loc)),
|
|
74
91
|
'.meta': meta
|
|
@@ -79,10 +96,10 @@ exports.STOP_WITH_CALL_ARG = {
|
|
|
79
96
|
[linter_format_1.LintingPrettyPrintContext.Full]: result => `\`stop()\` at ${range_1.SourceLocation.format(result.loc)} is called without \`call. = FALSE\`; the originating call is then appended to the error message, which is usually not intended - pass \`call. = FALSE\` to suppress it`,
|
|
80
97
|
},
|
|
81
98
|
info: {
|
|
82
|
-
name: 'Stop
|
|
83
|
-
tags: [linter_tags_1.LintingRuleTag.Smell],
|
|
99
|
+
name: 'Stop Without Call',
|
|
100
|
+
tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.QuickFix],
|
|
84
101
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
85
|
-
description: '
|
|
102
|
+
description: 'Finds `stop()` calls that do not set `call.` to `FALSE`.',
|
|
86
103
|
defaultConfig: () => ({})
|
|
87
104
|
}
|
|
88
105
|
};
|
|
@@ -57,7 +57,7 @@ export declare const SYNTACTICALLY_VALID: {
|
|
|
57
57
|
};
|
|
58
58
|
readonly info: {
|
|
59
59
|
readonly name: "Syntactically Valid";
|
|
60
|
-
readonly description: "
|
|
60
|
+
readonly description: "Finds syntax errors with the configured (error-tolerant) parser. Offers extensible quick fixes to repair them.";
|
|
61
61
|
readonly tags: readonly [LintingRuleTag.Bug, LintingRuleTag.Robustness, LintingRuleTag.QuickFix];
|
|
62
62
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
63
63
|
readonly activeByDefault: false;
|
|
@@ -259,7 +259,7 @@ exports.SYNTACTICALLY_VALID = {
|
|
|
259
259
|
},
|
|
260
260
|
info: {
|
|
261
261
|
name: 'Syntactically Valid',
|
|
262
|
-
description: '
|
|
262
|
+
description: 'Finds syntax errors with the configured (error-tolerant) parser. Offers extensible quick fixes to repair them.',
|
|
263
263
|
tags: [linter_tags_1.LintingRuleTag.Bug, linter_tags_1.LintingRuleTag.Robustness, linter_tags_1.LintingRuleTag.QuickFix],
|
|
264
264
|
// tree-sitter reports real syntax errors precisely, but a strict parse may collapse a region into fewer findings
|
|
265
265
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
@@ -33,9 +33,9 @@ export declare const UNCLOSED_CONNECTION: {
|
|
|
33
33
|
};
|
|
34
34
|
readonly info: {
|
|
35
35
|
readonly name: "Unclosed Connection";
|
|
36
|
-
readonly tags: readonly [LintingRuleTag.Robustness, LintingRuleTag.Smell];
|
|
36
|
+
readonly tags: readonly [LintingRuleTag.Robustness, LintingRuleTag.Smell, LintingRuleTag.QuickFix];
|
|
37
37
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
38
|
-
readonly description: "
|
|
38
|
+
readonly description: "Finds connections that are opened but not closed on every path opening them.";
|
|
39
39
|
readonly defaultConfig: () => {
|
|
40
40
|
openFns: never[];
|
|
41
41
|
closeFns: never[];
|