@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
|
@@ -47,7 +47,7 @@ const input_sources_query_executor_1 = require("../queries/catalog/input-sources
|
|
|
47
47
|
shortDescription: 'Finds all calls in a set of files that matches specified criteria.',
|
|
48
48
|
functionName: call_context_query_executor_1.executeCallContextQueries.name,
|
|
49
49
|
functionFile: '../queries/catalog/call-context-query/call-context-query-executor.ts',
|
|
50
|
-
buildExplanation: async (shell) => {
|
|
50
|
+
buildExplanation: async (shell, ctx) => {
|
|
51
51
|
return `
|
|
52
52
|
Call context queries can be used to identify calls to specific functions that match criteria of your interest.
|
|
53
53
|
For now, we support two criteria:
|
|
@@ -89,7 +89,7 @@ ${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode,
|
|
|
89
89
|
subkind: 'plot',
|
|
90
90
|
linkTo: { type: 'link-to-last-call', callName: '^plot$' }
|
|
91
91
|
}
|
|
92
|
-
], { showCode: false })}
|
|
92
|
+
], { showCode: false, ctx })}
|
|
93
93
|
|
|
94
94
|
As you can see, all kinds and subkinds with the same name are grouped together.
|
|
95
95
|
Yet, re-stating common arguments and kinds may be cumbersome (although you can already use clever regex patterns).
|
|
@@ -105,7 +105,7 @@ my_test_function()
|
|
|
105
105
|
`.trim();
|
|
106
106
|
return (0, doc_structure_1.details)('Alias Example', `Consider the following code: ${(0, doc_code_1.codeBlock)('r', code)}\nNow let's say we want to query _all_ uses of the \`my_test_function\`:` + await (0, doc_query_1.showQuery)(shell, code, [
|
|
107
107
|
{ type: 'call-context', callName: '^my_test_function', includeAliases: true }
|
|
108
|
-
], { showCode: false }));
|
|
108
|
+
], { showCode: false, ctx }));
|
|
109
109
|
})()}
|
|
110
110
|
`;
|
|
111
111
|
}
|
|
@@ -116,16 +116,16 @@ my_test_function()
|
|
|
116
116
|
shortDescription: 'Returns the dataflow graph of the given code.',
|
|
117
117
|
functionName: dataflow_query_executor_1.executeDataflowQuery.name,
|
|
118
118
|
functionFile: '../queries/catalog/dataflow-query/dataflow-query-executor.ts',
|
|
119
|
-
buildExplanation: async (shell) => {
|
|
119
|
+
buildExplanation: async (shell, ctx) => {
|
|
120
120
|
const exampleCode = 'x + 1';
|
|
121
121
|
return `
|
|
122
|
-
Maybe you want to handle only the result of the query execution, or you just need the
|
|
122
|
+
Maybe you want to handle only the result of the query execution, or you just need the ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graph')} again.
|
|
123
123
|
This query type does exactly that!
|
|
124
124
|
|
|
125
125
|
Using the example code \`${exampleCode}\`, the following query returns the dataflow graph of the code:
|
|
126
126
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
127
127
|
type: 'dataflow'
|
|
128
|
-
}], { showCode: true, collapseQuery: true })}
|
|
128
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
129
129
|
`;
|
|
130
130
|
}
|
|
131
131
|
});
|
|
@@ -143,7 +143,7 @@ This query calculates and returns the ${ctx.linkPage('wiki/Dataflow Graph', 'cal
|
|
|
143
143
|
Using the example code \`${exampleCode}\`, the following query returns the dataflow graph of the code:
|
|
144
144
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
145
145
|
type: 'call-graph'
|
|
146
|
-
}], { showCode: true, collapseQuery: true })}
|
|
146
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
147
147
|
`;
|
|
148
148
|
}
|
|
149
149
|
});
|
|
@@ -153,7 +153,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
153
153
|
shortDescription: 'Checks whether a function calls another function matching given constraints.',
|
|
154
154
|
functionName: does_call_query_executor_1.executeDoesCallQuery.name,
|
|
155
155
|
functionFile: '../queries/catalog/does-call-query/does-call-query-executor.ts',
|
|
156
|
-
buildExplanation: async (shell) => {
|
|
156
|
+
buildExplanation: async (shell, ctx) => {
|
|
157
157
|
const exampleCode = 'f <- function(x) { eval(x) };\nf("1 + 1")';
|
|
158
158
|
return `
|
|
159
159
|
This query checks whether a function calls another function matching given constraints.
|
|
@@ -166,7 +166,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
166
166
|
queryId: 'calls-eval',
|
|
167
167
|
call: '2@f',
|
|
168
168
|
calls: { type: 'name', name: 'eval', nameExact: true }
|
|
169
|
-
}], { showCode: true, collapseQuery: false, shorthand: '(2@f:"eval")' })}
|
|
169
|
+
}], { showCode: true, collapseQuery: false, shorthand: '(2@f:"eval")', ctx })}
|
|
170
170
|
`;
|
|
171
171
|
}
|
|
172
172
|
});
|
|
@@ -176,12 +176,12 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
176
176
|
shortDescription: 'Returns the files matching the given criteria.',
|
|
177
177
|
functionName: files_query_executor_1.executeFileQuery.name,
|
|
178
178
|
functionFile: '../queries/catalog/files-query/files-query-executor.ts',
|
|
179
|
-
buildExplanation: async (shell) => {
|
|
179
|
+
buildExplanation: async (shell, ctx) => {
|
|
180
180
|
return `
|
|
181
181
|
This query returns the files that match the given criteria.
|
|
182
182
|
${await (0, doc_query_1.showQuery)(shell, '', [{
|
|
183
183
|
type: 'files'
|
|
184
|
-
}], { showCode: true, collapseQuery: true })}
|
|
184
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
185
185
|
`;
|
|
186
186
|
}
|
|
187
187
|
});
|
|
@@ -191,7 +191,7 @@ ${await (0, doc_query_1.showQuery)(shell, '', [{
|
|
|
191
191
|
shortDescription: 'Returns information about the analyzed project',
|
|
192
192
|
functionName: dataflow_query_executor_1.executeDataflowQuery.name,
|
|
193
193
|
functionFile: '../queries/catalog/project-query/project-query-executor.ts',
|
|
194
|
-
buildExplanation: async (shell) => {
|
|
194
|
+
buildExplanation: async (shell, ctx) => {
|
|
195
195
|
const exampleCode = 'x + 1';
|
|
196
196
|
return `
|
|
197
197
|
This query returns the information about the analyzed project.
|
|
@@ -199,7 +199,7 @@ If present, it will incorporate plugins to, e.g., extract author and license inf
|
|
|
199
199
|
|
|
200
200
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
201
201
|
type: 'project'
|
|
202
|
-
}], { showCode: true, collapseQuery: true })}
|
|
202
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
203
203
|
`;
|
|
204
204
|
}
|
|
205
205
|
});
|
|
@@ -209,16 +209,16 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
209
209
|
shortDescription: 'Returns the normalized AST of the given code.',
|
|
210
210
|
functionName: normalized_ast_query_executor_1.executeNormalizedAstQuery.name,
|
|
211
211
|
functionFile: '../queries/catalog/normalized-ast-query/normalized-ast-query-executor.ts',
|
|
212
|
-
buildExplanation: async (shell) => {
|
|
212
|
+
buildExplanation: async (shell, ctx) => {
|
|
213
213
|
const exampleCode = 'x + 1';
|
|
214
214
|
return `
|
|
215
|
-
Maybe you want to handle only the result of the query execution, or you just need the
|
|
215
|
+
Maybe you want to handle only the result of the query execution, or you just need the ${ctx.linkPage('wiki/Normalized AST', 'normalized AST')} again.
|
|
216
216
|
This query type does exactly that!
|
|
217
217
|
|
|
218
218
|
Using the example code \`${exampleCode}\`, the following query returns the normalized AST of the code:
|
|
219
219
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
220
220
|
type: 'normalized-ast'
|
|
221
|
-
}], { showCode: true, collapseQuery: true })}
|
|
221
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
222
222
|
`;
|
|
223
223
|
}
|
|
224
224
|
});
|
|
@@ -228,7 +228,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
228
228
|
shortDescription: 'Calculates and returns all the clusters present in the dataflow graph.',
|
|
229
229
|
functionName: cluster_query_executor_1.executeDataflowClusterQuery.name,
|
|
230
230
|
functionFile: '../queries/catalog/cluster-query/cluster-query-executor.ts',
|
|
231
|
-
buildExplanation: async (shell) => {
|
|
231
|
+
buildExplanation: async (shell, ctx) => {
|
|
232
232
|
const exampleA = 'x <- 1; x';
|
|
233
233
|
const exampleB = 'x <- 1; y';
|
|
234
234
|
return `
|
|
@@ -239,13 +239,13 @@ edges in both directions. From this perspective,
|
|
|
239
239
|
the code \`${exampleA}\` has one cluster (given that all code is related),
|
|
240
240
|
while the code \`${exampleB}\` has two clusters (given that the \`y\` has no relation to the previous definition).
|
|
241
241
|
|
|
242
|
-
${(0, doc_structure_1.details)('Example <code>' + exampleA + '</code>', await (0, doc_query_1.showQuery)(shell, exampleA, [{ type: 'dataflow-cluster' }], { showCode: false }))}
|
|
243
|
-
${(0, doc_structure_1.details)('Example <code>' + exampleB + '</code>', await (0, doc_query_1.showQuery)(shell, exampleB, [{ type: 'dataflow-cluster' }], { showCode: false }))}
|
|
242
|
+
${(0, doc_structure_1.details)('Example <code>' + exampleA + '</code>', await (0, doc_query_1.showQuery)(shell, exampleA, [{ type: 'dataflow-cluster' }], { showCode: false, ctx }))}
|
|
243
|
+
${(0, doc_structure_1.details)('Example <code>' + exampleB + '</code>', await (0, doc_query_1.showQuery)(shell, exampleB, [{ type: 'dataflow-cluster' }], { showCode: false, ctx }))}
|
|
244
244
|
|
|
245
245
|
Using the example code from above, the following query returns all clusters:
|
|
246
246
|
${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode, [{
|
|
247
247
|
type: 'dataflow-cluster'
|
|
248
|
-
}], { showCode: false, collapseQuery: true })}
|
|
248
|
+
}], { showCode: false, collapseQuery: true, ctx })}
|
|
249
249
|
`;
|
|
250
250
|
}
|
|
251
251
|
});
|
|
@@ -255,18 +255,18 @@ ${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode,
|
|
|
255
255
|
shortDescription: 'Provides access to flowR\'s value tracking (which is configurable)',
|
|
256
256
|
functionName: search_query_executor_1.executeSearch.name,
|
|
257
257
|
functionFile: '../queries/catalog/resolve-value-query/resolve-value-query-executor.ts',
|
|
258
|
-
buildExplanation: async (shell) => {
|
|
258
|
+
buildExplanation: async (shell, ctx) => {
|
|
259
259
|
const exampleCode = 'x <- 1\ny <-2\nprint(x)\nprint(y)';
|
|
260
260
|
const criteria = ['3@x', '4@y'];
|
|
261
261
|
return `
|
|
262
262
|
With this query you can use flowR's value-tracking capabilities to resolve identifiers to all potential values they may have at runtime (if possible).
|
|
263
|
-
The extent to which flowR traces values (e.g., built-ins vs. constants) can be configured in flowR's Configuration file (see the
|
|
263
|
+
The extent to which flowR traces values (e.g., built-ins vs. constants) can be configured in flowR's Configuration file (see the ${ctx.linkPage('wiki/Interface', 'Interface')} wiki page for more information).
|
|
264
264
|
|
|
265
265
|
Using the example code \`${exampleCode}\` (with newlines), the following query returns all values of \`x\` in the code:
|
|
266
266
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
267
267
|
type: 'resolve-value',
|
|
268
268
|
criteria: criteria
|
|
269
|
-
}], { showCode: true, shorthand: (0, doc_query_1.sliceQueryShorthand)(criteria, (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
269
|
+
}], { showCode: true, shorthand: (0, doc_query_1.sliceQueryShorthand)(criteria, (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
270
270
|
`;
|
|
271
271
|
}
|
|
272
272
|
});
|
|
@@ -276,7 +276,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
276
276
|
shortDescription: 'Determine whether functions are higher-order functions',
|
|
277
277
|
functionName: inspect_higher_order_query_executor_1.executeHigherOrderQuery.name,
|
|
278
278
|
functionFile: '../queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.ts',
|
|
279
|
-
buildExplanation: async (shell) => {
|
|
279
|
+
buildExplanation: async (shell, ctx) => {
|
|
280
280
|
const exampleCode = 'f <- function() function(x) x; f()';
|
|
281
281
|
return `
|
|
282
282
|
With this query you can identify which functions in the code are higher-order functions, i.e., either take a function as an argument or return a function.
|
|
@@ -285,13 +285,13 @@ Please note, that functions that are just identities (e.g., \`function(x) x\`) a
|
|
|
285
285
|
Using the example code \`${exampleCode}\` the following query returns the information for all identified function definitions whether they are higher-order functions:
|
|
286
286
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
287
287
|
type: 'inspect-higher-order',
|
|
288
|
-
}], { showCode: true, collapseQuery: true })}
|
|
288
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
289
289
|
|
|
290
290
|
This query also supports a slicing criterion based query mode that only returns information for functions matching the given criteria:
|
|
291
291
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
292
292
|
type: 'inspect-higher-order',
|
|
293
293
|
filter: ['1@function']
|
|
294
|
-
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@function'], (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
294
|
+
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@function'], (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
295
295
|
`;
|
|
296
296
|
}
|
|
297
297
|
});
|
|
@@ -301,7 +301,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
301
301
|
shortDescription: 'Determine whether functions are recursive',
|
|
302
302
|
functionName: inspect_recursion_query_executor_1.executeRecursionQuery.name,
|
|
303
303
|
functionFile: '../queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.ts',
|
|
304
|
-
buildExplanation: async (shell) => {
|
|
304
|
+
buildExplanation: async (shell, ctx) => {
|
|
305
305
|
const exampleCode = 'fact <- function(n) { if(n <= 1) 1 else n * fact(n - 1) }';
|
|
306
306
|
return `
|
|
307
307
|
With this query you can identify which functions in the code are recursive.
|
|
@@ -310,13 +310,13 @@ Please note, that functions that *may* be recursive due to indirect calls are al
|
|
|
310
310
|
Using the example code \`${exampleCode}\` the following query returns the information for all identified function definitions whether they are recursive:
|
|
311
311
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
312
312
|
type: 'inspect-recursion',
|
|
313
|
-
}], { showCode: true, collapseQuery: true })}
|
|
313
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
314
314
|
|
|
315
315
|
This query also supports a slicing criterion based query mode that only returns information for functions matching the given criteria:
|
|
316
316
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
317
317
|
type: 'inspect-recursion',
|
|
318
318
|
filter: ['1@function']
|
|
319
|
-
}], { showCode: true, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@function'], (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
319
|
+
}], { showCode: true, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@function'], (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
320
320
|
`;
|
|
321
321
|
}
|
|
322
322
|
});
|
|
@@ -326,7 +326,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
326
326
|
shortDescription: 'Determine whether functions throw exceptions (known to flowR)',
|
|
327
327
|
functionName: inspect_exception_query_executor_1.executeExceptionQuery.name,
|
|
328
328
|
functionFile: '../queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.ts',
|
|
329
|
-
buildExplanation: async (shell) => {
|
|
329
|
+
buildExplanation: async (shell, ctx) => {
|
|
330
330
|
const exampleCode = `mayFail <- function(x) {
|
|
331
331
|
if(x < 0) stop("Negative value!")
|
|
332
332
|
else sqrt(x)
|
|
@@ -345,7 +345,7 @@ ${(0, doc_code_1.codeBlock)('r', exampleCode)}
|
|
|
345
345
|
the following query returns the information for all identified function definitions whether they throw exceptions:
|
|
346
346
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
347
347
|
type: 'inspect-exception',
|
|
348
|
-
}], { showCode: true, collapseQuery: true })}
|
|
348
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
349
349
|
`;
|
|
350
350
|
}
|
|
351
351
|
});
|
|
@@ -355,7 +355,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
355
355
|
shortDescription: 'Retrieve the origin of a variable, function call, ...',
|
|
356
356
|
functionName: search_query_executor_1.executeSearch.name,
|
|
357
357
|
functionFile: '../queries/catalog/origin-query/origin-query-executor.ts',
|
|
358
|
-
buildExplanation: async (shell) => {
|
|
358
|
+
buildExplanation: async (shell, ctx) => {
|
|
359
359
|
const exampleCode = 'x <- 1\nprint(x)';
|
|
360
360
|
const criterion = '2@x';
|
|
361
361
|
return `
|
|
@@ -366,7 +366,7 @@ Using the example code \`${exampleCode}\` (with the \`print(x)\` in the second l
|
|
|
366
366
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
367
367
|
type: 'origin',
|
|
368
368
|
criterion: criterion
|
|
369
|
-
}], { showCode: true, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
369
|
+
}], { showCode: true, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
370
370
|
`;
|
|
371
371
|
}
|
|
372
372
|
});
|
|
@@ -376,16 +376,16 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
376
376
|
shortDescription: 'Provides access to flowR\'s search API',
|
|
377
377
|
functionName: search_query_executor_1.executeSearch.name,
|
|
378
378
|
functionFile: '../queries/catalog/search-query/search-query-executor.ts',
|
|
379
|
-
buildExplanation: async (shell) => {
|
|
379
|
+
buildExplanation: async (shell, ctx) => {
|
|
380
380
|
const exampleCode = 'x + 1';
|
|
381
381
|
return `
|
|
382
|
-
With this query you can use the
|
|
382
|
+
With this query you can use the ${ctx.linkPage('wiki/Search API', 'Search API')} to conduct searches on the flowR analysis result.
|
|
383
383
|
|
|
384
384
|
Using the example code \`${exampleCode}\`, the following query returns all uses of 'x' in the code:
|
|
385
385
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
386
386
|
type: 'search',
|
|
387
387
|
search: flowr_search_builder_1.Q.var('x').filter(vertex_1.VertexType.Use).build()
|
|
388
|
-
}], { showCode: true, collapseQuery: false })}
|
|
388
|
+
}], { showCode: true, collapseQuery: false, ctx })}
|
|
389
389
|
`;
|
|
390
390
|
}
|
|
391
391
|
});
|
|
@@ -395,7 +395,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
395
395
|
shortDescription: 'Check whether one normalized AST node happens before another in the CFG.',
|
|
396
396
|
functionName: search_query_executor_1.executeSearch.name,
|
|
397
397
|
functionFile: '../queries/catalog/happens-before-query/happens-before-query-executor.ts',
|
|
398
|
-
buildExplanation: async (shell) => {
|
|
398
|
+
buildExplanation: async (shell, ctx) => {
|
|
399
399
|
const exampleCode = 'x <- 1\ny <- 2';
|
|
400
400
|
return `
|
|
401
401
|
With this query you can analyze the control flow graph:
|
|
@@ -409,7 +409,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
409
409
|
type: 'happens-before',
|
|
410
410
|
a: '1@x',
|
|
411
411
|
b: '2@y'
|
|
412
|
-
}], { showCode: true, collapseQuery: false })}
|
|
412
|
+
}], { showCode: true, collapseQuery: false, ctx })}
|
|
413
413
|
`;
|
|
414
414
|
}
|
|
415
415
|
});
|
|
@@ -419,15 +419,15 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
419
419
|
shortDescription: 'Returns the id-map of the normalized AST of the given code.',
|
|
420
420
|
functionName: id_map_query_executor_1.executeIdMapQuery.name,
|
|
421
421
|
functionFile: '../queries/catalog/id-map-query/id-map-query-executor.ts',
|
|
422
|
-
buildExplanation: async (shell) => {
|
|
422
|
+
buildExplanation: async (shell, ctx) => {
|
|
423
423
|
const exampleCode = 'x + 1';
|
|
424
424
|
return `
|
|
425
|
-
This query provides access to all nodes in the
|
|
425
|
+
This query provides access to all nodes in the ${ctx.linkPage('wiki/Normalized AST', 'normalized AST')} as a mapping from their id to the node itself.
|
|
426
426
|
|
|
427
427
|
Using the example code \`${exampleCode}\`, the following query returns all nodes from the code:
|
|
428
428
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
429
429
|
type: 'id-map'
|
|
430
|
-
}], { showCode: true, collapseQuery: true })}
|
|
430
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
431
431
|
`;
|
|
432
432
|
}
|
|
433
433
|
});
|
|
@@ -437,16 +437,16 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
437
437
|
shortDescription: 'Returns the current configuration of flowR.',
|
|
438
438
|
functionName: config_query_executor_1.executeConfigQuery.name,
|
|
439
439
|
functionFile: '../queries/catalog/config-query/config-query-format.ts',
|
|
440
|
-
buildExplanation: async (shell) => {
|
|
440
|
+
buildExplanation: async (shell, ctx) => {
|
|
441
441
|
return `
|
|
442
|
-
This query provides access to the current configuration of the flowR instance. See the
|
|
442
|
+
This query provides access to the current configuration of the flowR instance. See the ${ctx.linkPage('wiki/Interface', 'Interface')} wiki page for more information on what the configuration represents.
|
|
443
443
|
Additionally, you can use this query to update the configuration of flowR on-the-fly (please do not rely on this mechanism it is mostly of interest for demonstrations).
|
|
444
444
|
${await (0, doc_query_1.showQuery)(shell, '', [{
|
|
445
445
|
type: 'config',
|
|
446
446
|
update: {
|
|
447
447
|
ignoreSourceCalls: true
|
|
448
448
|
}
|
|
449
|
-
}], { showCode: false, collapseQuery: true, collapseResult: true })}
|
|
449
|
+
}], { showCode: false, collapseQuery: true, collapseResult: true, ctx })}
|
|
450
450
|
|
|
451
451
|
Please note that, in the REPL, a special syntax starting with \`+\` (which should be autocompleted) can be used to update the configuration on the fly:
|
|
452
452
|
|
|
@@ -468,20 +468,20 @@ enables quick statistics after each REPL command. Likewise, setting \`repl.dfPro
|
|
|
468
468
|
shortDescription: 'Returns the shapes inferred for all dataframes in the code.',
|
|
469
469
|
functionName: df_shape_query_executor_1.executeDfShapeQuery.name,
|
|
470
470
|
functionFile: '../queries/catalog/df-shape-query/df-shape-query-format.ts',
|
|
471
|
-
buildExplanation: async (shell) => {
|
|
471
|
+
buildExplanation: async (shell, ctx) => {
|
|
472
472
|
const exampleCode = 'x <- data.frame(a=1:3)\nfilter(x, FALSE)';
|
|
473
473
|
const criterion = '2@x';
|
|
474
474
|
return `
|
|
475
475
|
This query infers all shapes of dataframes within the code. For example, you can use:
|
|
476
476
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
477
477
|
type: 'df-shape'
|
|
478
|
-
}], { showCode: true, collapseQuery: true })}
|
|
478
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
479
479
|
|
|
480
480
|
The query also accepts an optional slice criterion to narrow the results to a specific node. For example:
|
|
481
481
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
482
482
|
type: 'df-shape',
|
|
483
483
|
criterion: criterion
|
|
484
|
-
}], { showCode: true, collapseQuery: true, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
484
|
+
}], { showCode: true, collapseQuery: true, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
485
485
|
`;
|
|
486
486
|
}
|
|
487
487
|
});
|
|
@@ -491,7 +491,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
491
491
|
shortDescription: 'Combines multiple queries of the same type into one, specifying common arguments.',
|
|
492
492
|
functionName: compound_query_1.executeCompoundQueries.name,
|
|
493
493
|
functionFile: '../queries/virtual-query/compound-query.ts',
|
|
494
|
-
buildExplanation: async (shell) => {
|
|
494
|
+
buildExplanation: async (shell, ctx) => {
|
|
495
495
|
return `
|
|
496
496
|
A compound query comes in use, whenever we want to state multiple queries of the same type with a set of common arguments.
|
|
497
497
|
It offers the following properties of interest:
|
|
@@ -511,13 +511,13 @@ ${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode,
|
|
|
511
511
|
{ callName: '^mean$' },
|
|
512
512
|
{ callName: '^print$' }
|
|
513
513
|
]
|
|
514
|
-
}], { showCode: false })}
|
|
514
|
+
}], { showCode: false, ctx })}
|
|
515
515
|
|
|
516
516
|
Of course, in this specific scenario, the following query would be equivalent:
|
|
517
517
|
|
|
518
518
|
${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode, [
|
|
519
519
|
{ type: 'call-context', callName: '^(mean|print)$', kind: 'visualize', subkind: 'text' }
|
|
520
|
-
], { showCode: false, collapseResult: true })}
|
|
520
|
+
], { showCode: false, collapseResult: true, ctx })}
|
|
521
521
|
|
|
522
522
|
However, compound queries become more useful whenever common arguments can not be expressed as a union in one of their properties.
|
|
523
523
|
Additionally, you can still overwrite default arguments.
|
|
@@ -532,7 +532,7 @@ ${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode,
|
|
|
532
532
|
{ callName: '^mean$' },
|
|
533
533
|
{ callName: '^print$', callTargets: identify_link_to_last_call_relation_1.CallTargets.OnlyLocal }
|
|
534
534
|
]
|
|
535
|
-
}], { showCode: false })}
|
|
535
|
+
}], { showCode: false, ctx })}
|
|
536
536
|
|
|
537
537
|
Now, the results no longer contain calls to \`plot\` that are not defined locally.
|
|
538
538
|
|
|
@@ -545,12 +545,12 @@ Now, the results no longer contain calls to \`plot\` that are not defined locall
|
|
|
545
545
|
shortDescription: 'Slice the dataflow graph reducing the code to just the parts relevant for the given criteria (backward and forward).',
|
|
546
546
|
functionName: static_slice_query_executor_1.executeStaticSliceQuery.name,
|
|
547
547
|
functionFile: '../queries/catalog/static-slice-query/static-slice-query-executor.ts',
|
|
548
|
-
buildExplanation: async (shell) => {
|
|
548
|
+
buildExplanation: async (shell, ctx) => {
|
|
549
549
|
const exampleCode = 'x <- 1\ny <- 2\nz <- 3\nx';
|
|
550
550
|
const criteria = ['3@z', '4@x'];
|
|
551
551
|
return `
|
|
552
552
|
To slice, _flowR_ needs one thing from you: a variable or a list of variables (function calls are supported to, referring to the anonymous
|
|
553
|
-
return of the call) that you want to slice the dataflow graph for (additionally, you have to tell flowR if you want to have a forward slice).
|
|
553
|
+
return of the call) that you want to slice the dataflow graph for (additionally, you have to tell flowR if you want to have a forward slice).
|
|
554
554
|
Given this, the backward slice is essentially the subpart of the program that may influence the value of the variables you are interested in.
|
|
555
555
|
To specify a variable of interest, you have to present flowR with a [slicing criterion](${doc_files_1.FlowrWikiBaseRef}/Terminology#slicing-criterion) (or, respectively, an array of them).
|
|
556
556
|
|
|
@@ -561,7 +561,7 @@ If you are interested in the parts required for the use of \`x\` in the last lin
|
|
|
561
561
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
562
562
|
type: 'static-slice',
|
|
563
563
|
criteria: criteria
|
|
564
|
-
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(criteria, (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
564
|
+
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(criteria, (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
565
565
|
|
|
566
566
|
In general, you may be uninterested in seeing the reconstructed version and want to save some computation time, for this,
|
|
567
567
|
you can use the \`noReconstruction\` flag.
|
|
@@ -570,7 +570,7 @@ ${(0, doc_structure_1.details)('No Reconstruction Example', await (0, doc_query_
|
|
|
570
570
|
type: 'static-slice',
|
|
571
571
|
criteria: ['4@x'],
|
|
572
572
|
noReconstruction: true
|
|
573
|
-
}], { showCode: false }))}
|
|
573
|
+
}], { showCode: false, ctx }))}
|
|
574
574
|
|
|
575
575
|
Likewise, if you want the forward slice for the first use of \`x\`, you can do it like this:
|
|
576
576
|
|
|
@@ -578,10 +578,10 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
578
578
|
type: 'static-slice',
|
|
579
579
|
criteria: ['1@x'],
|
|
580
580
|
direction: slice_direction_1.SliceDirection.Forward
|
|
581
|
-
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@x'], (0, doc_escape_1.escapeNewline)(exampleCode), true) })}
|
|
581
|
+
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@x'], (0, doc_escape_1.escapeNewline)(exampleCode), true), ctx })}
|
|
582
582
|
|
|
583
|
-
You can disable
|
|
584
|
-
This query replaces the old
|
|
583
|
+
You can disable ${ctx.linkPage('wiki/Interface', 'magic comments', 'slice-magic-comments')} using the \`noMagicComments\` flag.
|
|
584
|
+
This query replaces the old ${ctx.linkPage('wiki/Interface', '`request-slice`', 'message-request-slice')} message.
|
|
585
585
|
`;
|
|
586
586
|
}
|
|
587
587
|
});
|
|
@@ -591,7 +591,7 @@ This query replaces the old [\`request-slice\`](${doc_files_1.FlowrWikiBaseRef}/
|
|
|
591
591
|
shortDescription: 'Calculate the provenance of a given variable, optionally restricted to its enveloping fdef',
|
|
592
592
|
functionName: provenance_query_executor_1.executeProvenanceQuery.name,
|
|
593
593
|
functionFile: '../queries/catalog/provenance-query/provenance-query-executor.ts',
|
|
594
|
-
buildExplanation: async (shell) => {
|
|
594
|
+
buildExplanation: async (shell, ctx) => {
|
|
595
595
|
const exampleCode = 'x <- 1\ny <- 2\nz <- 3\nx';
|
|
596
596
|
const criterion = '4@x';
|
|
597
597
|
return `
|
|
@@ -605,7 +605,7 @@ If you are interested in the provenance of the \`x\` in the last line you can us
|
|
|
605
605
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
606
606
|
type: 'provenance',
|
|
607
607
|
criterion
|
|
608
|
-
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
608
|
+
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
609
609
|
`;
|
|
610
610
|
}
|
|
611
611
|
});
|
|
@@ -615,7 +615,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
615
615
|
shortDescription: 'Classify the input sources of function calls',
|
|
616
616
|
functionName: input_sources_query_executor_1.executeInputSourcesQuery.name,
|
|
617
617
|
functionFile: '../queries/catalog/input-sources-query/input-sources-query-executor.ts',
|
|
618
|
-
buildExplanation: async (shell) => {
|
|
618
|
+
buildExplanation: async (shell, ctx) => {
|
|
619
619
|
const exampleCode = `
|
|
620
620
|
f <- function(x) {
|
|
621
621
|
x <- x * 2
|
|
@@ -633,7 +633,7 @@ If you are interested in the input-sources of the \`print\` call, you can use:
|
|
|
633
633
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
634
634
|
type: 'input-sources',
|
|
635
635
|
criterion
|
|
636
|
-
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
636
|
+
}], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)([criterion], (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
637
637
|
`;
|
|
638
638
|
}
|
|
639
639
|
});
|
|
@@ -643,7 +643,7 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
643
643
|
shortDescription: 'Returns all direct dependencies (in- and outputs) of a given R script',
|
|
644
644
|
functionName: dependencies_query_executor_1.executeDependenciesQuery.name,
|
|
645
645
|
functionFile: '../queries/catalog/dependencies-query/dependencies-query-executor.ts',
|
|
646
|
-
buildExplanation: async (shell) => {
|
|
646
|
+
buildExplanation: async (shell, ctx) => {
|
|
647
647
|
const exampleCode = 'library(x)';
|
|
648
648
|
const longerCode = `
|
|
649
649
|
source("sample.R")
|
|
@@ -659,12 +659,13 @@ print("hello world!")
|
|
|
659
659
|
`;
|
|
660
660
|
return `
|
|
661
661
|
This query extracts all dependencies from an R script, using a combination of a ${(0, doc_query_1.linkToQueryOfName)('call-context')}
|
|
662
|
-
and more advanced tracking in the
|
|
662
|
+
and more advanced tracking in the ${ctx.linkPage('wiki/Dataflow Graph', 'Dataflow Graph')}.
|
|
663
|
+
Loaded libraries are resolved against the ${ctx.linkPage('wiki/Package Database', 'package database')}.
|
|
663
664
|
|
|
664
665
|
In other words, if you have a script simply reading: \`${exampleCode}\`, the following query returns the loaded library:
|
|
665
666
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
666
667
|
type: 'dependencies'
|
|
667
|
-
}], { showCode: false, collapseQuery: true })}
|
|
668
|
+
}], { showCode: false, collapseQuery: true, ctx })}
|
|
668
669
|
|
|
669
670
|
Of course, this works for more complicated scripts too. The query offers information on the loaded _libraries_, _sourced_ files, data which is _read_ and data which is _written_.
|
|
670
671
|
For example, consider the following script:
|
|
@@ -672,7 +673,7 @@ ${(0, doc_code_1.codeBlock)('r', longerCode)}
|
|
|
672
673
|
The following query returns the dependencies of the script.
|
|
673
674
|
${await (0, doc_query_1.showQuery)(shell, longerCode, [{
|
|
674
675
|
type: 'dependencies'
|
|
675
|
-
}], { showCode: false, collapseQuery: true, collapseResult: true })}
|
|
676
|
+
}], { showCode: false, collapseQuery: true, collapseResult: true, ctx })}
|
|
676
677
|
|
|
677
678
|
Currently, the dependency extraction may fail as it is essentially a set of heuristics guessing the dependencies.
|
|
678
679
|
We welcome any feedback on this (consider opening a [new issue](${doc_issue_1.NewIssueUrl})).
|
|
@@ -684,7 +685,7 @@ ${await (0, doc_query_1.showQuery)(shell, longerCode, [{
|
|
|
684
685
|
ignoreDefaultFunctions: true,
|
|
685
686
|
enabledCategories: ['library'],
|
|
686
687
|
libraryFunctions: [{ package: 'base', name: 'print', argIdx: 0, argName: 'library', resolveValue: true }],
|
|
687
|
-
}], { showCode: false, collapseQuery: false, collapseResult: true })}
|
|
688
|
+
}], { showCode: false, collapseQuery: false, collapseResult: true, ctx })}
|
|
688
689
|
|
|
689
690
|
Here, \`resolveValue\` tells the dependency query to resolve the value of this argument in case it is not a constant.
|
|
690
691
|
`;
|
|
@@ -696,7 +697,7 @@ Here, \`resolveValue\` tells the dependency query to resolve the value of this a
|
|
|
696
697
|
shortDescription: 'Lints a given R script for common issues.',
|
|
697
698
|
functionName: dependencies_query_executor_1.executeDependenciesQuery.name,
|
|
698
699
|
functionFile: '../queries/catalog/linter-query/linter-query-executor.ts',
|
|
699
|
-
buildExplanation: async (shell) => {
|
|
700
|
+
buildExplanation: async (shell, ctx) => {
|
|
700
701
|
const exampleCode = 'read.csv("i_do_not_exist.csv")';
|
|
701
702
|
return `
|
|
702
703
|
This query lints a given R script for common issues, such as missing files, unused variables, and more.
|
|
@@ -704,7 +705,7 @@ This query lints a given R script for common issues, such as missing files, unus
|
|
|
704
705
|
In other words, if you have a script simply reading: \`${exampleCode}\`, the following query returns all smells detected:
|
|
705
706
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
706
707
|
type: 'linter'
|
|
707
|
-
}], { showCode: false, collapseQuery: true })}
|
|
708
|
+
}], { showCode: false, collapseQuery: true, ctx })}
|
|
708
709
|
|
|
709
710
|
You can also configure which rules to apply and what settings to use for these rules:
|
|
710
711
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
@@ -713,7 +714,8 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
713
714
|
}], {
|
|
714
715
|
showCode: false,
|
|
715
716
|
collapseQuery: true,
|
|
716
|
-
shorthand: `rules:file-path-validity "${exampleCode}"
|
|
717
|
+
shorthand: `rules:file-path-validity "${exampleCode}"`,
|
|
718
|
+
ctx
|
|
717
719
|
})}
|
|
718
720
|
|
|
719
721
|
We welcome any feedback and suggestions for new rules on this (consider opening a [new issue](${doc_issue_1.NewIssueUrl})).
|
|
@@ -726,7 +728,7 @@ We welcome any feedback and suggestions for new rules on this (consider opening
|
|
|
726
728
|
shortDescription: 'Provides the control-flow of the program.',
|
|
727
729
|
functionName: control_flow_query_executor_1.executeControlFlowQuery.name,
|
|
728
730
|
functionFile: '../queries/catalog/control-flow-query/control-flow-query-executor.ts',
|
|
729
|
-
buildExplanation: async (shell) => {
|
|
731
|
+
buildExplanation: async (shell, ctx) => {
|
|
730
732
|
const exampleCode = 'if(TRUE) 1 else 2';
|
|
731
733
|
return `
|
|
732
734
|
This control-flow query provides you access to the control flow graph.
|
|
@@ -734,7 +736,7 @@ This control-flow query provides you access to the control flow graph.
|
|
|
734
736
|
In other words, if you have a script simply reading: \`${exampleCode}\`, the following query returns the CFG:
|
|
735
737
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
736
738
|
type: 'control-flow'
|
|
737
|
-
}], { showCode: false, collapseQuery: true, collapseResult: true })}
|
|
739
|
+
}], { showCode: false, collapseQuery: true, collapseResult: true, ctx })}
|
|
738
740
|
|
|
739
741
|
You can also overwrite the simplification passes to tune the perspective. for example, if you want to have basic blocks:
|
|
740
742
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
@@ -742,11 +744,11 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
742
744
|
config: {
|
|
743
745
|
simplificationPasses: ['unique-cf-sets', 'to-basic-blocks']
|
|
744
746
|
}
|
|
745
|
-
}], { showCode: false, collapseResult: true })}
|
|
747
|
+
}], { showCode: false, collapseResult: true, ctx })}
|
|
746
748
|
|
|
747
749
|
this produces:
|
|
748
750
|
|
|
749
|
-
${await (0, doc_cfg_1.printCfgCode)(shell, exampleCode, { showCode: false, prefix: 'flowchart RL\n', simplifications: ['to-basic-blocks'] })}
|
|
751
|
+
${await (0, doc_cfg_1.printCfgCode)(shell, exampleCode, { showCode: false, prefix: 'flowchart RL\n', simplifications: ['to-basic-blocks'], ctx })}
|
|
750
752
|
|
|
751
753
|
|
|
752
754
|
If, on the other hand, you want to prune dead code edges:
|
|
@@ -755,11 +757,11 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
755
757
|
config: {
|
|
756
758
|
simplificationPasses: ['unique-cf-sets', 'analyze-dead-code']
|
|
757
759
|
}
|
|
758
|
-
}], { showCode: false, collapseResult: true })}
|
|
760
|
+
}], { showCode: false, collapseResult: true, ctx })}
|
|
759
761
|
|
|
760
762
|
this produces:
|
|
761
763
|
|
|
762
|
-
${await (0, doc_cfg_1.printCfgCode)(shell, exampleCode, { showCode: false, prefix: 'flowchart RL\n', simplifications: ['analyze-dead-code'] })}
|
|
764
|
+
${await (0, doc_cfg_1.printCfgCode)(shell, exampleCode, { showCode: false, prefix: 'flowchart RL\n', simplifications: ['analyze-dead-code'], ctx })}
|
|
763
765
|
|
|
764
766
|
|
|
765
767
|
Or, completely remove dead code:
|
|
@@ -768,11 +770,11 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
768
770
|
config: {
|
|
769
771
|
simplificationPasses: ['unique-cf-sets', 'analyze-dead-code', 'remove-dead-code']
|
|
770
772
|
}
|
|
771
|
-
}], { showCode: false, collapseResult: true })}
|
|
773
|
+
}], { showCode: false, collapseResult: true, ctx })}
|
|
772
774
|
|
|
773
775
|
this produces:
|
|
774
776
|
|
|
775
|
-
${await (0, doc_cfg_1.printCfgCode)(shell, exampleCode, { showCode: false, prefix: 'flowchart RL\n', simplifications: ['analyze-dead-code', 'remove-dead-code'] })}
|
|
777
|
+
${await (0, doc_cfg_1.printCfgCode)(shell, exampleCode, { showCode: false, prefix: 'flowchart RL\n', simplifications: ['analyze-dead-code', 'remove-dead-code'], ctx })}
|
|
776
778
|
|
|
777
779
|
`;
|
|
778
780
|
}
|
|
@@ -798,14 +800,14 @@ The following query then gives you the aforementioned mapping:
|
|
|
798
800
|
|
|
799
801
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
800
802
|
type: 'location-map'
|
|
801
|
-
}], { showCode: false, collapseQuery: true })}
|
|
803
|
+
}], { showCode: false, collapseQuery: true, ctx })}
|
|
802
804
|
|
|
803
805
|
The query also accepts a list of slice criteria to filter the results to only include the locations of specific nodes. For example:
|
|
804
806
|
|
|
805
807
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
806
808
|
type: 'location-map',
|
|
807
809
|
ids: criteria
|
|
808
|
-
}], { showCode: false, collapseQuery: true, shorthand: (0, doc_query_1.sliceQueryShorthand)(criteria, (0, doc_escape_1.escapeNewline)(exampleCode)) })}
|
|
810
|
+
}], { showCode: false, collapseQuery: true, shorthand: (0, doc_query_1.sliceQueryShorthand)(criteria, (0, doc_escape_1.escapeNewline)(exampleCode)), ctx })}
|
|
809
811
|
|
|
810
812
|
All locations are given as a ${ctx.link('SourceRange')} paired with the file id in the format \`[file-id, [start-line, start-column, end-line, end-column]]\`.
|
|
811
813
|
|
|
@@ -828,8 +830,8 @@ ${(0, doc_structure_1.block)({
|
|
|
828
830
|
type: 'NOTE',
|
|
829
831
|
content: `
|
|
830
832
|
There are many ways to query a dataflow graph created by flowR.
|
|
831
|
-
For example, you can use the
|
|
832
|
-
with a running flowR server, or the ${(0, doc_cli_option_1.getReplCommand)('query')} command in the flowR
|
|
833
|
+
For example, you can use the ${ctx.linkPage('wiki/Interface', '`request-query`', 'message-request-query')} message
|
|
834
|
+
with a running flowR server, or the ${(0, doc_cli_option_1.getReplCommand)('query')} command in the flowR ${ctx.linkPage('wiki/Interface', 'REPL', 'repl')}.
|
|
833
835
|
|
|
834
836
|
Also, check out the [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) repository for a complete example project using the query API.
|
|
835
837
|
`.trim()
|
|
@@ -873,7 +875,7 @@ ${example_query_code_1.exampleQueryCode}
|
|
|
873
875
|
|
|
874
876
|
<details> <summary>Dataflow Graph of the Example</summary>
|
|
875
877
|
|
|
876
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(shell, example_query_code_1.exampleQueryCode, { showCode: false })}
|
|
878
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(shell, example_query_code_1.exampleQueryCode, { showCode: false, ctx })}
|
|
877
879
|
|
|
878
880
|
</details>
|
|
879
881
|
|
|
@@ -892,7 +894,7 @@ For the specific use-case stated, you could use the ${(0, doc_query_1.linkToQuer
|
|
|
892
894
|
|
|
893
895
|
Just as an example, the following ${(0, doc_query_1.linkToQueryOfName)('call-context')} finds all calls to \`read_csv\` that are not overwritten:
|
|
894
896
|
|
|
895
|
-
${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode, [{ type: 'call-context', callName: '^read_csv$', callTargets: identify_link_to_last_call_relation_1.CallTargets.OnlyGlobal, kind: 'input', subkind: 'csv-file' }], { showCode: false })}
|
|
897
|
+
${await (0, doc_query_1.showQuery)(shell, example_query_code_1.exampleQueryCode, [{ type: 'call-context', callName: '^read_csv$', callTargets: identify_link_to_last_call_relation_1.CallTargets.OnlyGlobal, kind: 'input', subkind: 'csv-file' }], { showCode: false, ctx })}
|
|
896
898
|
|
|
897
899
|
${await (0, doc_query_1.explainQueries)(shell, ctx, 'active')}
|
|
898
900
|
|