@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
|
@@ -13,6 +13,7 @@ const cfg_kind_1 = require("../../project/cfg-kind");
|
|
|
13
13
|
const identify_link_to_last_call_relation_1 = require("../../queries/catalog/call-context-query/identify-link-to-last-call-relation");
|
|
14
14
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
15
15
|
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
16
|
+
const documentation_provider_1 = require("../../r-bridge/roxygen2/documentation-provider");
|
|
16
17
|
/**
|
|
17
18
|
* An enumeration that stores the names of the available enrichments that can be applied to a set of search elements.
|
|
18
19
|
* See {@link FlowrSearchBuilder.with} for more information on how to apply enrichments.
|
|
@@ -22,6 +23,7 @@ var Enrichment;
|
|
|
22
23
|
Enrichment["CallTargets"] = "call-targets";
|
|
23
24
|
Enrichment["LastCall"] = "last-call";
|
|
24
25
|
Enrichment["CfgInformation"] = "cfg-information";
|
|
26
|
+
Enrichment["Roxygen"] = "roxygen";
|
|
25
27
|
Enrichment["QueryData"] = "query-data";
|
|
26
28
|
})(Enrichment || (exports.Enrichment = Enrichment = {}));
|
|
27
29
|
/**
|
|
@@ -46,9 +48,11 @@ exports.Enrichments = {
|
|
|
46
48
|
content.targets = content.targets.concat(origins.map(o => {
|
|
47
49
|
switch (o.type) {
|
|
48
50
|
case 2 /* OriginType.FunctionCallOrigin */:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// a built-in target (e.g. a materialized package export from `library()`) has no
|
|
52
|
+
// user-code node, so surface it as a built-in string target (see `onlyBuiltin` below)
|
|
53
|
+
return node_id_1.NodeId.isBuiltIn(o.id)
|
|
54
|
+
? (0, node_id_1.recoverName)(o.id, n.idMap) ?? String(o.id)
|
|
55
|
+
: { node: n.idMap.get(o.id) };
|
|
52
56
|
case 3 /* OriginType.BuiltInFunctionOrigin */:
|
|
53
57
|
return identifier_1.Identifier.toString(o.fn.name);
|
|
54
58
|
default:
|
|
@@ -60,7 +64,8 @@ exports.Enrichments = {
|
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
//
|
|
67
|
+
// keep only calls whose targets are all built-in; library/package exports arrive as string
|
|
68
|
+
// targets and count as built-in, a target with a `node` is user code and disqualifies the call
|
|
64
69
|
if (args?.onlyBuiltin && content.targets.some(t => typeof t !== 'string')) {
|
|
65
70
|
content.targets = [];
|
|
66
71
|
}
|
|
@@ -112,8 +117,8 @@ exports.Enrichments = {
|
|
|
112
117
|
simplificationPasses: cfg_simplification_1.DefaultCfgSimplificationOrder,
|
|
113
118
|
...args
|
|
114
119
|
};
|
|
115
|
-
// short-circuit if we already have a cfg stored
|
|
116
|
-
if (!args.forceRefresh && prev?.
|
|
120
|
+
// short-circuit if we already have a cfg stored (and the reachability info if requested)
|
|
121
|
+
if (!args.forceRefresh && prev?.cfg && (!args.checkReachable || prev.reachableNodes)) {
|
|
117
122
|
return prev;
|
|
118
123
|
}
|
|
119
124
|
const content = {
|
|
@@ -126,6 +131,25 @@ exports.Enrichments = {
|
|
|
126
131
|
return content;
|
|
127
132
|
}
|
|
128
133
|
},
|
|
134
|
+
[Enrichment.Roxygen]: {
|
|
135
|
+
enrichElement: async (e, _search, analyzer, _args, prev) => {
|
|
136
|
+
const content = (prev ?? {
|
|
137
|
+
documentation: [],
|
|
138
|
+
tags: {}
|
|
139
|
+
});
|
|
140
|
+
const normalize = await analyzer.normalize();
|
|
141
|
+
const roxygen = (0, documentation_provider_1.getDocumentationOf)(e.node.info.id, normalize.idMap);
|
|
142
|
+
if (roxygen !== undefined) {
|
|
143
|
+
const comments = (Array.isArray(roxygen) ? roxygen : [roxygen]);
|
|
144
|
+
content.documentation.push(...comments);
|
|
145
|
+
for (const comment of comments) {
|
|
146
|
+
content.tags[comment.type] ??= [];
|
|
147
|
+
content.tags[comment.type].push(comment);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return content;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
129
153
|
[Enrichment.QueryData]: {
|
|
130
154
|
// the query data enrichment is just a "pass-through" that passes the query data to the underlying search
|
|
131
155
|
enrichElement: (_e, _search, _data, args, prev) => (args ?? prev),
|
|
@@ -5,22 +5,50 @@ import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing
|
|
|
5
5
|
import { type REnvironmentInformation } from '../../dataflow/environments/environment';
|
|
6
6
|
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
import type { DataflowInformation } from '../../dataflow/info';
|
|
8
|
+
import type { DataflowGraph } from '../../dataflow/graph/graph';
|
|
8
9
|
import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
|
|
9
10
|
import { SliceDirection } from '../../util/slice-direction';
|
|
10
11
|
export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogObj>;
|
|
12
|
+
/** Options for {@link staticSlice}. */
|
|
13
|
+
export interface StaticSliceOptions {
|
|
14
|
+
/** The analyzer context (environments, configuration). */
|
|
15
|
+
readonly ctx: ReadOnlyFlowrAnalyzerContext;
|
|
16
|
+
/** Dataflow information including the graph to traverse. */
|
|
17
|
+
readonly info: DataflowInformation;
|
|
18
|
+
/** Normalized AST, used for id resolution and nesting info. */
|
|
19
|
+
readonly ast: NormalizedAst;
|
|
20
|
+
/** Seed node ids to start the BFS from. At least one is required. */
|
|
21
|
+
readonly ids: readonly NodeId[];
|
|
22
|
+
/** Whether to slice forward or backward. Defaults to {@link SliceDirection.Backward}. */
|
|
23
|
+
readonly direction?: SliceDirection;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum BFS visits before the algorithm switches to over-approximation (includes everything).
|
|
26
|
+
* Defaults to 75.
|
|
27
|
+
*/
|
|
28
|
+
readonly threshold?: number;
|
|
29
|
+
/** Memoization cache that can be shared across multiple slices on the same graph. */
|
|
30
|
+
readonly cache?: Map<Fingerprint, Set<NodeId>>;
|
|
31
|
+
/**
|
|
32
|
+
* Pre-built graph to use for BFS traversal instead of (possibly inverting) `info.graph`.
|
|
33
|
+
* `info.graph` is still consulted for function-call resolution, so it must remain the non-inverted original.
|
|
34
|
+
* Used by {@link staticDice} to pass a reduced-and-inverted graph in a single allocation.
|
|
35
|
+
*/
|
|
36
|
+
readonly sliceGraph?: DataflowGraph;
|
|
37
|
+
}
|
|
11
38
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The returned ids can be used to {@link reconstructToCode|reconstruct the slice to R code}.
|
|
15
|
-
* @param ctx - The analyzer context used for slicing.
|
|
16
|
-
* @param info - The dataflow information used for slicing.
|
|
17
|
-
* @param idMap - The mapping from node ids to their information in the AST.
|
|
18
|
-
* @param ids - The seed ids to slice with. Must be at least one.
|
|
19
|
-
* @param direction - The direction to slice in.
|
|
20
|
-
* @param threshold - The maximum number of nodes to visit in the graph. If the threshold is reached, the slice will side with inclusion and drop its minimal guarantee. The limit ensures that the algorithm halts.
|
|
21
|
-
* @param cache - A cache to store the results of the slice. If provided, the slice may use this cache to speed up the slicing process.
|
|
39
|
+
* Computes the node ids to include in a static slice, starting from the given seed ids.
|
|
40
|
+
* The returned ids can be used with {@link reconstructToCode} to reproduce executable R code.
|
|
22
41
|
*/
|
|
23
|
-
export declare function staticSlice(
|
|
42
|
+
export declare function staticSlice(options: StaticSliceOptions): Readonly<SliceResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Computes a program dice: only those nodes reachable forward from `startIds` that are also in the backward slice of `endIds`.
|
|
45
|
+
* This effectively selects all paths from the given start nodes that lead to the given end nodes.
|
|
46
|
+
*
|
|
47
|
+
* For performance, the backward slice is computed first (typically the smaller set), then the graph is
|
|
48
|
+
* reduced to that set and its edges are inverted in a single pass via {@link Dataflow.reduceAndInvertGraph}.
|
|
49
|
+
* The forward traversal then runs only within that subgraph, avoiding nodes that cannot contribute to the dice.
|
|
50
|
+
*/
|
|
51
|
+
export declare function staticDice(ctx: ReadOnlyFlowrAnalyzerContext, info: DataflowInformation, ast: NormalizedAst, startIds: readonly NodeId[], endIds: readonly NodeId[], threshold?: number): Readonly<SliceResult>;
|
|
24
52
|
/**
|
|
25
53
|
* Updates the potential addition for the given target node in the visiting queue.
|
|
26
54
|
* This describes vertices that might be added *if* another path reaches them.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.slicerLogger = void 0;
|
|
4
4
|
exports.staticSlice = staticSlice;
|
|
5
|
+
exports.staticDice = staticDice;
|
|
5
6
|
exports.updatePotentialAddition = updatePotentialAddition;
|
|
6
7
|
const assert_1 = require("../../util/assert");
|
|
7
8
|
const log_1 = require("../../util/log");
|
|
@@ -14,22 +15,24 @@ const slice_direction_1 = require("../../util/slice-direction");
|
|
|
14
15
|
const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
|
|
15
16
|
exports.slicerLogger = log_1.log.getSubLogger({ name: 'slicer' });
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* The returned ids can be used to {@link reconstructToCode|reconstruct the slice to R code}.
|
|
20
|
-
* @param ctx - The analyzer context used for slicing.
|
|
21
|
-
* @param info - The dataflow information used for slicing.
|
|
22
|
-
* @param idMap - The mapping from node ids to their information in the AST.
|
|
23
|
-
* @param ids - The seed ids to slice with. Must be at least one.
|
|
24
|
-
* @param direction - The direction to slice in.
|
|
25
|
-
* @param threshold - The maximum number of nodes to visit in the graph. If the threshold is reached, the slice will side with inclusion and drop its minimal guarantee. The limit ensures that the algorithm halts.
|
|
26
|
-
* @param cache - A cache to store the results of the slice. If provided, the slice may use this cache to speed up the slicing process.
|
|
18
|
+
* Computes the node ids to include in a static slice, starting from the given seed ids.
|
|
19
|
+
* The returned ids can be used with {@link reconstructToCode} to reproduce executable R code.
|
|
27
20
|
*/
|
|
28
|
-
function staticSlice(
|
|
21
|
+
function staticSlice(options) {
|
|
22
|
+
const { ctx, info, ids, cache, sliceGraph } = options;
|
|
23
|
+
const { idMap } = options.ast;
|
|
24
|
+
const direction = options.direction ?? slice_direction_1.SliceDirection.Backward;
|
|
25
|
+
const threshold = options.threshold ?? 75;
|
|
29
26
|
(0, assert_1.guard)(ids.length > 0, 'must have at least one seed id to calculate slice');
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
graph =
|
|
27
|
+
let graph;
|
|
28
|
+
if (sliceGraph !== undefined) {
|
|
29
|
+
graph = sliceGraph;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
graph = info.graph;
|
|
33
|
+
if (direction === slice_direction_1.SliceDirection.Forward) {
|
|
34
|
+
graph = df_helper_1.Dataflow.invertGraph(graph, ctx.env.makeCleanEnv());
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
const queue = new visiting_queue_1.VisitingQueue(threshold, cache);
|
|
35
38
|
let minNesting = Number.MAX_SAFE_INTEGER;
|
|
@@ -107,6 +110,33 @@ function staticSlice(ctx, info, { idMap }, ids, direction, threshold = 75, cache
|
|
|
107
110
|
return { ...queue.status(), slicedFor: ids };
|
|
108
111
|
}
|
|
109
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Computes a program dice: only those nodes reachable forward from `startIds` that are also in the backward slice of `endIds`.
|
|
115
|
+
* This effectively selects all paths from the given start nodes that lead to the given end nodes.
|
|
116
|
+
*
|
|
117
|
+
* For performance, the backward slice is computed first (typically the smaller set), then the graph is
|
|
118
|
+
* reduced to that set and its edges are inverted in a single pass via {@link Dataflow.reduceAndInvertGraph}.
|
|
119
|
+
* The forward traversal then runs only within that subgraph, avoiding nodes that cannot contribute to the dice.
|
|
120
|
+
*/
|
|
121
|
+
function staticDice(ctx, info, ast, startIds, endIds, threshold = 75) {
|
|
122
|
+
(0, assert_1.guard)(startIds.length > 0 && endIds.length > 0, 'must have at least one start and one end id for dicing');
|
|
123
|
+
const backward = staticSlice({ ctx, info, ast, ids: endIds, direction: slice_direction_1.SliceDirection.Backward, threshold });
|
|
124
|
+
// reduce to backward result and invert edges in one pass; original info kept for sliceForCall
|
|
125
|
+
const invertedReduced = df_helper_1.Dataflow.reduceAndInvertGraph(info.graph, backward.result, ctx.env.makeCleanEnv());
|
|
126
|
+
const forward = staticSlice({ ctx, info, ast, ids: startIds, direction: slice_direction_1.SliceDirection.Backward, threshold, sliceGraph: invertedReduced });
|
|
127
|
+
// explicit intersection handles seed nodes that landed outside the reduced graph
|
|
128
|
+
const result = new Set();
|
|
129
|
+
for (const id of forward.result) {
|
|
130
|
+
if (backward.result.has(id)) {
|
|
131
|
+
result.add(id);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
timesHitThreshold: forward.timesHitThreshold + backward.timesHitThreshold,
|
|
136
|
+
result,
|
|
137
|
+
slicedFor: [...startIds, ...endIds],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
110
140
|
function extendSlices(results, ast) {
|
|
111
141
|
const res = new Set();
|
|
112
142
|
for (const id of results) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A FIFO queue over a growable array with amortized O(1) dequeue.
|
|
3
|
+
* Entries are consumed via an index (instead of costly `Array#shift` calls),
|
|
4
|
+
* and the consumed prefix is dropped once it dominates the array,
|
|
5
|
+
* bounding the memory overhead to twice the live queue size.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ArrayQueue<T> {
|
|
8
|
+
private elements;
|
|
9
|
+
private idx;
|
|
10
|
+
constructor(initial?: readonly T[]);
|
|
11
|
+
enqueue(item: T): void;
|
|
12
|
+
/** Returns the oldest element, or `undefined` if the queue {@link isEmpty}. */
|
|
13
|
+
dequeue(): T | undefined;
|
|
14
|
+
get size(): number;
|
|
15
|
+
isEmpty(): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayQueue = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A FIFO queue over a growable array with amortized O(1) dequeue.
|
|
6
|
+
* Entries are consumed via an index (instead of costly `Array#shift` calls),
|
|
7
|
+
* and the consumed prefix is dropped once it dominates the array,
|
|
8
|
+
* bounding the memory overhead to twice the live queue size.
|
|
9
|
+
*/
|
|
10
|
+
class ArrayQueue {
|
|
11
|
+
elements;
|
|
12
|
+
idx = 0;
|
|
13
|
+
constructor(initial) {
|
|
14
|
+
this.elements = initial ? initial.slice() : [];
|
|
15
|
+
}
|
|
16
|
+
enqueue(item) {
|
|
17
|
+
this.elements.push(item);
|
|
18
|
+
}
|
|
19
|
+
/** Returns the oldest element, or `undefined` if the queue {@link isEmpty}. */
|
|
20
|
+
dequeue() {
|
|
21
|
+
if (this.idx >= this.elements.length) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
if (this.idx > 1024 && this.idx * 2 > this.elements.length) {
|
|
25
|
+
this.elements = this.elements.slice(this.idx);
|
|
26
|
+
this.idx = 0;
|
|
27
|
+
}
|
|
28
|
+
return this.elements[this.idx++];
|
|
29
|
+
}
|
|
30
|
+
get size() {
|
|
31
|
+
return this.elements.length - this.idx;
|
|
32
|
+
}
|
|
33
|
+
isEmpty() {
|
|
34
|
+
return this.idx >= this.elements.length;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.ArrayQueue = ArrayQueue;
|
|
38
|
+
//# sourceMappingURL=queue.js.map
|
package/util/log.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ILogObj, type ISettingsParam, Logger } from 'tslog';
|
|
2
2
|
import { type Options } from 'rotating-file-stream';
|
|
3
|
-
export declare const expensiveTrace: (log: Logger<ILogObj
|
|
3
|
+
export declare const expensiveTrace: (log: Logger<ILogObj> | undefined, supplier: () => string) => void;
|
|
4
4
|
export declare class FlowrLogger extends Logger<ILogObj> {
|
|
5
5
|
/** by keeping track of all children we can propagate updates of the settings (e.g., in tests) */
|
|
6
6
|
private readonly childLoggers;
|
package/util/log.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.log = exports.FlowrLogger = exports.expensiveTrace = void 0;
|
|
|
4
4
|
const tslog_1 = require("tslog");
|
|
5
5
|
const rotating_file_stream_1 = require("rotating-file-stream");
|
|
6
6
|
const expensiveTrace = (log, supplier) => {
|
|
7
|
-
if (log.settings.minLevel <= 1 /* LogLevel.Trace */) {
|
|
7
|
+
if (log !== undefined && log.settings.minLevel <= 1 /* LogLevel.Trace */) {
|
|
8
8
|
log.trace(supplier());
|
|
9
9
|
}
|
|
10
10
|
};
|
package/util/mermaid/dfg.d.ts
CHANGED
|
@@ -68,12 +68,12 @@ export declare const DataflowMermaid: {
|
|
|
68
68
|
mermaid: MermaidGraph;
|
|
69
69
|
};
|
|
70
70
|
/**
|
|
71
|
-
* This is a simplified version of {@link DataflowMermaid.
|
|
71
|
+
* This is a simplified version of {@link DataflowMermaid.convert}
|
|
72
72
|
*/
|
|
73
73
|
readonly raw: (this: void, graph: DataflowGraph | DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<NodeId>, simplified?: boolean) => string;
|
|
74
74
|
/**
|
|
75
75
|
* Converts a dataflow graph to a mermaid url that visualizes the graph.
|
|
76
|
-
* This is basically a combination of {@link DataflowMermaid.
|
|
76
|
+
* This is basically a combination of {@link DataflowMermaid.raw} and {@link Mermaid.codeToUrl}.
|
|
77
77
|
* @param graph - the dataflow graph to render
|
|
78
78
|
* @param includeEnvironments - whether to include the environment content in the output
|
|
79
79
|
* @param mark - which vertices to highlight in the visualization
|
package/util/mermaid/dfg.js
CHANGED
|
@@ -243,7 +243,7 @@ exports.DataflowMermaid = {
|
|
|
243
243
|
return { string: `${mermaid.nodeLines.join('\n')}\n${mermaid.edgeLines.join('\n')}`, mermaid };
|
|
244
244
|
},
|
|
245
245
|
/**
|
|
246
|
-
* This is a simplified version of {@link DataflowMermaid.
|
|
246
|
+
* This is a simplified version of {@link DataflowMermaid.convert}
|
|
247
247
|
*/
|
|
248
248
|
raw(graph, includeEnvironments, mark, simplified = false) {
|
|
249
249
|
graph = info_2.DataflowInformation.is(graph) ? graph.graph : graph;
|
|
@@ -251,7 +251,7 @@ exports.DataflowMermaid = {
|
|
|
251
251
|
},
|
|
252
252
|
/**
|
|
253
253
|
* Converts a dataflow graph to a mermaid url that visualizes the graph.
|
|
254
|
-
* This is basically a combination of {@link DataflowMermaid.
|
|
254
|
+
* This is basically a combination of {@link DataflowMermaid.raw} and {@link Mermaid.codeToUrl}.
|
|
255
255
|
* @param graph - the dataflow graph to render
|
|
256
256
|
* @param includeEnvironments - whether to include the environment content in the output
|
|
257
257
|
* @param mark - which vertices to highlight in the visualization
|
|
@@ -46,6 +46,10 @@ export declare const Mermaid: {
|
|
|
46
46
|
* Escapes markdown special characters in a string.
|
|
47
47
|
*/
|
|
48
48
|
readonly escape: (this: void, text: string) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Reserved mermaid flowchart keywords that break parsing when used as a bare node id token.
|
|
51
|
+
*/
|
|
52
|
+
readonly reservedIds: Set<string>;
|
|
49
53
|
/**
|
|
50
54
|
* Escapes a string or number to be used as a mermaid node id.
|
|
51
55
|
*/
|
package/util/mermaid/mermaid.js
CHANGED
|
@@ -55,12 +55,19 @@ exports.Mermaid = {
|
|
|
55
55
|
}
|
|
56
56
|
return text;
|
|
57
57
|
},
|
|
58
|
+
/**
|
|
59
|
+
* Reserved mermaid flowchart keywords that break parsing when used as a bare node id token.
|
|
60
|
+
*/
|
|
61
|
+
reservedIds: new Set([
|
|
62
|
+
'graph', 'flowchart', 'subgraph', 'end', 'style', 'default', 'linkStyle',
|
|
63
|
+
'interpolate', 'classDef', 'class', 'href', 'click', 'call', 'direction'
|
|
64
|
+
]),
|
|
58
65
|
/**
|
|
59
66
|
* Escapes a string or number to be used as a mermaid node id.
|
|
60
67
|
*/
|
|
61
68
|
escapeId(text) {
|
|
62
69
|
text = String(text).replace(/[^a-zA-Z0-9:-]/g, '_');
|
|
63
|
-
return text;
|
|
70
|
+
return text.replace(/(^|[:-])([a-zA-Z0-9_]+)/g, (_m, sep, tok) => sep + (exports.Mermaid.reservedIds.has(tok) ? tok + '_' : tok));
|
|
64
71
|
},
|
|
65
72
|
/**
|
|
66
73
|
* Converts mermaid code (potentially produced by {@link DataflowMermaid.convert}) to an url that presents the graph in the mermaid editor.
|
package/util/objects.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DeepPartial, DeepReadonly, DeepRequired } from 'ts-essentials';
|
|
2
|
+
import type { ILogObj, Logger } from 'tslog';
|
|
2
3
|
/**
|
|
3
4
|
* checks if `item` is an object (it may be an array, ...)
|
|
4
5
|
*/
|
|
@@ -44,4 +45,12 @@ export type AutocompletablePaths<T, Prefix extends string = ''> = T extends Prim
|
|
|
44
45
|
* This is a version of a deep clone that preserves unclonable values (like functions, symbols, ...) by keeping the same reference to them.
|
|
45
46
|
*/
|
|
46
47
|
export declare function deepClonePreserveUnclonable<T>(obj: T): T;
|
|
48
|
+
/**
|
|
49
|
+
* Compares the two passed objects deeply using the loose comparison system designed for the {@link FlowrFilter.MatchesEnrichment}. For this system in use, see {@link FlowrFilter.MatchesEnrichment} in use.
|
|
50
|
+
* @param obj - The real object which we want to test against.
|
|
51
|
+
* @param expected - The object to test the real value {@link obj} against, which should be an object in the shape of {@link obj} with each value to test for replaced by a {@link RegExp} or value to match against. The test will pass if the partial structure matches and the value at each {@link RegExp}, string or primitive location matches the corresponding regular expression. For array entries, {@link arrayMatch} determines whether every element in the array has to match the given expected value, or only some.
|
|
52
|
+
* @param arrayMatch - For array entries, the expected value in {@link test} is compared against each array entry in the real value. This property determines whether every element in the array has to match, or only some. If unset, this defaults to `some`.
|
|
53
|
+
* @param logger - The logger to use for trace debugging.
|
|
54
|
+
*/
|
|
55
|
+
export declare function looselyCompareObjects(obj: Record<string, unknown>, expected: Record<string, unknown>, arrayMatch?: 'some' | 'every', logger?: Logger<ILogObj>): boolean;
|
|
47
56
|
export {};
|
package/util/objects.js
CHANGED
|
@@ -5,7 +5,9 @@ exports.deepMergeObject = deepMergeObject;
|
|
|
5
5
|
exports.deepMergeObjectInPlace = deepMergeObjectInPlace;
|
|
6
6
|
exports.compactRecord = compactRecord;
|
|
7
7
|
exports.deepClonePreserveUnclonable = deepClonePreserveUnclonable;
|
|
8
|
+
exports.looselyCompareObjects = looselyCompareObjects;
|
|
8
9
|
const json_1 = require("./json");
|
|
10
|
+
const log_1 = require("./log");
|
|
9
11
|
/**
|
|
10
12
|
* checks if `item` is an object (it may be an array, ...)
|
|
11
13
|
*/
|
|
@@ -130,4 +132,56 @@ function deepClonePreserveUnclonable(obj) {
|
|
|
130
132
|
return result;
|
|
131
133
|
}
|
|
132
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Compares the two passed objects deeply using the loose comparison system designed for the {@link FlowrFilter.MatchesEnrichment}. For this system in use, see {@link FlowrFilter.MatchesEnrichment} in use.
|
|
137
|
+
* @param obj - The real object which we want to test against.
|
|
138
|
+
* @param expected - The object to test the real value {@link obj} against, which should be an object in the shape of {@link obj} with each value to test for replaced by a {@link RegExp} or value to match against. The test will pass if the partial structure matches and the value at each {@link RegExp}, string or primitive location matches the corresponding regular expression. For array entries, {@link arrayMatch} determines whether every element in the array has to match the given expected value, or only some.
|
|
139
|
+
* @param arrayMatch - For array entries, the expected value in {@link test} is compared against each array entry in the real value. This property determines whether every element in the array has to match, or only some. If unset, this defaults to `some`.
|
|
140
|
+
* @param logger - The logger to use for trace debugging.
|
|
141
|
+
*/
|
|
142
|
+
function looselyCompareObjects(obj, expected, arrayMatch, logger) {
|
|
143
|
+
(0, log_1.expensiveTrace)(logger, () => `Comparing ${JSON.stringify(obj)} against ${JSON.stringify(expected)}`);
|
|
144
|
+
for (const [expectedKey, expectedValue] of Object.entries(expected)) {
|
|
145
|
+
const realValue = obj[expectedKey];
|
|
146
|
+
if (!realValue) {
|
|
147
|
+
(0, log_1.expensiveTrace)(logger, () => `Real value ${JSON.stringify(realValue)} does not exist for expected key ${expectedKey}`);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
if (Array.isArray(realValue)) {
|
|
151
|
+
const match = typeof expectedValue === 'object' ? expectedValue instanceof RegExp ?
|
|
152
|
+
// if we expect a regular expression but an array is supplied, test each value
|
|
153
|
+
(value) => expectedValue.test(typeof value === 'string' ? value : String(value)) :
|
|
154
|
+
// if we expect an object that is not a regular expression, match against our expected structure
|
|
155
|
+
(value) => looselyCompareObjects(value, expectedValue, arrayMatch, logger) :
|
|
156
|
+
// in any other case (primitives!), match against the exact value
|
|
157
|
+
(value) => expectedValue === value;
|
|
158
|
+
if (!(arrayMatch === 'every' ? realValue.every(match) : realValue.some(match))) {
|
|
159
|
+
(0, log_1.expensiveTrace)(logger, () => `Array ${JSON.stringify(realValue)} does not match expected value ${JSON.stringify(expectedValue)} (array match ${arrayMatch})`);
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else if (typeof realValue === 'object') {
|
|
164
|
+
// for objects, we recursively match
|
|
165
|
+
if (!looselyCompareObjects(realValue, expectedValue, arrayMatch, logger)) {
|
|
166
|
+
(0, log_1.expensiveTrace)(logger, () => `Object ${JSON.stringify(realValue)} does not match expected object ${JSON.stringify(expectedValue)}`);
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// for anything else, we match with our regular expression or string
|
|
171
|
+
if (expectedValue instanceof RegExp) {
|
|
172
|
+
if (!expectedValue.test(typeof realValue === 'string' ? realValue : String(realValue))) {
|
|
173
|
+
(0, log_1.expensiveTrace)(logger, () => `Value ${JSON.stringify(realValue)} does not match expected regular expression ${expectedValue}`);
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (typeof expectedValue !== 'object') {
|
|
178
|
+
if (expectedValue !== realValue) {
|
|
179
|
+
(0, log_1.expensiveTrace)(logger, () => `Value ${JSON.stringify(realValue)} does not match expected string ${JSON.stringify(expectedValue)}`);
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
(0, log_1.expensiveTrace)(logger, () => `Object ${JSON.stringify(obj)} matches ${JSON.stringify(expected)}`);
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
133
187
|
//# sourceMappingURL=objects.js.map
|
package/util/proc.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exits after draining stdout/stderr. When Node.js writes to a pipe it does so
|
|
3
|
+
* asynchronously; calling process.exit() directly can truncate pending output.
|
|
4
|
+
* Falls back to a forced exit after 1 min in case a drain callback never fires.
|
|
5
|
+
*/
|
|
6
|
+
export declare function exitSafe(code?: number): void;
|
package/util/proc.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exitSafe = exitSafe;
|
|
4
|
+
/**
|
|
5
|
+
* Exits after draining stdout/stderr. When Node.js writes to a pipe it does so
|
|
6
|
+
* asynchronously; calling process.exit() directly can truncate pending output.
|
|
7
|
+
* Falls back to a forced exit after 1 min in case a drain callback never fires.
|
|
8
|
+
*/
|
|
9
|
+
function exitSafe(code = 0) {
|
|
10
|
+
let pending = 2;
|
|
11
|
+
const done = () => {
|
|
12
|
+
if (--pending === 0) {
|
|
13
|
+
process.exit(code);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
process.stdout.write('', done);
|
|
17
|
+
process.stderr.write('', done);
|
|
18
|
+
setTimeout(() => process.exit(code), 60_000).unref();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=proc.js.map
|
package/util/version.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
|
|
|
6
6
|
const semver_1 = require("semver");
|
|
7
7
|
const assert_1 = require("./assert");
|
|
8
8
|
// this is automatically replaced with the current version by release-it
|
|
9
|
-
const version = '2.
|
|
9
|
+
const version = '2.11.0';
|
|
10
10
|
/**
|
|
11
11
|
* Retrieves the current flowR version as a new {@link SemVer} object.
|
|
12
12
|
*/
|
|
@@ -39,8 +39,16 @@ async function retrieveVersionInformation(input) {
|
|
|
39
39
|
*/
|
|
40
40
|
async function printVersionInformation(output, input) {
|
|
41
41
|
const { flowr, r, engine } = await retrieveVersionInformation(input);
|
|
42
|
+
const faint = (s) => output.formatter.format(s, { style: 2 /* FontStyles.Faint */ });
|
|
42
43
|
output.stdout(`Engine: ${engine}`);
|
|
43
44
|
output.stdout(` flowR: ${flowr}`);
|
|
44
|
-
|
|
45
|
+
// gray out R when it is not actually available
|
|
46
|
+
output.stdout((r === 'none' || r === 'unknown') ? faint(` R: ${r}`) : ` R: ${r}`);
|
|
47
|
+
if (typeof input !== 'function' && 'inspectContext' in input) {
|
|
48
|
+
// reads the current analyzer, so it reflects the databases in use (and adapts to config changes)
|
|
49
|
+
const dbs = input.inspectContext().deps.loadedPackageDatabases();
|
|
50
|
+
const line = ` package databases: ${dbs.length === 0 ? 'none' : dbs.map(d => `${d.scope} (v${d.version}, ${d.date})`).join(', ')}`;
|
|
51
|
+
output.stdout(dbs.length === 0 ? faint(line) : line);
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
//# sourceMappingURL=version.js.map
|
package/cli/common/features.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type FeatureKey } from '../../statistics/features/feature';
|
|
2
|
-
/**
|
|
3
|
-
* Validate that the given features are known by flowR.
|
|
4
|
-
*/
|
|
5
|
-
export declare function validateFeatures(features: (string[] | ['all'] | FeatureKey[])): Set<FeatureKey>;
|
|
6
|
-
/**
|
|
7
|
-
* Retrieve the archive name for the given path.
|
|
8
|
-
*/
|
|
9
|
-
export declare function retrieveArchiveName(p: string): string;
|
package/cli/common/features.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateFeatures = validateFeatures;
|
|
7
|
-
exports.retrieveArchiveName = retrieveArchiveName;
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const feature_1 = require("../../statistics/features/feature");
|
|
10
|
-
/**
|
|
11
|
-
* Validate that the given features are known by flowR.
|
|
12
|
-
*/
|
|
13
|
-
function validateFeatures(features) {
|
|
14
|
-
for (const feature of features) {
|
|
15
|
-
if (feature === 'all') {
|
|
16
|
-
if (features.length > 1) {
|
|
17
|
-
console.error(`Feature "all" must be the only feature given, got ${features.join(', ')}`);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else if (!feature_1.allFeatureNames.has(feature)) {
|
|
22
|
-
console.error(`Feature ${feature} is unknown, supported are ${[...feature_1.allFeatureNames].join(', ')} or "all"`);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return features[0] === 'all' ? feature_1.allFeatureNames : new Set(features);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Retrieve the archive name for the given path.
|
|
30
|
-
*/
|
|
31
|
-
function retrieveArchiveName(p) {
|
|
32
|
-
const basepath = path_1.default.normalize(p);
|
|
33
|
-
return `${basepath.endsWith(path_1.default.sep) ? basepath.substring(0, basepath.length - 1) : basepath}.tar.gz`;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=features.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { StatsCliOptions } from '../statistics-app';
|
|
2
|
-
import type { FlowrConfig } from '../../config';
|
|
3
|
-
/**
|
|
4
|
-
* The core function for the 'flowr stats' script.
|
|
5
|
-
*/
|
|
6
|
-
export declare function flowrScriptGetStats(options: StatsCliOptions, config: FlowrConfig): Promise<void>;
|