@eagleoutice/flowr 2.10.9 → 2.11.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 +116 -38
- package/abstract-interpretation/absint-visitor.js +6 -3
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/interval-domain.js +1 -1
- package/abstract-interpretation/domains/lattice.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
- package/abstract-interpretation/domains/singleton-domain.d.ts +1 -1
- package/abstract-interpretation/domains/singleton-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.js +2 -2
- package/abstract-interpretation/unsupported-functions.d.ts +3 -2
- package/abstract-interpretation/unsupported-functions.js +38 -28
- package/cli/benchmark-app.js +2 -1
- package/cli/common/options.d.ts +2 -108
- package/cli/common/options.js +3 -27
- package/cli/common/script.js +3 -2
- package/cli/common/scripts-info.d.ts +2 -123
- package/cli/common/scripts-info.js +0 -17
- package/cli/flowr-main-options.d.ts +5 -0
- package/cli/flowr-main-options.js +10 -0
- package/cli/flowr.js +48 -11
- package/cli/repl/commands/repl-cfg.js +9 -9
- package/cli/repl/commands/repl-commands.js +5 -0
- package/cli/repl/commands/repl-dataflow.js +31 -24
- package/cli/repl/commands/repl-main.d.ts +6 -0
- package/cli/repl/commands/repl-normalize.js +15 -12
- package/cli/repl/commands/repl-parse.js +1 -1
- package/cli/repl/commands/repl-query.js +4 -5
- package/cli/repl/commands/repl-quit.js +2 -1
- package/cli/repl/core.d.ts +11 -0
- package/cli/repl/core.js +101 -3
- package/cli/repl/execute.js +3 -2
- package/cli/repl/parser/slice-query-parser.d.ts +16 -0
- package/cli/repl/parser/slice-query-parser.js +52 -0
- package/cli/repl/print-version.d.ts +3 -1
- package/cli/repl/print-version.js +21 -2
- package/cli/repl/server/connection.d.ts +3 -0
- package/cli/repl/server/connection.js +65 -31
- package/cli/repl/server/messages/message-analysis.d.ts +10 -0
- package/cli/repl/server/messages/message-analysis.js +6 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/script-core/summarizer-core.js +13 -32
- package/cli/wiki.d.ts +3 -1
- package/cli/wiki.js +6 -1
- package/config.d.ts +22 -10
- package/config.js +33 -7
- package/control-flow/diff-cfg.d.ts +1 -1
- package/control-flow/diff-cfg.js +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +2 -0
- package/control-flow/simple-visitor.js +6 -5
- package/control-flow/useless-loop.js +2 -2
- package/core/print/dataflow-printer.d.ts +2 -2
- package/core/print/dataflow-printer.js +2 -2
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/data/pkgdb/pkgdb-latest.json.br +0 -0
- package/data/pkgdb/pkgdb-tiny.json.br +0 -0
- package/dataflow/environments/append.d.ts +2 -2
- package/dataflow/environments/append.js +4 -10
- package/dataflow/environments/apply-kill.d.ts +21 -0
- package/dataflow/environments/apply-kill.js +155 -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.d.ts +4 -0
- package/dataflow/environments/built-in.js +4 -0
- package/dataflow/environments/default-builtin-config.d.ts +183 -67
- package/dataflow/environments/default-builtin-config.js +358 -147
- package/dataflow/environments/environment.d.ts +49 -31
- package/dataflow/environments/environment.js +144 -25
- package/dataflow/environments/identifier.d.ts +65 -2
- package/dataflow/environments/identifier.js +37 -2
- package/dataflow/environments/overwrite.js +2 -10
- package/dataflow/environments/reference-to-maybe.d.ts +2 -0
- package/dataflow/environments/reference-to-maybe.js +56 -11
- package/dataflow/environments/resolve-by-name.d.ts +1 -1
- package/dataflow/environments/resolve-by-name.js +23 -9
- package/dataflow/environments/scoping.d.ts +9 -2
- package/dataflow/environments/scoping.js +15 -2
- package/dataflow/eval/values/general.js +4 -0
- package/dataflow/extractor.js +35 -4
- package/dataflow/graph/df-helper.d.ts +14 -0
- package/dataflow/graph/df-helper.js +41 -0
- package/dataflow/graph/graph.d.ts +4 -1
- package/dataflow/graph/graph.js +6 -2
- package/dataflow/info.d.ts +27 -1
- package/dataflow/internal/linker.d.ts +5 -1
- package/dataflow/internal/linker.js +34 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +7 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +9 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -47
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +17 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +61 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +9 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +37 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +391 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +58 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +132 -25
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +9 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +25 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +94 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +11 -4
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +30 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +279 -0
- package/dataflow/internal/process/functions/call/known-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +23 -0
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +1 -1
- package/dataflow/processor.d.ts +6 -0
- package/documentation/data/faq/faqs.d.ts +2 -1
- package/documentation/data/faq/faqs.js +78 -57
- package/documentation/data/interface/doc-writing-code.js +4 -80
- package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
- package/documentation/data/server/doc-data-server-messages.js +15 -7
- package/documentation/doc-readme.js +15 -15
- package/documentation/doc-util/doc-cfg.d.ts +3 -1
- package/documentation/doc-util/doc-cfg.js +3 -3
- package/documentation/doc-util/doc-dfg.d.ts +3 -1
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-files.d.ts +3 -1
- package/documentation/doc-util/doc-files.js +9 -6
- package/documentation/doc-util/doc-normalized-ast.d.ts +3 -1
- package/documentation/doc-util/doc-normalized-ast.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +2 -1
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -0
- package/documentation/doc-util/doc-structure.js +1 -2
- package/documentation/doc-util/doc-types.d.ts +6 -6
- package/documentation/doc-util/doc-types.js +11 -9
- package/documentation/issue-linting-rule.js +1 -2
- package/documentation/wiki-analyzer.js +9 -9
- package/documentation/wiki-cfg.js +40 -41
- package/documentation/wiki-core.js +121 -32
- package/documentation/wiki-create-linting-rules.d.ts +6 -0
- package/documentation/wiki-create-linting-rules.js +95 -0
- package/documentation/wiki-dataflow-graph.js +112 -77
- package/documentation/wiki-engine.js +1 -2
- package/documentation/wiki-faq.d.ts +2 -1
- package/documentation/wiki-faq.js +4 -4
- package/documentation/wiki-interface.js +22 -8
- package/documentation/wiki-linter.d.ts +1 -1
- package/documentation/wiki-linter.js +16 -6
- package/documentation/wiki-linting-and-testing.js +2 -2
- package/documentation/wiki-mk/doc-context.d.ts +3 -3
- package/documentation/wiki-mk/doc-maker.d.ts +2 -0
- package/documentation/wiki-mk/doc-maker.js +7 -1
- package/documentation/wiki-normalized-ast.js +5 -5
- package/documentation/wiki-onboarding.d.ts +2 -1
- package/documentation/wiki-onboarding.js +5 -5
- package/documentation/wiki-overview.js +4 -17
- package/documentation/wiki-package-database.d.ts +9 -0
- package/documentation/wiki-package-database.js +63 -0
- package/documentation/wiki-query.js +86 -84
- package/documentation/wiki-search.js +4 -5
- package/documentation/wiki-setup.js +6 -7
- package/gas.d.ts +74 -0
- package/gas.js +18 -0
- package/linter/linter-executor.js +2 -8
- package/linter/linter-format.d.ts +4 -11
- package/linter/linter-rules.d.ts +111 -86
- package/linter/linter-rules.js +9 -1
- package/linter/rules/absolute-path.d.ts +2 -7
- package/linter/rules/absolute-path.js +8 -5
- package/linter/rules/dataframe-access-validation.d.ts +1 -6
- package/linter/rules/dataframe-access-validation.js +8 -6
- package/linter/rules/dead-code.d.ts +2 -11
- package/linter/rules/dead-code.js +16 -11
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/file-path-validity.d.ts +1 -6
- package/linter/rules/file-path-validity.js +5 -5
- package/linter/rules/function-finder-util.d.ts +7 -11
- package/linter/rules/function-finder-util.js +9 -6
- package/linter/rules/naming-convention.d.ts +2 -7
- package/linter/rules/naming-convention.js +3 -2
- package/linter/rules/network-functions.d.ts +2 -7
- package/linter/rules/network-functions.js +14 -12
- package/linter/rules/no-leaked-credentials.d.ts +36 -0
- package/linter/rules/no-leaked-credentials.js +75 -0
- package/linter/rules/problematic-inputs.d.ts +1 -8
- package/linter/rules/problematic-inputs.js +5 -4
- package/linter/rules/roxygen-arguments.d.ts +2 -7
- package/linter/rules/roxygen-arguments.js +13 -20
- package/linter/rules/seeded-randomness.d.ts +2 -7
- package/linter/rules/seeded-randomness.js +7 -4
- package/linter/rules/software-has-license.d.ts +31 -0
- package/linter/rules/software-has-license.js +46 -0
- package/linter/rules/software-has-tests.d.ts +38 -0
- package/linter/rules/software-has-tests.js +48 -0
- package/linter/rules/stop-with-call-arg.d.ts +2 -7
- package/linter/rules/stop-with-call-arg.js +3 -2
- package/linter/rules/undefined-symbol.d.ts +39 -0
- package/linter/rules/undefined-symbol.js +80 -0
- package/linter/rules/unused-definition.d.ts +3 -8
- package/linter/rules/unused-definition.js +7 -5
- package/linter/rules/useless-loop.d.ts +2 -7
- package/linter/rules/useless-loop.js +5 -2
- package/package.json +5 -5
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +9 -1
- package/project/context/flowr-analyzer-context.d.ts +13 -14
- package/project/context/flowr-analyzer-context.js +4 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +16 -8
- package/project/context/flowr-analyzer-dependencies-context.js +36 -4
- package/project/context/flowr-analyzer-environment-context.d.ts +2 -4
- package/project/context/flowr-analyzer-environment-context.js +3 -4
- package/project/context/flowr-analyzer-files-context.d.ts +13 -0
- package/project/context/flowr-analyzer-files-context.js +12 -2
- package/project/context/flowr-analyzer-gas-context.d.ts +28 -0
- package/project/context/flowr-analyzer-gas-context.js +101 -0
- package/project/context/flowr-file.d.ts +2 -0
- package/project/context/flowr-file.js +2 -0
- package/project/flowr-analyzer-builder.js +3 -0
- package/project/flowr-analyzer.d.ts +2 -1
- package/project/flowr-analyzer.js +3 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +13 -15
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +36 -13
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +13 -7
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +56 -11
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +27 -0
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +41 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +2 -2
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +5 -5
- package/project/plugins/flowr-analyzer-plugin.d.ts +15 -8
- package/project/plugins/flowr-analyzer-plugin.js +14 -7
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.d.ts +19 -0
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.js +35 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +63 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +174 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +6 -0
- package/project/plugins/package-version-plugins/package.d.ts +3 -0
- package/project/plugins/package-version-plugins/package.js +12 -0
- package/project/plugins/package-version-plugins/pkgdb.d.ts +133 -0
- package/project/plugins/package-version-plugins/pkgdb.js +370 -0
- package/project/plugins/plugin-registry.d.ts +5 -1
- package/project/plugins/plugin-registry.js +10 -1
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +22 -0
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +47 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +62 -8
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +4 -2
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +8 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +31 -3
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/other-path-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/other-path-functions.js +27 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +5 -4
- package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.js +18 -177
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +3 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- package/queries/catalog/dice-query/dice-query-executor.d.ts +8 -0
- package/queries/catalog/dice-query/dice-query-executor.js +52 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +53 -0
- package/queries/catalog/dice-query/dice-query-format.js +102 -0
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -0
- package/queries/catalog/linter-query/linter-query-executor.js +8 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +1 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/queries/query.d.ts +18 -1
- package/queries/query.js +3 -1
- package/r-bridge/data/data.d.ts +7 -2
- package/r-bridge/data/data.js +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +13 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +55 -44
- package/r-bridge/parser.js +2 -9
- package/r-bridge/shell.d.ts +8 -1
- package/r-bridge/shell.js +26 -7
- package/search/flowr-search-builder.d.ts +2 -2
- package/search/flowr-search-builder.js +1 -1
- package/search/flowr-search-filters.d.ts +30 -9
- package/search/flowr-search-filters.js +26 -21
- package/search/search-executor/search-enrichers.d.ts +601 -1
- package/search/search-executor/search-enrichers.js +30 -6
- package/slicing/static/static-slicer.d.ts +39 -11
- package/slicing/static/static-slicer.js +44 -14
- package/util/collections/queue.d.ts +16 -0
- package/util/collections/queue.js +38 -0
- package/util/log.d.ts +1 -1
- package/util/log.js +1 -1
- package/util/mermaid/dfg.d.ts +2 -2
- package/util/mermaid/dfg.js +2 -2
- package/util/mermaid/mermaid.d.ts +4 -0
- package/util/mermaid/mermaid.js +8 -1
- package/util/objects.d.ts +9 -0
- package/util/objects.js +54 -0
- package/util/proc.d.ts +6 -0
- package/util/proc.js +20 -0
- package/util/version.js +10 -2
- package/cli/common/features.d.ts +0 -9
- package/cli/common/features.js +0 -35
- package/cli/script-core/statistics-core.d.ts +0 -6
- package/cli/script-core/statistics-core.js +0 -103
- package/cli/script-core/statistics-helper-core.d.ts +0 -6
- package/cli/script-core/statistics-helper-core.js +0 -85
- package/cli/statistics-app.d.ts +0 -11
- package/cli/statistics-app.js +0 -16
- package/cli/statistics-helper-app.d.ts +0 -11
- package/cli/statistics-helper-app.js +0 -14
- package/statistics/features/common-syntax-probability.d.ts +0 -38
- package/statistics/features/common-syntax-probability.js +0 -169
- package/statistics/features/feature.d.ts +0 -179
- package/statistics/features/feature.js +0 -38
- package/statistics/features/post-processing.d.ts +0 -18
- package/statistics/features/post-processing.js +0 -26
- package/statistics/features/supported/assignments/assignments.d.ts +0 -12
- package/statistics/features/supported/assignments/assignments.js +0 -56
- package/statistics/features/supported/assignments/post-process.d.ts +0 -6
- package/statistics/features/supported/assignments/post-process.js +0 -126
- package/statistics/features/supported/comments/comments.d.ts +0 -18
- package/statistics/features/supported/comments/comments.js +0 -143
- package/statistics/features/supported/comments/post-process.d.ts +0 -6
- package/statistics/features/supported/comments/post-process.js +0 -51
- package/statistics/features/supported/control-flow/control-flow.d.ts +0 -17
- package/statistics/features/supported/control-flow/control-flow.js +0 -69
- package/statistics/features/supported/control-flow/post-process.d.ts +0 -6
- package/statistics/features/supported/control-flow/post-process.js +0 -66
- package/statistics/features/supported/data-access/data-access.d.ts +0 -15
- package/statistics/features/supported/data-access/data-access.js +0 -122
- package/statistics/features/supported/data-access/post-process.d.ts +0 -6
- package/statistics/features/supported/data-access/post-process.js +0 -108
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +0 -34
- package/statistics/features/supported/defined-functions/defined-functions.js +0 -145
- package/statistics/features/supported/defined-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/defined-functions/post-process.js +0 -168
- package/statistics/features/supported/expression-list/post-process.d.ts +0 -6
- package/statistics/features/supported/expression-list/post-process.js +0 -45
- package/statistics/features/supported/expression-list/statistics-expression-list.d.ts +0 -9
- package/statistics/features/supported/expression-list/statistics-expression-list.js +0 -37
- package/statistics/features/supported/loops/loops.d.ts +0 -20
- package/statistics/features/supported/loops/loops.js +0 -81
- package/statistics/features/supported/loops/post-process.d.ts +0 -6
- package/statistics/features/supported/loops/post-process.js +0 -73
- package/statistics/features/supported/used-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/used-functions/post-process.js +0 -176
- package/statistics/features/supported/used-functions/used-functions.d.ts +0 -24
- package/statistics/features/supported/used-functions/used-functions.js +0 -99
- package/statistics/features/supported/used-packages/post-process.d.ts +0 -6
- package/statistics/features/supported/used-packages/post-process.js +0 -122
- package/statistics/features/supported/used-packages/used-packages.d.ts +0 -16
- package/statistics/features/supported/used-packages/used-packages.js +0 -140
- package/statistics/features/supported/values/post-process.d.ts +0 -6
- package/statistics/features/supported/values/post-process.js +0 -73
- package/statistics/features/supported/values/values.d.ts +0 -14
- package/statistics/features/supported/values/values.js +0 -111
- package/statistics/features/supported/variables/post-process.d.ts +0 -15
- package/statistics/features/supported/variables/post-process.js +0 -126
- package/statistics/features/supported/variables/variables.d.ts +0 -15
- package/statistics/features/supported/variables/variables.js +0 -62
- package/statistics/meta-statistics.d.ts +0 -32
- package/statistics/meta-statistics.js +0 -16
- package/statistics/output/file-provider.d.ts +0 -36
- package/statistics/output/file-provider.js +0 -96
- package/statistics/output/print-stats.d.ts +0 -29
- package/statistics/output/print-stats.js +0 -81
- package/statistics/output/statistics-file.d.ts +0 -36
- package/statistics/output/statistics-file.js +0 -68
- package/statistics/statistics.d.ts +0 -29
- package/statistics/statistics.js +0 -108
- package/statistics/summarizer/auto-detect.d.ts +0 -5
- package/statistics/summarizer/auto-detect.js +0 -34
- package/statistics/summarizer/first-phase/process.d.ts +0 -6
- package/statistics/summarizer/first-phase/process.js +0 -81
- package/statistics/summarizer/post-process/clusterer.d.ts +0 -25
- package/statistics/summarizer/post-process/clusterer.js +0 -40
- package/statistics/summarizer/post-process/file-based-count.d.ts +0 -16
- package/statistics/summarizer/post-process/file-based-count.js +0 -47
- package/statistics/summarizer/post-process/histogram.d.ts +0 -57
- package/statistics/summarizer/post-process/histogram.js +0 -126
- package/statistics/summarizer/post-process/post-process-output.d.ts +0 -14
- package/statistics/summarizer/post-process/post-process-output.js +0 -102
- package/statistics/summarizer/second-phase/process.d.ts +0 -15
- package/statistics/summarizer/second-phase/process.js +0 -118
- package/statistics/summarizer/summarizer.d.ts +0 -34
- package/statistics/summarizer/summarizer.js +0 -141
|
@@ -90,6 +90,7 @@ exports.PROBLEMATIC_INPUTS = {
|
|
|
90
90
|
]);
|
|
91
91
|
},
|
|
92
92
|
processSearchResult: async (elements, config, data) => {
|
|
93
|
+
const df = await data.dataflow();
|
|
93
94
|
const results = [];
|
|
94
95
|
const seen = new Set();
|
|
95
96
|
const defaultAccept = [simple_input_classifier_1.InputType.Constant, simple_input_classifier_1.InputType.DerivedConstant];
|
|
@@ -108,11 +109,11 @@ exports.PROBLEMATIC_INPUTS = {
|
|
|
108
109
|
}
|
|
109
110
|
const loc = range_1.SourceLocation.fromNode(element.node) ?? range_1.SourceLocation.invalid();
|
|
110
111
|
if (pipeSpec !== undefined) {
|
|
111
|
-
const vertex =
|
|
112
|
+
const vertex = df.graph.getVertex(nid);
|
|
112
113
|
const fileArgId = resolveFileArgId(vertex, pipeSpec.argIdx, pipeSpec.argName);
|
|
113
114
|
if (fileArgId !== undefined) {
|
|
114
115
|
const criterion = parse_1.SlicingCriterion.fromId(fileArgId);
|
|
115
|
-
const all = await data.
|
|
116
|
+
const all = await data.query([{ type: 'input-sources', criterion, config: config.inputFns }]);
|
|
116
117
|
const sources = all['input-sources']?.results?.[criterion] ?? [];
|
|
117
118
|
const r = checkPipeInjection(nid, loc, name, sources);
|
|
118
119
|
if (r !== undefined) {
|
|
@@ -123,7 +124,7 @@ exports.PROBLEMATIC_INPUTS = {
|
|
|
123
124
|
}
|
|
124
125
|
else {
|
|
125
126
|
const criterion = parse_1.SlicingCriterion.fromId(nid);
|
|
126
|
-
const all = await data.
|
|
127
|
+
const all = await data.query([{ type: 'input-sources', criterion, config: config.inputFns }]);
|
|
127
128
|
const sources = all['input-sources']?.results?.[criterion] ?? [];
|
|
128
129
|
if (isProblematicForAllowed(sources, defaultAccept)) {
|
|
129
130
|
seen.add(nid);
|
|
@@ -131,7 +132,7 @@ exports.PROBLEMATIC_INPUTS = {
|
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
|
-
return { results
|
|
135
|
+
return { results };
|
|
135
136
|
},
|
|
136
137
|
prettyPrint: {
|
|
137
138
|
[linter_format_1.LintingPrettyPrintContext.Query]: result => {
|
|
@@ -9,13 +9,8 @@ export interface RoxygenArgsResult extends LintingResult {
|
|
|
9
9
|
export type RoxygenArgsConfig = MergeableRecord;
|
|
10
10
|
export type RoxygenArgsMetadata = MergeableRecord;
|
|
11
11
|
export declare const ROXYGEN_ARGS: {
|
|
12
|
-
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,
|
|
13
|
-
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
|
|
14
|
-
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
15
|
-
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
16
|
-
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
17
|
-
analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
18
|
-
}) => {
|
|
12
|
+
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["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>[]>>>;
|
|
13
|
+
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) => {
|
|
19
14
|
results: Writable<RoxygenArgsResult>[];
|
|
20
15
|
'.meta': {};
|
|
21
16
|
};
|
|
@@ -9,14 +9,7 @@ const assert_1 = require("../../util/assert");
|
|
|
9
9
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
10
10
|
const roxygen_ast_1 = require("../../r-bridge/roxygen2/roxygen-ast");
|
|
11
11
|
const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
12
|
-
const
|
|
13
|
-
function getDocumentation(id, idMap) {
|
|
14
|
-
const comment = (0, documentation_provider_1.getDocumentationOf)(id, idMap);
|
|
15
|
-
if (comment === undefined) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
return Array.isArray(comment) ? comment : [comment];
|
|
19
|
-
}
|
|
12
|
+
const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
|
|
20
13
|
function calculateArgumentDiff(inheritedParams, functionParam, roxygenParam) {
|
|
21
14
|
//match documented against existing params
|
|
22
15
|
let underDocumented = new Set(functionParam);
|
|
@@ -39,8 +32,10 @@ function calculateArgumentDiff(inheritedParams, functionParam, roxygenParam) {
|
|
|
39
32
|
return underDocumented.size === 0 && overDocumented.size === 0 ? false : { under: Array.from(underDocumented), over: Array.from(overDocumented) };
|
|
40
33
|
}
|
|
41
34
|
exports.ROXYGEN_ARGS = {
|
|
42
|
-
createSearch: () => flowr_search_builder_1.Q.all()
|
|
43
|
-
|
|
35
|
+
createSearch: () => flowr_search_builder_1.Q.all()
|
|
36
|
+
.filter(vertex_1.VertexType.FunctionDefinition)
|
|
37
|
+
.with(search_enrichers_1.Enrichment.Roxygen),
|
|
38
|
+
processSearchResult: (elements, _config) => {
|
|
44
39
|
return {
|
|
45
40
|
results: elements.getElements()
|
|
46
41
|
.map(element => ({
|
|
@@ -48,22 +43,20 @@ exports.ROXYGEN_ARGS = {
|
|
|
48
43
|
underDocumented: [],
|
|
49
44
|
overDocumented: []
|
|
50
45
|
}))
|
|
51
|
-
.filter(({ element
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
46
|
+
.filter(({ element, underDocumented, overDocumented }) => {
|
|
47
|
+
const roxygen = (0, search_enrichers_1.enrichmentContent)(element, search_enrichers_1.Enrichment.Roxygen);
|
|
48
|
+
if (!roxygen.documentation.length) {
|
|
54
49
|
return false;
|
|
55
50
|
}
|
|
56
|
-
const parameters = getParameters(node);
|
|
57
51
|
//get parameter names
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
.map(tag => tag.value.name);
|
|
52
|
+
const params = roxygen.tags[roxygen_ast_1.KnownRoxygenTags.Param] ?? [];
|
|
53
|
+
const functionParamNames = getParameters(element.node).map(p => p.name.content.toString());
|
|
54
|
+
const inheritedParams = params.filter(tag => tag.inherited).map(tag => tag.value.name);
|
|
55
|
+
const roxygenParamNames = params.map(tag => tag.value.name);
|
|
63
56
|
if (functionParamNames === null || roxygenParamNames == null) {
|
|
64
57
|
return false;
|
|
65
58
|
}
|
|
66
|
-
const result = calculateArgumentDiff(inheritedParams, functionParamNames, roxygenParamNames);
|
|
59
|
+
const result = calculateArgumentDiff(inheritedParams ?? [], functionParamNames, roxygenParamNames);
|
|
67
60
|
if (result === false) {
|
|
68
61
|
return false;
|
|
69
62
|
}
|
|
@@ -29,12 +29,7 @@ export interface SeededRandomnessMeta extends MergeableRecord {
|
|
|
29
29
|
}
|
|
30
30
|
export declare const SEEDED_RANDOMNESS: {
|
|
31
31
|
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,
|
|
33
|
-
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
34
|
-
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
35
|
-
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
36
|
-
analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
37
|
-
}) => {
|
|
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("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => Promise<{
|
|
38
33
|
results: {
|
|
39
34
|
involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
|
|
40
35
|
certainty: LintingResultCertainty;
|
|
@@ -42,7 +37,7 @@ export declare const SEEDED_RANDOMNESS: {
|
|
|
42
37
|
loc: [startLine: number, startColumn: number, endLine: number, endColumn: number, f?: string | undefined];
|
|
43
38
|
}[];
|
|
44
39
|
'.meta': SeededRandomnessMeta;
|
|
45
|
-
}
|
|
40
|
+
}>;
|
|
46
41
|
readonly info: {
|
|
47
42
|
readonly defaultConfig: {
|
|
48
43
|
readonly randomnessProducers: readonly [{
|
|
@@ -27,14 +27,17 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
27
27
|
name: flowr_search_filters_1.FlowrFilter.MatchesEnrichment,
|
|
28
28
|
args: {
|
|
29
29
|
enrichment: search_enrichers_1.Enrichment.CallTargets,
|
|
30
|
-
test:
|
|
30
|
+
test: {
|
|
31
|
+
targets: (0, flowr_search_filters_1.testFunctionsIgnoringPackage)(config.randomnessConsumers)
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
34
|
})
|
|
33
35
|
.with(search_enrichers_1.Enrichment.LastCall, [
|
|
34
36
|
{ callName: config.randomnessProducers.filter(p => p.type === 'function').map(p => p.name) },
|
|
35
37
|
{ callName: getDefaultAssignments().flatMap(b => b.names).map(identifier_1.Identifier.getName), cascadeIf: () => cascade_action_1.CascadeAction.Continue }
|
|
36
38
|
]),
|
|
37
|
-
processSearchResult: (elements, config,
|
|
39
|
+
processSearchResult: async (elements, config, data) => {
|
|
40
|
+
const dataflow = await data.dataflow();
|
|
38
41
|
const assignmentProducers = new Set(config.randomnessProducers.filter(p => p.type === 'assignment').map(p => p.name));
|
|
39
42
|
const assignmentArgIndexes = new Map(getDefaultAssignments().flatMap(a => a.names.map(n => ([identifier_1.Identifier.getName(n), a.config?.swapSourceAndTarget ? 1 : 0]))));
|
|
40
43
|
const metadata = {
|
|
@@ -67,7 +70,7 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
67
70
|
const cdsOfProduces = new Set();
|
|
68
71
|
// function calls are already taken care of through the LastCall enrichment itself
|
|
69
72
|
for (const f of func ?? []) {
|
|
70
|
-
if (isConstantArgument(dataflow.graph, f, 0,
|
|
73
|
+
if (isConstantArgument(dataflow.graph, f, 0, data.inspectContext())) {
|
|
71
74
|
const fCds = new Set(f.cds).difference(cds);
|
|
72
75
|
metadata.callsWithFunctionProducers++;
|
|
73
76
|
if (fCds.size <= 0 || (0, info_1.happensInEveryBranchSet)(fCds)) {
|
|
@@ -89,7 +92,7 @@ exports.SEEDED_RANDOMNESS = {
|
|
|
89
92
|
const dest = graph_1.FunctionArgument.getReference(a.args[argIdx]);
|
|
90
93
|
if (dest !== undefined && assignmentProducers.has((0, node_id_1.recoverName)(dest, dataflow.graph.idMap))) {
|
|
91
94
|
// we either have arg index 0 or 1 for the assignmentProducers destination, so we select the assignment value as 1-argIdx here
|
|
92
|
-
if (isConstantArgument(dataflow.graph, a, 1 - argIdx,
|
|
95
|
+
if (isConstantArgument(dataflow.graph, a, 1 - argIdx, data.inspectContext())) {
|
|
93
96
|
const aCds = new Set(a.cds).difference(cds);
|
|
94
97
|
if (aCds.size <= 0 || (0, info_1.happensInEveryBranchSet)(aCds)) {
|
|
95
98
|
metadata.callsWithAssignmentProducers++;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
2
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
3
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
4
|
+
export interface SoftwareHasLicenseResult extends LintingResult {
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SoftwareHasLicenseConfig extends MergeableRecord {
|
|
8
|
+
/** Whether to also inspect the DESCRIPTION file for a License field */
|
|
9
|
+
readonly checkDescriptionFile: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type SoftwareHasLicenseMetadata = MergeableRecord;
|
|
12
|
+
export declare const SOFTWARE_HAS_LICENSE: {
|
|
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("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => {
|
|
15
|
+
results: SoftwareHasLicenseResult[];
|
|
16
|
+
'.meta': {};
|
|
17
|
+
};
|
|
18
|
+
readonly prettyPrint: {
|
|
19
|
+
readonly query: (result: SoftwareHasLicenseResult) => string;
|
|
20
|
+
readonly full: (result: SoftwareHasLicenseResult) => string;
|
|
21
|
+
};
|
|
22
|
+
readonly info: {
|
|
23
|
+
readonly name: "Software Has License";
|
|
24
|
+
readonly description: "Checks whether the software project provides a license (via a LICENSE file or the DESCRIPTION file License field).";
|
|
25
|
+
readonly tags: readonly [LintingRuleTag.Documentation, LintingRuleTag.Usability];
|
|
26
|
+
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
27
|
+
readonly defaultConfig: {
|
|
28
|
+
readonly checkDescriptionFile: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SOFTWARE_HAS_LICENSE = void 0;
|
|
4
|
+
const linter_format_1 = require("../linter-format");
|
|
5
|
+
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
6
|
+
const range_1 = require("../../util/range");
|
|
7
|
+
const linter_tags_1 = require("../linter-tags");
|
|
8
|
+
const flowr_file_1 = require("../../project/context/flowr-file");
|
|
9
|
+
const flowr_description_file_1 = require("../../project/plugins/file-plugins/files/flowr-description-file");
|
|
10
|
+
exports.SOFTWARE_HAS_LICENSE = {
|
|
11
|
+
createSearch: () => flowr_search_builder_1.Q.fromQuery({ type: 'dependencies', enabledCategories: [] }),
|
|
12
|
+
processSearchResult: (_elements, config, data) => {
|
|
13
|
+
const ctx = data.inspectContext();
|
|
14
|
+
const licenseFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.License);
|
|
15
|
+
let hasLicense = licenseFiles.length > 0;
|
|
16
|
+
if (!hasLicense && config.checkDescriptionFile) {
|
|
17
|
+
for (const f of ctx.files.getFilesByRole(flowr_file_1.FileRole.Description)) {
|
|
18
|
+
if (flowr_description_file_1.FlowrDescriptionFile.from(f).license()) {
|
|
19
|
+
hasLicense = true;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const results = hasLicense ? [] : [{
|
|
25
|
+
certainty: linter_format_1.LintingResultCertainty.Certain,
|
|
26
|
+
involvedId: undefined,
|
|
27
|
+
loc: range_1.SourceLocation.invalid(),
|
|
28
|
+
message: 'No license found in the project'
|
|
29
|
+
}];
|
|
30
|
+
return { results, '.meta': {} };
|
|
31
|
+
},
|
|
32
|
+
prettyPrint: {
|
|
33
|
+
[linter_format_1.LintingPrettyPrintContext.Query]: (result) => result.message,
|
|
34
|
+
[linter_format_1.LintingPrettyPrintContext.Full]: (result) => result.message
|
|
35
|
+
},
|
|
36
|
+
info: {
|
|
37
|
+
name: 'Software Has License',
|
|
38
|
+
description: 'Checks whether the software project provides a license (via a LICENSE file or the DESCRIPTION file License field).',
|
|
39
|
+
tags: [linter_tags_1.LintingRuleTag.Documentation, linter_tags_1.LintingRuleTag.Usability],
|
|
40
|
+
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
41
|
+
defaultConfig: {
|
|
42
|
+
checkDescriptionFile: true
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=software-has-license.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
2
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
3
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
4
|
+
import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
|
|
5
|
+
export interface SoftwareHasTestsResult extends LintingResult {
|
|
6
|
+
readonly message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SoftwareHasTestsConfig extends MergeableRecord {
|
|
9
|
+
/** Additional test function patterns beyond the defaults */
|
|
10
|
+
readonly additionalTestFunctions: FunctionInfo[];
|
|
11
|
+
}
|
|
12
|
+
export interface SoftwareHasTestsMetadata extends MergeableRecord {
|
|
13
|
+
readonly testFilesFound: number;
|
|
14
|
+
readonly testCallsFound: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const SOFTWARE_HAS_TESTS: {
|
|
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("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => {
|
|
19
|
+
results: SoftwareHasTestsResult[];
|
|
20
|
+
'.meta': {
|
|
21
|
+
testFilesFound: number;
|
|
22
|
+
testCallsFound: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly prettyPrint: {
|
|
26
|
+
readonly query: (result: SoftwareHasTestsResult) => string;
|
|
27
|
+
readonly full: (result: SoftwareHasTestsResult) => string;
|
|
28
|
+
};
|
|
29
|
+
readonly info: {
|
|
30
|
+
readonly name: "Software Has Tests";
|
|
31
|
+
readonly description: "Checks whether the software project has tests (test files in a test directory or test function calls in R code).";
|
|
32
|
+
readonly tags: readonly [LintingRuleTag.Usability, LintingRuleTag.Reproducibility];
|
|
33
|
+
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
34
|
+
readonly defaultConfig: {
|
|
35
|
+
readonly additionalTestFunctions: readonly [];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SOFTWARE_HAS_TESTS = void 0;
|
|
4
|
+
const linter_format_1 = require("../linter-format");
|
|
5
|
+
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
6
|
+
const range_1 = require("../../util/range");
|
|
7
|
+
const linter_tags_1 = require("../linter-tags");
|
|
8
|
+
const flowr_file_1 = require("../../project/context/flowr-file");
|
|
9
|
+
exports.SOFTWARE_HAS_TESTS = {
|
|
10
|
+
createSearch: (config) => flowr_search_builder_1.Q.fromQuery({
|
|
11
|
+
type: 'dependencies',
|
|
12
|
+
enabledCategories: ['test'],
|
|
13
|
+
...(config.additionalTestFunctions.length > 0 ? { testFunctions: config.additionalTestFunctions } : {})
|
|
14
|
+
}),
|
|
15
|
+
processSearchResult: (elements, _config, data) => {
|
|
16
|
+
const ctx = data.inspectContext();
|
|
17
|
+
const testFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.Test);
|
|
18
|
+
const testCalls = elements.getElements().length;
|
|
19
|
+
const hasTests = testFiles.length > 0 || testCalls > 0;
|
|
20
|
+
const results = hasTests ? [] : [{
|
|
21
|
+
certainty: linter_format_1.LintingResultCertainty.Certain,
|
|
22
|
+
involvedId: undefined,
|
|
23
|
+
loc: range_1.SourceLocation.invalid(),
|
|
24
|
+
message: 'No tests found in the project'
|
|
25
|
+
}];
|
|
26
|
+
return {
|
|
27
|
+
results,
|
|
28
|
+
'.meta': {
|
|
29
|
+
testFilesFound: testFiles.length,
|
|
30
|
+
testCallsFound: testCalls
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
prettyPrint: {
|
|
35
|
+
[linter_format_1.LintingPrettyPrintContext.Query]: (result) => result.message,
|
|
36
|
+
[linter_format_1.LintingPrettyPrintContext.Full]: (result) => result.message
|
|
37
|
+
},
|
|
38
|
+
info: {
|
|
39
|
+
name: 'Software Has Tests',
|
|
40
|
+
description: 'Checks whether the software project has tests (test files in a test directory or test function calls in R code).',
|
|
41
|
+
tags: [linter_tags_1.LintingRuleTag.Usability, linter_tags_1.LintingRuleTag.Reproducibility],
|
|
42
|
+
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
43
|
+
defaultConfig: {
|
|
44
|
+
additionalTestFunctions: []
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=software-has-tests.js.map
|
|
@@ -9,15 +9,10 @@ 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,
|
|
13
|
-
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
14
|
-
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
15
|
-
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
16
|
-
analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
17
|
-
}) => {
|
|
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("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => Promise<{
|
|
18
13
|
results: Writable<StopWithCallResult>[];
|
|
19
14
|
'.meta': StopWithCallMetadata;
|
|
20
|
-
}
|
|
15
|
+
}>;
|
|
21
16
|
readonly prettyPrint: {
|
|
22
17
|
readonly query: (result: LintingResult) => string;
|
|
23
18
|
readonly full: (result: LintingResult) => string;
|
|
@@ -13,7 +13,8 @@ const linker_1 = require("../../dataflow/internal/linker");
|
|
|
13
13
|
const general_1 = require("../../dataflow/eval/values/general");
|
|
14
14
|
exports.STOP_WITH_CALL_ARG = {
|
|
15
15
|
createSearch: () => flowr_search_builder_1.Q.var('stop').filter(vertex_1.VertexType.FunctionCall),
|
|
16
|
-
processSearchResult: (elements, _config,
|
|
16
|
+
processSearchResult: async (elements, _config, data) => {
|
|
17
|
+
const dataflow = await data.dataflow();
|
|
17
18
|
const meta = {
|
|
18
19
|
consideredNodes: 0
|
|
19
20
|
};
|
|
@@ -38,7 +39,7 @@ exports.STOP_WITH_CALL_ARG = {
|
|
|
38
39
|
const mapping = (0, linker_1.pMatch)(fCall.args, stopParamMap);
|
|
39
40
|
const mappedToStop = mapping.get('call.') ?? [];
|
|
40
41
|
for (const argId of mappedToStop) {
|
|
41
|
-
const res = (0, alias_tracking_1.resolveIdToValue)(argId, { graph: dataflow.graph, environment: fCall.environment, ctx:
|
|
42
|
+
const res = (0, alias_tracking_1.resolveIdToValue)(argId, { graph: dataflow.graph, environment: fCall.environment, ctx: data.inspectContext() });
|
|
42
43
|
const values = (0, general_1.valueSetGuard)(res);
|
|
43
44
|
if (values?.type === 'set' && values.elements.length !== 0) {
|
|
44
45
|
if (values.elements[0].type === 'logical') {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
2
|
+
import { type LintingResult, LintingResultCertainty, LintingRuleCertainty } from '../linter-format';
|
|
3
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
4
|
+
export interface UndefinedSymbolResult extends LintingResult {
|
|
5
|
+
/** the called name that could not be resolved */
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export type UndefinedSymbolConfig = MergeableRecord;
|
|
9
|
+
export interface UndefinedSymbolMetadata extends MergeableRecord {
|
|
10
|
+
totalCalls: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Flags calls to functions that are neither defined locally, a known builtin, nor exported by a
|
|
14
|
+
* package loaded via `library()`/`require()`/`use()` (resolved from the `flowr-pkgdb` database).
|
|
15
|
+
* Over-approximative: reflection/NSE and packages without export info can cause false positives.
|
|
16
|
+
*/
|
|
17
|
+
export declare const UNDEFINED_SYMBOL: {
|
|
18
|
+
readonly createSearch: (_config: UndefinedSymbolConfig) => 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>[]>>>;
|
|
19
|
+
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("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => Promise<{
|
|
20
|
+
results: {
|
|
21
|
+
certainty: LintingResultCertainty.Uncertain;
|
|
22
|
+
name: import("../../dataflow/environments/identifier").BrandedIdentifier;
|
|
23
|
+
involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
|
|
24
|
+
loc: [startLine: number, startColumn: number, endLine: number, endColumn: number, f?: string | undefined];
|
|
25
|
+
}[];
|
|
26
|
+
'.meta': UndefinedSymbolMetadata;
|
|
27
|
+
}>;
|
|
28
|
+
readonly prettyPrint: {
|
|
29
|
+
readonly query: (result: UndefinedSymbolResult) => string;
|
|
30
|
+
readonly full: (result: UndefinedSymbolResult) => string;
|
|
31
|
+
};
|
|
32
|
+
readonly info: {
|
|
33
|
+
readonly name: "Undefined Symbol";
|
|
34
|
+
readonly certainty: LintingRuleCertainty.OverApproximative;
|
|
35
|
+
readonly description: "Flags calls to functions that are neither defined locally, a known builtin, nor exported by a loaded package.";
|
|
36
|
+
readonly tags: readonly [LintingRuleTag.Bug, LintingRuleTag.Experimental];
|
|
37
|
+
readonly defaultConfig: {};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNDEFINED_SYMBOL = void 0;
|
|
4
|
+
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
5
|
+
const dfg_get_origin_1 = require("../../dataflow/origin/dfg-get-origin");
|
|
6
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
7
|
+
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
8
|
+
const assert_1 = require("../../util/assert");
|
|
9
|
+
const range_1 = require("../../util/range");
|
|
10
|
+
const linter_format_1 = require("../linter-format");
|
|
11
|
+
const linter_tags_1 = require("../linter-tags");
|
|
12
|
+
/** calls that load a package; an unresolved one means we cannot enumerate all exports in scope */
|
|
13
|
+
const LibraryLoadFunctions = new Set(['library', 'require', 'requireNamespace', 'loadNamespace', 'attachNamespace', 'load_all', 'use', 'p_load']);
|
|
14
|
+
/**
|
|
15
|
+
* Flags calls to functions that are neither defined locally, a known builtin, nor exported by a
|
|
16
|
+
* package loaded via `library()`/`require()`/`use()` (resolved from the `flowr-pkgdb` database).
|
|
17
|
+
* Over-approximative: reflection/NSE and packages without export info can cause false positives.
|
|
18
|
+
*/
|
|
19
|
+
exports.UNDEFINED_SYMBOL = {
|
|
20
|
+
createSearch: (_config) => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall),
|
|
21
|
+
processSearchResult: async (elements, config, data) => {
|
|
22
|
+
const dataflow = await data.dataflow();
|
|
23
|
+
const deps = data.inspectContext().deps;
|
|
24
|
+
const meta = { totalCalls: 0 };
|
|
25
|
+
// only report when every loaded library's exports are known: a library() whose package we could
|
|
26
|
+
// not resolve is flagged with an unknown side effect and could export the symbol, so we bail out
|
|
27
|
+
const unknownIds = new Set();
|
|
28
|
+
for (const e of dataflow.graph.unknownSideEffects) {
|
|
29
|
+
unknownIds.add(String(typeof e === 'object' ? e.id : e));
|
|
30
|
+
}
|
|
31
|
+
if (unknownIds.size > 0) {
|
|
32
|
+
for (const [id, v] of dataflow.graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
|
|
33
|
+
if (LibraryLoadFunctions.has(identifier_1.Identifier.getName(v.name)) && unknownIds.has(String(id))) {
|
|
34
|
+
return { results: [], '.meta': meta };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const results = elements.getElements().map(element => {
|
|
39
|
+
const vtx = dataflow.graph.getVertex(element.node.info.id);
|
|
40
|
+
if (!vtx || !(0, vertex_1.isFunctionCallVertex)(vtx) || vtx.origin === 'unnamed') {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
meta.totalCalls++;
|
|
44
|
+
const name = identifier_1.Identifier.getName(vtx.name);
|
|
45
|
+
// resolved locally, as a builtin, or as an attached package export?
|
|
46
|
+
const origins = (0, dfg_get_origin_1.getOriginInDfg)(dataflow.graph, vtx.id);
|
|
47
|
+
if (origins && origins.length > 0) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
// cross-check loaded packages' exports (covers namespace-only / `pkg::fn` loads)
|
|
51
|
+
const namespace = identifier_1.Identifier.getNamespace(vtx.name);
|
|
52
|
+
const known = namespace !== undefined
|
|
53
|
+
? deps.getDependency(namespace)?.has(name) === true
|
|
54
|
+
: deps.getDependencies().some(p => p.has(name));
|
|
55
|
+
if (known) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const loc = range_1.SourceLocation.fromNode(element.node);
|
|
59
|
+
return loc === undefined ? undefined : {
|
|
60
|
+
certainty: linter_format_1.LintingResultCertainty.Uncertain,
|
|
61
|
+
name,
|
|
62
|
+
involvedId: vtx.id,
|
|
63
|
+
loc
|
|
64
|
+
};
|
|
65
|
+
}).filter(assert_1.isNotUndefined);
|
|
66
|
+
return { results, '.meta': meta };
|
|
67
|
+
},
|
|
68
|
+
prettyPrint: {
|
|
69
|
+
[linter_format_1.LintingPrettyPrintContext.Query]: result => `Call to \`${result.name}\` at ${range_1.SourceLocation.format(result.loc)}`,
|
|
70
|
+
[linter_format_1.LintingPrettyPrintContext.Full]: result => `\`${result.name}\` at ${range_1.SourceLocation.format(result.loc)} is neither defined locally nor exported by a loaded package`
|
|
71
|
+
},
|
|
72
|
+
info: {
|
|
73
|
+
name: 'Undefined Symbol',
|
|
74
|
+
certainty: linter_format_1.LintingRuleCertainty.OverApproximative,
|
|
75
|
+
description: 'Flags calls to functions that are neither defined locally, a known builtin, nor exported by a loaded package.',
|
|
76
|
+
tags: [linter_tags_1.LintingRuleTag.Bug, linter_tags_1.LintingRuleTag.Experimental],
|
|
77
|
+
defaultConfig: {}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=undefined-symbol.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
2
2
|
import type { MergeableRecord } from '../../util/objects';
|
|
3
3
|
import { LintingRuleTag } from '../linter-tags';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
5
|
export interface UnusedDefinitionResult extends LintingResult {
|
|
6
6
|
variableName?: string;
|
|
7
7
|
}
|
|
@@ -16,15 +16,10 @@ export interface UnusedDefinitionMetadata extends MergeableRecord {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const UNUSED_DEFINITION: {
|
|
18
18
|
readonly createSearch: (config: UnusedDefinitionConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<ParentInformation, [] | import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>>;
|
|
19
|
-
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: UnusedDefinitionConfig, data: {
|
|
20
|
-
normalize: NormalizedAst;
|
|
21
|
-
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
22
|
-
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
23
|
-
analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
24
|
-
}) => {
|
|
19
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: UnusedDefinitionConfig, data: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => Promise<{
|
|
25
20
|
results: UnusedDefinitionResult[];
|
|
26
21
|
".meta": UnusedDefinitionMetadata;
|
|
27
|
-
}
|
|
22
|
+
}>;
|
|
28
23
|
readonly prettyPrint: {
|
|
29
24
|
readonly query: (result: UnusedDefinitionResult) => string;
|
|
30
25
|
readonly full: (result: UnusedDefinitionResult) => string;
|
|
@@ -58,20 +58,22 @@ function onlyKeepSupersetOfUnused(elements) {
|
|
|
58
58
|
}
|
|
59
59
|
exports.UNUSED_DEFINITION = {
|
|
60
60
|
/* this can be done better once we have types */
|
|
61
|
-
createSearch: config => flowr_search_builder_1.Q.all().filter(config.includeFunctionDefinitions ? flowr_search_filters_1.
|
|
62
|
-
processSearchResult: (elements, config, data) => {
|
|
61
|
+
createSearch: config => flowr_search_builder_1.Q.all().filter(config.includeFunctionDefinitions ? flowr_search_filters_1.F.or(vertex_1.VertexType.VariableDefinition, vertex_1.VertexType.FunctionDefinition) : vertex_1.VertexType.VariableDefinition),
|
|
62
|
+
processSearchResult: async (elements, config, data) => {
|
|
63
|
+
const normalize = await data.normalize();
|
|
64
|
+
const dataflow = await data.dataflow();
|
|
63
65
|
const metadata = {
|
|
64
66
|
totalConsidered: 0
|
|
65
67
|
};
|
|
66
68
|
return {
|
|
67
69
|
results: onlyKeepSupersetOfUnused(elements.getElements().flatMap(element => {
|
|
68
70
|
metadata.totalConsidered++;
|
|
69
|
-
const dfgVertex =
|
|
71
|
+
const dfgVertex = dataflow.graph.getVertex(element.node.info.id);
|
|
70
72
|
if (!dfgVertex || (!(0, vertex_1.isVariableDefinitionVertex)(dfgVertex)
|
|
71
73
|
&& (0, vertex_1.isFunctionDefinitionVertex)(dfgVertex) && !config.includeFunctionDefinitions)) {
|
|
72
74
|
return undefined;
|
|
73
75
|
}
|
|
74
|
-
const ingoingEdges =
|
|
76
|
+
const ingoingEdges = dataflow.graph.ingoingEdges(dfgVertex.id);
|
|
75
77
|
const interestedIn = (0, vertex_1.isVariableDefinitionVertex)(dfgVertex) ? InterestingEdgesVariable : InterestingEdgesFunction;
|
|
76
78
|
const ingoingInteresting = ingoingEdges?.values().some(e => edge_1.DfEdge.includesType(e, interestedIn));
|
|
77
79
|
if (ingoingInteresting) {
|
|
@@ -84,7 +86,7 @@ exports.UNUSED_DEFINITION = {
|
|
|
84
86
|
variableName,
|
|
85
87
|
involvedId: element.node.info.id,
|
|
86
88
|
loc: range_1.SourceLocation.fromNode(element.node) ?? range_1.SourceLocation.invalid(),
|
|
87
|
-
quickFix: buildQuickFix(element.node,
|
|
89
|
+
quickFix: buildQuickFix(element.node, dataflow.graph, normalize)
|
|
88
90
|
}];
|
|
89
91
|
}).filter(assert_1.isNotUndefined)),
|
|
90
92
|
'.meta': metadata
|
|
@@ -14,12 +14,7 @@ export interface UselessLoopMetadata extends MergeableRecord {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const USELESS_LOOP: {
|
|
16
16
|
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>[]>>>;
|
|
17
|
-
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>[]>, useLessLoopConfig: UselessLoopConfig,
|
|
18
|
-
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
19
|
-
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
20
|
-
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
21
|
-
analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
22
|
-
}) => {
|
|
17
|
+
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>[]>, useLessLoopConfig: UselessLoopConfig, data: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => Promise<{
|
|
23
18
|
results: {
|
|
24
19
|
certainty: LintingResultCertainty.Certain;
|
|
25
20
|
name: string;
|
|
@@ -29,7 +24,7 @@ export declare const USELESS_LOOP: {
|
|
|
29
24
|
'.meta': {
|
|
30
25
|
numOfUselessLoops: number;
|
|
31
26
|
};
|
|
32
|
-
}
|
|
27
|
+
}>;
|
|
33
28
|
readonly prettyPrint: {
|
|
34
29
|
readonly query: (result: UselessLoopResult) => string;
|
|
35
30
|
readonly full: (result: UselessLoopResult) => string;
|