@eagleoutice/flowr 2.6.2 → 2.6.3
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 +36 -34
- package/abstract-interpretation/data-frame/absint-visitor.js +3 -3
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +7 -7
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +20 -16
- package/abstract-interpretation/data-frame/semantics.js +8 -0
- package/abstract-interpretation/data-frame/shape-inference.d.ts +3 -3
- package/abstract-interpretation/data-frame/shape-inference.js +3 -3
- package/abstract-interpretation/normalized-ast-fold.d.ts +1 -1
- package/benchmark/slicer.d.ts +1 -0
- package/benchmark/slicer.js +13 -12
- package/benchmark/summarizer/first-phase/process.js +1 -1
- package/benchmark/summarizer/second-phase/graph.d.ts +3 -1
- package/benchmark/summarizer/second-phase/graph.js +3 -1
- package/cli/export-quads-app.js +1 -1
- package/cli/repl/commands/repl-dataflow.js +2 -1
- package/cli/repl/commands/repl-parse.js +16 -4
- package/cli/repl/commands/repl-query.js +1 -1
- package/cli/repl/core.js +16 -13
- package/cli/repl/server/connection.js +2 -1
- package/cli/script-core/statistics-helper-core.js +2 -1
- package/cli/slicer-app.js +3 -4
- package/cli/wiki.d.ts +4 -0
- package/cli/wiki.js +165 -0
- package/config.d.ts +4 -0
- package/config.js +6 -0
- package/control-flow/cfg-dead-code.js +13 -3
- package/control-flow/cfg-simplification.d.ts +5 -2
- package/control-flow/cfg-simplification.js +3 -0
- package/control-flow/extract-cfg.d.ts +9 -3
- package/control-flow/extract-cfg.js +44 -4
- package/control-flow/semantic-cfg-guided-visitor.d.ts +2 -2
- package/control-flow/simple-visitor.js +2 -2
- package/control-flow/useless-loop.d.ts +3 -3
- package/control-flow/useless-loop.js +14 -5
- package/core/pipeline-executor.d.ts +3 -6
- package/core/pipeline-executor.js +4 -7
- package/core/print/normalize-printer.d.ts +1 -1
- package/core/print/normalize-printer.js +2 -2
- package/core/steps/all/core/00-parse.d.ts +1 -1
- package/core/steps/all/core/00-parse.js +1 -1
- package/core/steps/all/core/10-normalize.d.ts +3 -9
- package/core/steps/all/core/10-normalize.js +1 -16
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -3
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -3
- package/core/steps/all/core/20-dataflow.d.ts +3 -4
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +1 -2
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +8 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +4 -1
- package/core/steps/pipeline/default-pipelines.d.ts +55 -56
- package/core/steps/pipeline/default-pipelines.js +8 -8
- package/dataflow/environments/clone.d.ts +0 -1
- package/dataflow/environments/clone.js +12 -2
- package/dataflow/environments/diff.js +2 -2
- package/dataflow/environments/overwrite.d.ts +1 -5
- package/dataflow/environments/overwrite.js +3 -19
- package/dataflow/environments/scoping.d.ts +6 -2
- package/dataflow/environments/scoping.js +6 -2
- package/dataflow/eval/resolve/resolve-argument.js +2 -2
- package/dataflow/eval/values/string/string-constants.d.ts +9 -3
- package/dataflow/eval/values/string/string-constants.js +9 -3
- package/dataflow/extractor.d.ts +2 -3
- package/dataflow/extractor.js +25 -22
- package/dataflow/graph/graph.d.ts +3 -9
- package/dataflow/graph/graph.js +0 -13
- package/dataflow/graph/unknown-replacement.d.ts +4 -2
- package/dataflow/graph/unknown-replacement.js +4 -2
- package/dataflow/info.d.ts +7 -0
- package/dataflow/info.js +21 -0
- package/dataflow/internal/linker.js +7 -4
- package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -2
- package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +15 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +78 -75
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
- package/dataflow/internal/process/functions/call/common.d.ts +1 -1
- package/dataflow/internal/process/functions/call/common.js +4 -4
- package/dataflow/internal/process/functions/call/default-call-handling.d.ts +3 -1
- package/dataflow/internal/process/functions/call/default-call-handling.js +3 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +3 -3
- package/dataflow/internal/process/functions/call/named-call-handling.js +4 -4
- package/dataflow/internal/process/functions/process-parameter.js +4 -4
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +1 -1
- package/dataflow/processor.d.ts +6 -11
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +0 -2
- package/documentation/data/faq/faqs.js +27 -18
- package/documentation/data/faq/recommended-configs.d.ts +36 -0
- package/documentation/data/faq/recommended-configs.js +40 -0
- package/documentation/data/faq/wiki-faq-store.d.ts +1 -0
- package/documentation/data/faq/wiki-faq-store.js +10 -2
- package/documentation/data/server/doc-data-server-messages.js +1 -1
- package/documentation/doc-capabilities.d.ts +9 -0
- package/documentation/{print-capabilities-markdown.js → doc-capabilities.js} +18 -21
- package/documentation/doc-readme.d.ts +9 -0
- package/documentation/{print-readme.js → doc-readme.js} +31 -35
- package/documentation/doc-util/doc-benchmarks.d.ts +6 -4
- package/documentation/doc-util/doc-benchmarks.js +6 -4
- package/documentation/doc-util/doc-cfg.js +5 -8
- package/documentation/doc-util/doc-dfg.d.ts +7 -7
- package/documentation/doc-util/doc-dfg.js +13 -13
- package/documentation/doc-util/doc-escape.d.ts +6 -0
- package/documentation/doc-util/doc-escape.js +11 -0
- package/documentation/doc-util/doc-general.d.ts +22 -2
- package/documentation/doc-util/doc-general.js +22 -2
- package/documentation/doc-util/doc-normalized-ast.d.ts +10 -5
- package/documentation/doc-util/doc-normalized-ast.js +12 -9
- package/documentation/doc-util/doc-query.d.ts +12 -4
- package/documentation/doc-util/doc-query.js +18 -11
- package/documentation/doc-util/doc-search.d.ts +0 -30
- package/documentation/doc-util/doc-search.js +2 -73
- package/documentation/doc-util/doc-server-message.d.ts +5 -5
- package/documentation/doc-util/doc-server-message.js +4 -4
- package/documentation/doc-util/doc-types.d.ts +69 -32
- package/documentation/doc-util/doc-types.js +108 -61
- package/documentation/index.d.ts +9 -9
- package/documentation/index.js +9 -9
- package/documentation/issue-linting-rule.d.ts +9 -0
- package/documentation/{print-linter-issue.js → issue-linting-rule.js} +20 -23
- package/documentation/wiki-analyzer.d.ts +9 -0
- package/documentation/wiki-analyzer.js +412 -0
- package/documentation/wiki-cfg.d.ts +9 -0
- package/documentation/{print-cfg-wiki.js → wiki-cfg.js} +144 -160
- package/documentation/wiki-core.d.ts +14 -0
- package/documentation/{print-core-wiki.js → wiki-core.js} +164 -175
- package/documentation/wiki-dataflow-graph.d.ts +9 -0
- package/documentation/{print-dataflow-graph-wiki.js → wiki-dataflow-graph.js} +142 -172
- package/documentation/wiki-engine.d.ts +9 -0
- package/documentation/{print-engines-wiki.js → wiki-engine.js} +27 -42
- package/documentation/wiki-faq.d.ts +8 -0
- package/documentation/wiki-faq.js +22 -0
- package/documentation/wiki-interface.d.ts +9 -0
- package/documentation/{print-interface-wiki.js → wiki-interface.js} +59 -56
- package/documentation/wiki-linter.d.ts +9 -0
- package/documentation/{print-linter-wiki.js → wiki-linter.js} +52 -48
- package/documentation/wiki-linting-and-testing.d.ts +9 -0
- package/documentation/{print-linting-and-testing-wiki.js → wiki-linting-and-testing.js} +25 -32
- package/documentation/wiki-mk/doc-context.d.ts +186 -0
- package/documentation/wiki-mk/doc-context.js +84 -0
- package/documentation/wiki-mk/doc-maker.d.ts +95 -0
- package/documentation/wiki-mk/doc-maker.js +133 -0
- package/documentation/wiki-normalized-ast.d.ts +9 -0
- package/documentation/{print-normalized-ast-wiki.js → wiki-normalized-ast.js} +64 -47
- package/documentation/wiki-onboarding.d.ts +8 -0
- package/documentation/{print-onboarding-wiki.js → wiki-onboarding.js} +18 -15
- package/documentation/wiki-query.d.ts +9 -0
- package/documentation/{print-query-wiki.js → wiki-query.js} +62 -47
- package/documentation/wiki-search.d.ts +9 -0
- package/documentation/wiki-search.js +61 -0
- package/linter/linter-executor.js +3 -2
- package/linter/linter-format.d.ts +2 -2
- package/linter/linter-rules.d.ts +13 -17
- package/linter/rules/absolute-path.d.ts +1 -2
- package/linter/rules/absolute-path.js +2 -2
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +12 -8
- package/linter/rules/dead-code.d.ts +1 -1
- package/linter/rules/deprecated-functions.d.ts +1 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/file-path-validity.js +4 -4
- package/linter/rules/function-finder-util.d.ts +1 -5
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +1 -1
- package/linter/rules/network-functions.d.ts +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +3 -2
- package/linter/rules/seeded-randomness.js +33 -13
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/useless-loop.d.ts +2 -2
- package/linter/rules/useless-loop.js +2 -2
- package/package.json +6 -17
- package/project/cache/flowr-analyzer-cache.d.ts +7 -10
- package/project/cache/flowr-analyzer-cache.js +17 -38
- package/project/cache/flowr-analyzer-controlflow-cache.d.ts +34 -0
- package/project/cache/flowr-analyzer-controlflow-cache.js +79 -0
- package/project/context/flowr-analyzer-context.d.ts +30 -5
- package/project/context/flowr-analyzer-context.js +48 -4
- package/project/context/flowr-analyzer-files-context.d.ts +63 -13
- package/project/context/flowr-analyzer-files-context.js +110 -39
- package/project/context/flowr-file.d.ts +32 -10
- package/project/context/flowr-file.js +30 -9
- package/project/flowr-analyzer-builder.d.ts +22 -28
- package/project/flowr-analyzer-builder.js +32 -70
- package/project/flowr-analyzer.d.ts +55 -14
- package/project/flowr-analyzer.js +53 -8
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +7 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +13 -5
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +3 -3
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +11 -5
- package/project/plugins/file-plugins/flowr-description-file.d.ts +3 -3
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.d.ts +20 -0
- package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.js +42 -0
- package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.d.ts +59 -0
- package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.js +132 -0
- package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
- package/project/plugins/file-plugins/notebooks/notebook.js +2 -0
- package/project/plugins/flowr-analyzer-plugin-defaults.d.ts +5 -0
- package/project/plugins/flowr-analyzer-plugin-defaults.js +23 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +2 -0
- package/project/plugins/flowr-analyzer-plugin.js +2 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/plugin-registry.d.ts +34 -0
- package/project/plugins/plugin-registry.js +62 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +4 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +5 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +25 -18
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.js +6 -5
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.js +13 -2
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -1
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-executor.js +3 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +13 -1
- package/queries/query.d.ts +26 -18
- package/queries/query.js +21 -1
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/collect.js +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +15 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +5 -7
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +24 -11
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/type.js +2 -0
- package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +9 -8
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +11 -10
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.d.ts +4 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +20 -11
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -3
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +5 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +3 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +14 -5
- package/r-bridge/parser.d.ts +15 -5
- package/r-bridge/parser.js +27 -13
- package/r-bridge/retriever.d.ts +9 -15
- package/r-bridge/retriever.js +14 -5
- package/r-bridge/shell.d.ts +1 -1
- package/r-bridge/shell.js +1 -1
- package/reconstruct/auto-select/auto-select-defaults.d.ts +0 -1
- package/reconstruct/auto-select/magic-comments.js +1 -1
- package/reconstruct/reconstruct.d.ts +17 -9
- package/reconstruct/reconstruct.js +19 -8
- package/search/flowr-search.d.ts +12 -0
- package/search/search-executor/search-enrichers.d.ts +9 -2
- package/search/search-executor/search-enrichers.js +1 -3
- package/search/search-executor/search-generators.d.ts +1 -1
- package/search/search-executor/search-generators.js +9 -4
- package/slicing/criterion/collect-all.d.ts +3 -2
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/criterion/parse.js +4 -4
- package/statistics/features/supported/assignments/assignments.js +1 -1
- package/statistics/features/supported/control-flow/control-flow.js +1 -1
- package/statistics/features/supported/data-access/data-access.js +1 -1
- package/statistics/features/supported/defined-functions/defined-functions.js +1 -1
- package/statistics/features/supported/expression-list/statistics-expression-list.js +1 -1
- package/statistics/features/supported/loops/loops.js +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +1 -1
- package/statistics/features/supported/variables/variables.js +1 -1
- package/statistics/statistics.js +3 -2
- package/util/assert.d.ts +4 -0
- package/util/assert.js +4 -0
- package/util/files.d.ts +1 -1
- package/util/files.js +1 -1
- package/util/mermaid/ast.d.ts +4 -3
- package/util/mermaid/ast.js +36 -8
- package/util/mermaid/cfg.js +1 -1
- package/util/version.js +1 -1
- package/documentation/print-analyzer-wiki.d.ts +0 -1
- package/documentation/print-analyzer-wiki.js +0 -141
- package/documentation/print-capabilities-markdown.d.ts +0 -1
- package/documentation/print-cfg-wiki.d.ts +0 -1
- package/documentation/print-core-wiki.d.ts +0 -5
- package/documentation/print-dataflow-graph-wiki.d.ts +0 -1
- package/documentation/print-engines-wiki.d.ts +0 -1
- package/documentation/print-faq-wiki.d.ts +0 -1
- package/documentation/print-faq-wiki.js +0 -18
- package/documentation/print-interface-wiki.d.ts +0 -1
- package/documentation/print-linter-issue.d.ts +0 -1
- package/documentation/print-linter-wiki.d.ts +0 -1
- package/documentation/print-linting-and-testing-wiki.d.ts +0 -1
- package/documentation/print-normalized-ast-wiki.d.ts +0 -1
- package/documentation/print-onboarding-wiki.d.ts +0 -1
- package/documentation/print-query-wiki.d.ts +0 -1
- package/documentation/print-readme.d.ts +0 -1
- package/documentation/print-search-wiki.d.ts +0 -1
- package/documentation/print-search-wiki.js +0 -74
- package/util/formats/adapter-format.d.ts +0 -6
- package/util/formats/adapter-format.js +0 -3
- package/util/formats/adapter.d.ts +0 -27
- package/util/formats/adapter.js +0 -58
- package/util/formats/adapters/r-adapter.d.ts +0 -4
- package/util/formats/adapters/r-adapter.js +0 -7
- package/util/formats/adapters/rmd-adapter.d.ts +0 -35
- package/util/formats/adapters/rmd-adapter.js +0 -100
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WikiAnalyzer = void 0;
|
|
4
|
+
const flowr_analyzer_1 = require("../project/flowr-analyzer");
|
|
5
|
+
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
6
|
+
const doc_structure_1 = require("./doc-util/doc-structure");
|
|
7
|
+
const doc_files_1 = require("./doc-util/doc-files");
|
|
8
|
+
const flowr_analyzer_qmd_file_plugin_1 = require("../project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin");
|
|
9
|
+
const plugin_registry_1 = require("../project/plugins/plugin-registry");
|
|
10
|
+
const doc_code_1 = require("./doc-util/doc-code");
|
|
11
|
+
const flowr_analyzer_project_discovery_plugin_1 = require("../project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin");
|
|
12
|
+
const flowr_analyzer_description_file_plugin_1 = require("../project/plugins/file-plugins/flowr-analyzer-description-file-plugin");
|
|
13
|
+
const flowr_analyzer_package_versions_description_file_plugin_1 = require("../project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin");
|
|
14
|
+
const flowr_analyzer_loading_order_description_file_plugin_1 = require("../project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin");
|
|
15
|
+
const flowr_analyzer_file_plugin_1 = require("../project/plugins/file-plugins/flowr-analyzer-file-plugin");
|
|
16
|
+
const flowr_analyzer_package_versions_plugin_1 = require("../project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin");
|
|
17
|
+
const flowr_analyzer_loading_order_plugin_1 = require("../project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin");
|
|
18
|
+
const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-context");
|
|
19
|
+
const retriever_1 = require("../r-bridge/retriever");
|
|
20
|
+
const flowr_analyzer_files_context_1 = require("../project/context/flowr-analyzer-files-context");
|
|
21
|
+
const flowr_analyzer_loading_order_context_1 = require("../project/context/flowr-analyzer-loading-order-context");
|
|
22
|
+
const flowr_analyzer_dependencies_context_1 = require("../project/context/flowr-analyzer-dependencies-context");
|
|
23
|
+
const flowr_analyzer_cache_1 = require("../project/cache/flowr-analyzer-cache");
|
|
24
|
+
const pipeline_executor_1 = require("../core/pipeline-executor");
|
|
25
|
+
const flowr_analyzer_plugin_defaults_1 = require("../project/plugins/flowr-analyzer-plugin-defaults");
|
|
26
|
+
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
27
|
+
const flowr_analyzer_rmd_file_plugin_1 = require("../project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin");
|
|
28
|
+
const flowr_analyzer_plugin_1 = require("../project/plugins/flowr-analyzer-plugin");
|
|
29
|
+
async function analyzerQuickExample() {
|
|
30
|
+
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
|
|
31
|
+
.setEngine('tree-sitter')
|
|
32
|
+
.build();
|
|
33
|
+
// register a simple inline text-file for analysis
|
|
34
|
+
analyzer.addRequest('x <- 1; print(x)');
|
|
35
|
+
// get the dataflow
|
|
36
|
+
const df = await analyzer.dataflow();
|
|
37
|
+
// obtain the identified loading order
|
|
38
|
+
console.log(analyzer.inspectContext().files.loadingOrder.getLoadingOrder());
|
|
39
|
+
// run a dependency query
|
|
40
|
+
const results = await analyzer.query([{ type: 'dependencies' }]);
|
|
41
|
+
return { analyzer, df, results };
|
|
42
|
+
}
|
|
43
|
+
async function analyzerQuickExampleToRegisterPlugins() {
|
|
44
|
+
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder(false)
|
|
45
|
+
.registerPlugins('file:description', new flowr_analyzer_qmd_file_plugin_1.FlowrAnalyzerQmdFilePlugin(), ['file:rmd', [/.*.rmd/i]])
|
|
46
|
+
.build();
|
|
47
|
+
return analyzer;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* https://github.com/flowr-analysis/flowr/wiki/Analyzer
|
|
51
|
+
*/
|
|
52
|
+
class WikiAnalyzer extends doc_maker_1.DocMaker {
|
|
53
|
+
constructor() {
|
|
54
|
+
super('wiki/Analyzer.md', module.filename, 'analyzer');
|
|
55
|
+
}
|
|
56
|
+
text({ ctx }) {
|
|
57
|
+
return `
|
|
58
|
+
${(0, doc_structure_1.collapsibleToc)({
|
|
59
|
+
'Overview': {
|
|
60
|
+
'Overview of the Analyzer': undefined,
|
|
61
|
+
'Conducting Analyses': undefined
|
|
62
|
+
},
|
|
63
|
+
'Builder Configuration': {
|
|
64
|
+
'Configuring flowR': undefined,
|
|
65
|
+
'Configuring the Engine': undefined,
|
|
66
|
+
'Configuring Plugins': undefined,
|
|
67
|
+
'Builder Reference': undefined
|
|
68
|
+
},
|
|
69
|
+
'Plugins': {
|
|
70
|
+
'Plugin Types': {
|
|
71
|
+
'Dependency Identification': undefined,
|
|
72
|
+
'Project Discovery': undefined,
|
|
73
|
+
'File Loading': undefined,
|
|
74
|
+
'Loading Order': undefined
|
|
75
|
+
},
|
|
76
|
+
'How to add a new plugin': undefined,
|
|
77
|
+
},
|
|
78
|
+
'Context Information': {
|
|
79
|
+
'Files Context': undefined,
|
|
80
|
+
'Loading Order Context': undefined,
|
|
81
|
+
'Dependencies Context': undefined
|
|
82
|
+
},
|
|
83
|
+
'Caching': undefined
|
|
84
|
+
})}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
${(0, doc_structure_1.section)('Overview', 2)}
|
|
88
|
+
|
|
89
|
+
No matter whether you want to analyze a single R script, a couple of R notebooks, a complete project, or an R package,
|
|
90
|
+
your journey starts with the ${ctx.link(flowr_analyzer_builder_1.FlowrAnalyzerBuilder)} (further described in [Builder Configuration](#builder-configuration) below).
|
|
91
|
+
This builder allows you to configure the analysis in many different ways, for example, by specifying which [plugins](#Plugins) to use or
|
|
92
|
+
what [engine](${doc_files_1.FlowrWikiBaseRef}/Engines) to use for the analysis.
|
|
93
|
+
|
|
94
|
+
When building the ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} instance, the builder will take care to
|
|
95
|
+
|
|
96
|
+
* load the [requested plugins](#Plugins)
|
|
97
|
+
* setup an initial [context](#Context_Information)
|
|
98
|
+
* create a [cache](#Caching) for speeding up future analyses
|
|
99
|
+
* initialize the [engine](${doc_files_1.FlowrWikiBaseRef}/Engines) (e.g., TreeSitter) if needed
|
|
100
|
+
|
|
101
|
+
The builder provides two methods for building the analyzer:
|
|
102
|
+
|
|
103
|
+
* ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'build')}\\
|
|
104
|
+
for an asynchronous build process that also initializes the engine if needed
|
|
105
|
+
* ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'buildSync')}\\
|
|
106
|
+
for a synchronous build process,
|
|
107
|
+
which requires that the engine (e.g., TreeSitter) has already been initialized before calling this method.
|
|
108
|
+
Yet, as Engines only have to be initialized once per process, this method is often more convenient to use.
|
|
109
|
+
|
|
110
|
+
For more information on how to configure the builder, please refer to the [Builder Configuration](#builder-configuration) section below.
|
|
111
|
+
|
|
112
|
+
${(0, doc_structure_1.section)('Overview of the Analyzer', 3)}
|
|
113
|
+
|
|
114
|
+
Once you have created an analyzer instance, you can add R files, folders, or even entire projects for analysis using the
|
|
115
|
+
${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'addRequest')} method.
|
|
116
|
+
All loaded [plugins](#Plugins) will be applied fully automatically during the analysis.
|
|
117
|
+
Please note that adding new files _after_ you already requested analysis results may cause bigger invalidations and cause re-analysis of previously analyzed files.
|
|
118
|
+
With the [files context](#Files_Context), you can also add virtual files to the analysis to consider, or *overwrite* existing files with modified content.
|
|
119
|
+
For this, have a look at the
|
|
120
|
+
${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'addFile')} method.
|
|
121
|
+
|
|
122
|
+
${(0, doc_structure_1.block)({
|
|
123
|
+
type: 'NOTE',
|
|
124
|
+
content: `If you want to quickly try out the analyzer, you can use the following code snippet that analyzes a simple R expression:
|
|
125
|
+
|
|
126
|
+
${ctx.code(analyzerQuickExample, { dropLinesStart: 1, dropLinesEnd: 2, hideDefinedAt: true })}
|
|
127
|
+
`
|
|
128
|
+
})}
|
|
129
|
+
|
|
130
|
+
To reset the analysis (e.g., to provide new requests) you can use ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'reset')}.
|
|
131
|
+
If you need to pre-compute analysis results (e.g., to speed up future queries), you can use ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'runFull')}.
|
|
132
|
+
|
|
133
|
+
${(0, doc_structure_1.section)('Conducting Analyses', 3)}
|
|
134
|
+
|
|
135
|
+
Please make sure to add all of the files, folder, and projects you want to analyze using the
|
|
136
|
+
${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'addRequest')} method (or ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'addFile')} for virtual files).
|
|
137
|
+
Afterwards, you can request different kinds of analysis results, such as:
|
|
138
|
+
|
|
139
|
+
* ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'parse')} to get the parsed information by the respective [engine](${doc_files_1.FlowrWikiBaseRef}/Engines)\\
|
|
140
|
+
You can also use ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'peekParse', { codeFont: true, realNameWrapper: 'i' })} to inspect the parse information if it was already computed (but without triggering a computation).
|
|
141
|
+
With ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'parserInformation', { codeFont: true, realNameWrapper: 'i' })}, you get additional information on the parser used for the analysis.
|
|
142
|
+
* ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'normalize')} to compute the [Normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized%20AST)\\
|
|
143
|
+
Likewise, ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'peekNormalize', { codeFont: true, realNameWrapper: 'i' })} returns the normalized AST if it was already computed but without triggering a computation.
|
|
144
|
+
* ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'dataflow')} to compute the [Dataflow Graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph)\\
|
|
145
|
+
Again, ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'peekDataflow', { codeFont: true, realNameWrapper: 'i' })} allows you to inspect the dataflow graph if it was already computed (but without triggering a computation).
|
|
146
|
+
* ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'controlflow')} to compute the [Control Flow Graph](${doc_files_1.FlowrWikiBaseRef}/Control%20Flow%20Graph)\\
|
|
147
|
+
Also, ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'peekControlflow', { codeFont: true, realNameWrapper: 'i' })} returns the control flow graph if it was already computed but without triggering a computation.
|
|
148
|
+
* ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'query')} to run [queries](${doc_files_1.FlowrWikiBaseRef}/Query-API) on the analyzed code.
|
|
149
|
+
* ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'runSearch')} to run a search query on the analyzed code using the [search API](${doc_files_1.FlowrWikiBaseRef}/Search%20API)
|
|
150
|
+
|
|
151
|
+
We work on providing a set of example repositories that demonstrate how to use the analyzer in different scenarios:
|
|
152
|
+
|
|
153
|
+
* [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) for an example project that runs queries on an R project
|
|
154
|
+
* [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-df-diff](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-df-diff) for an example project that compares dataflows graphs
|
|
155
|
+
|
|
156
|
+
${(0, doc_structure_1.section)('Builder Configuration', 2)}
|
|
157
|
+
|
|
158
|
+
If you are interested in all available options, have a look at the [Builder Reference](#builder-reference) below.
|
|
159
|
+
The following sections highlight some of the most important configuration options:
|
|
160
|
+
|
|
161
|
+
1. How to [configure flowR](#configuring-flowr)
|
|
162
|
+
1. How to [configure the engine](#configuring-the-engine)
|
|
163
|
+
2. How to [register plugins](#configuring-plugins)
|
|
164
|
+
|
|
165
|
+
${(0, doc_structure_1.section)('Configuring flowR', 3)}
|
|
166
|
+
|
|
167
|
+
You can fundamentally change the behavior of flowR using the [config file](${doc_files_1.FlowrWikiBaseRef}/Interface#configuring-flowr),
|
|
168
|
+
embedded in the interface ${ctx.link('FlowrConfigOptions')}.
|
|
169
|
+
With the builder you can either provide a complete configuration or amend the default configuration using:
|
|
170
|
+
|
|
171
|
+
* ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'setConfig')} to set a complete configuration
|
|
172
|
+
* ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'amendConfig')} to amend the default configuration
|
|
173
|
+
|
|
174
|
+
By default, the builder uses flowR's standard configuration obtained with ${ctx.link('defaultConfigOptions')}.
|
|
175
|
+
|
|
176
|
+
${(0, doc_structure_1.block)({
|
|
177
|
+
type: 'NOTE',
|
|
178
|
+
content: `During the analysis with the ${ctx.link(flowr_analyzer_1.FlowrAnalyzer.name)}, you can also access the configuration with
|
|
179
|
+
the ${ctx.link(flowr_analyzer_context_1.FlowrAnalyzerContext)}.`
|
|
180
|
+
})}
|
|
181
|
+
|
|
182
|
+
${(0, doc_structure_1.section)('Configuring the Engine', 3)}
|
|
183
|
+
|
|
184
|
+
FlowR supports multiple [engines](${doc_files_1.FlowrWikiBaseRef}/Engines) for parsing and analyzing R code.
|
|
185
|
+
With the builder, you can select the engine to use with:
|
|
186
|
+
|
|
187
|
+
* ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'setEngine')} to set the desired engine.
|
|
188
|
+
* ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'setParser')} to set a specific parser implementation.
|
|
189
|
+
|
|
190
|
+
By default, the builder uses the TreeSitter engine with the TreeSitter parser.
|
|
191
|
+
The builder also takes care to initialize the engine if needed during the asynchronous build process
|
|
192
|
+
with ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'build')}.
|
|
193
|
+
If you want to use the synchronous build process with ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'buildSync')},
|
|
194
|
+
please ensure that the engine has already been initialized before calling this method.
|
|
195
|
+
|
|
196
|
+
${(0, doc_structure_1.section)('Configuring Plugins', 3)}
|
|
197
|
+
|
|
198
|
+
There are various ways for you to register plugins with the builder, exemplified by the following snippet
|
|
199
|
+
relying on the ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'registerPlugins')} method:
|
|
200
|
+
|
|
201
|
+
${ctx.code(analyzerQuickExampleToRegisterPlugins, { dropLinesStart: 1, dropLinesEnd: 2, hideDefinedAt: true })}
|
|
202
|
+
|
|
203
|
+
This indicates three ways to add a new plugin:
|
|
204
|
+
|
|
205
|
+
1. By using a predefined name (e.g., \`file:description\` for the ${ctx.link(flowr_analyzer_description_file_plugin_1.FlowrAnalyzerDescriptionFilePlugin)})\\
|
|
206
|
+
These mappings are controlled by the ${ctx.link(plugin_registry_1.registerPluginMaker)} function in the ${ctx.link('PluginRegistry')}.
|
|
207
|
+
Under the hood, this relies on ${ctx.link(plugin_registry_1.makePlugin)} to create the plugin instance from the name.
|
|
208
|
+
2. By providing an already instantiated plugin (e.g., the new ${ctx.link(flowr_analyzer_qmd_file_plugin_1.FlowrAnalyzerQmdFilePlugin)} instance).\\
|
|
209
|
+
You can pass these by reference, instantiating any class that conforms to the [plugin specification](#Plugins).
|
|
210
|
+
3. By providing a tuple of the plugin name and its constructor arguments (e.g., \`['file:rmd', [/.*.rmd/i]]\` for the ${ctx.link(flowr_analyzer_rmd_file_plugin_1.FlowrAnalyzerRmdFilePlugin)}).\\
|
|
211
|
+
This will also use the ${ctx.link(plugin_registry_1.makePlugin)} function under the hood to create the plugin instance.
|
|
212
|
+
|
|
213
|
+
Please note, that by passing \`false\` to the builder constructor, no default plugins (see ${ctx.link(flowr_analyzer_plugin_defaults_1.FlowrAnalyzerPluginDefaults)}) are registered (otherwise, all of the plugins in the example above would be registered by default).
|
|
214
|
+
If you want to unregister specific plugins, you can use the ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'unregisterPlugins')} method.
|
|
215
|
+
|
|
216
|
+
${(0, doc_structure_1.block)({
|
|
217
|
+
type: 'NOTE',
|
|
218
|
+
content: `
|
|
219
|
+
If you directly access the API, please prefer creating the objects yourself by instantiating the respective classes instead of relying on the plugin registry.
|
|
220
|
+
This avoids the indirection *and* potential issues with naming collisions in the registry.
|
|
221
|
+
Moreover, this allows you to directly provide custom configuration to the plugin constructors in a readable fashion,
|
|
222
|
+
*and* to re-use plugin instances.
|
|
223
|
+
Instantiation by text is mostly for serialized communications (e.g., via a CLI or config format).
|
|
224
|
+
`.trim()
|
|
225
|
+
})}
|
|
226
|
+
|
|
227
|
+
For more information on the different plugin types and how to create new plugins, please refer to the [Plugins](#Plugins) section below.
|
|
228
|
+
|
|
229
|
+
${(0, doc_structure_1.section)('Builder Reference', 3)}
|
|
230
|
+
|
|
231
|
+
The builder provides a plethora of methods to configure the resulting analyzer instance:
|
|
232
|
+
|
|
233
|
+
${Object.getOwnPropertyNames(flowr_analyzer_builder_1.FlowrAnalyzerBuilder.prototype).filter(c => c !== 'constructor' && !c.startsWith('build')).sort().map(key => `- ${ctx.link(`${flowr_analyzer_builder_1.FlowrAnalyzerBuilder.name}::${key}`)}\\\n${ctx.doc(`${flowr_analyzer_builder_1.FlowrAnalyzerBuilder.name}::${key}`)}`).join('\n')}
|
|
234
|
+
|
|
235
|
+
To build the analyzer after you have configured the builder, you can use one of the following:
|
|
236
|
+
|
|
237
|
+
${Object.getOwnPropertyNames(flowr_analyzer_builder_1.FlowrAnalyzerBuilder.prototype).filter(c => c.startsWith('build')).sort().map(key => `- ${ctx.link(`${flowr_analyzer_builder_1.FlowrAnalyzerBuilder.name}::${key}`)}\\\n${ctx.doc(`${flowr_analyzer_builder_1.FlowrAnalyzerBuilder.name}::${key}`)}`).join('\n')}
|
|
238
|
+
|
|
239
|
+
${(0, doc_structure_1.section)('Plugins', 2)}
|
|
240
|
+
|
|
241
|
+
Plugins allow you to extend the capabilities of the analyzer in many different ways.
|
|
242
|
+
For example, they can be used to support other file formats, or to provide new algorithms to determine the loading order of files in a project.
|
|
243
|
+
All plugins have to extend the ${ctx.link(flowr_analyzer_plugin_1.FlowrAnalyzerPlugin)} base class and specify their ${ctx.link('PluginType')}.
|
|
244
|
+
During the analysis, the analyzer will apply all registered plugins of the different types at the appropriate stages of the analysis.
|
|
245
|
+
If you just want to _use_ these plugins, you can usually ignore their [type](#plugin-types) and just register them with the builder as described
|
|
246
|
+
in the [Builder Configuration](#builder-configuration) section above.
|
|
247
|
+
However, if you want to _create_ new plugins, you should be aware of the different plugin types and when they are applied during the analysis.
|
|
248
|
+
|
|
249
|
+
Currently, flowR supports the following plugin types built-in:
|
|
250
|
+
|
|
251
|
+
| Name | Class | Type | Description |
|
|
252
|
+
|------|-------|------|-------------|
|
|
253
|
+
${plugin_registry_1.BuiltInPlugins.sort(([a,], [b]) => a.localeCompare(b)).map(([key, value]) => `| ${(0, doc_code_1.codeInline)(key)} | ${ctx.link(`${value.name}`)} | ${new value().type} | ${ctx.doc(`${value.name}`).replaceAll('|', '|').replaceAll('\n', ' ')} |`).join('\n')}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
${(0, doc_structure_1.section)('Plugin Types', 3)}
|
|
257
|
+
|
|
258
|
+
During the construction of a new ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)}, plugins of different types are applied at different stages of the analysis.
|
|
259
|
+
These plugins are grouped by their ${ctx.link('PluginType')} and are applied in the following order (as shown in the documentation of the ${ctx.link('PluginType')}):
|
|
260
|
+
|
|
261
|
+
${(() => {
|
|
262
|
+
const doc = ctx.doc('PluginType');
|
|
263
|
+
// skip until the first ```text
|
|
264
|
+
const lines = doc.split('\n');
|
|
265
|
+
const start = lines.findIndex(l => l.trim().startsWith('```text'));
|
|
266
|
+
const end = lines.findIndex((l, i) => i > start && l.trim().startsWith('```'));
|
|
267
|
+
// github rendering pls fix xD
|
|
268
|
+
return start >= 0 && end > start ? '```text\n' + lines.slice(start + 1, end).join('\n').replaceAll('▶', '>') + '\n```' : doc;
|
|
269
|
+
})()}
|
|
270
|
+
|
|
271
|
+
Please note, that every plugin type has a default implementation (e.g., see ${ctx.link(flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin.name)})
|
|
272
|
+
that is always active.
|
|
273
|
+
We describe the different plugin types in more detail below.
|
|
274
|
+
|
|
275
|
+
${(0, doc_structure_1.section)('Project Discovery', 4)}
|
|
276
|
+
|
|
277
|
+
These plugins trigger when confronted with a project analysis request (see, ${ctx.link('RProjectAnalysisRequest')}).
|
|
278
|
+
Their job is to identify the files that belong to the project and add them to the analysis.
|
|
279
|
+
flowR provides the ${ctx.link(flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin)} with a
|
|
280
|
+
${ctx.link(flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin.name)} as the default implementation that simply collects all R source files in the given folder.
|
|
281
|
+
|
|
282
|
+
Please note that all project discovery plugins should conform to the ${ctx.link(flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin)} base class.
|
|
283
|
+
|
|
284
|
+
${(0, doc_structure_1.section)('File Loading', 4)}
|
|
285
|
+
|
|
286
|
+
These plugins register for every file encountered by the [files context](#Files_Context) and determine whether and _how_ they can process the file.
|
|
287
|
+
They are responsible for transforming the raw file content into a representation that flowR can work with during the analysis.
|
|
288
|
+
For example, the ${ctx.link(flowr_analyzer_description_file_plugin_1.FlowrAnalyzerDescriptionFilePlugin.name)} adds support for R \`DESCRIPTION\` files by parsing their content into key-value pairs.
|
|
289
|
+
These can then be used by other plugins, e.g. the ${ctx.link(flowr_analyzer_package_versions_description_file_plugin_1.FlowrAnalyzerPackageVersionsDescriptionFilePlugin)} that extracts package version information from these files.
|
|
290
|
+
|
|
291
|
+
If multiple file plugins could apply (${ctx.link('DefaultFlowrAnalyzerFilePlugin::' + flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin.defaultPlugin().applies.name)}) to the same file,
|
|
292
|
+
the loading order of these plugins determines which plugin gets to process the file.
|
|
293
|
+
Please ensure that no two file plugins _apply_ to the same file,
|
|
294
|
+
as this could lead to unexpected behavior.
|
|
295
|
+
Also, make sure that all file plugins conform to the ${ctx.link(flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin)} base class.
|
|
296
|
+
|
|
297
|
+
${(0, doc_structure_1.section)('Dependency Identification', 4)}
|
|
298
|
+
|
|
299
|
+
These plugins should identify which R packages are required with which versions for the analysis.
|
|
300
|
+
This information is then used to setup the R environment for the analysis correctly.
|
|
301
|
+
For example, the ${ctx.link(flowr_analyzer_package_versions_description_file_plugin_1.FlowrAnalyzerPackageVersionsDescriptionFilePlugin)} extracts package version information from \`DESCRIPTION\` files
|
|
302
|
+
to identify the required packages and their versions.
|
|
303
|
+
|
|
304
|
+
All dependency identification plugins should conform to the ${ctx.link(flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin)} base class.
|
|
305
|
+
|
|
306
|
+
${(0, doc_structure_1.section)('Loading Order', 4)}
|
|
307
|
+
|
|
308
|
+
These plugins determine the order in which files are loaded and analyzed.
|
|
309
|
+
This is crucial for correctly understanding the dependencies between files and improved analyses, especially in larger projects.
|
|
310
|
+
For example, the ${ctx.link(flowr_analyzer_loading_order_description_file_plugin_1.FlowrAnalyzerLoadingOrderDescriptionFilePlugin)} provides a basic implementation that orders files based on
|
|
311
|
+
the specification in a \`DESCRIPTION\` file, if present.
|
|
312
|
+
|
|
313
|
+
All loading order plugins should conform to the ${ctx.link(flowr_analyzer_loading_order_plugin_1.FlowrAnalyzerLoadingOrderPlugin)} base class.
|
|
314
|
+
|
|
315
|
+
${(0, doc_structure_1.section)('How to add a new plugin', 3)}
|
|
316
|
+
|
|
317
|
+
If you want to make a new plugin you first have to decide which type of plugin you want to create (see [Plugin Types](#plugin-types) above).
|
|
318
|
+
Then, you must create a new class that extends the corresponding base class (e.g., ${ctx.link(flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin)} for file loading plugins).
|
|
319
|
+
In general, most plugins operate on the [context information](#Context_Information) provided by the analyzer.
|
|
320
|
+
Usually it is a good idea to have a look at the existing plugins of the same type to get an idea of how to implement your own plugin.
|
|
321
|
+
|
|
322
|
+
Once you have your plugin you should register it with a sensible name using the ${ctx.link(plugin_registry_1.registerPluginMaker)} function.
|
|
323
|
+
This will allow users to register your plugin easily by name using the builder's ${ctx.linkM(flowr_analyzer_builder_1.FlowrAnalyzerBuilder, 'registerPlugins')} method.
|
|
324
|
+
Otherwise, users will have to provide an instance of your plugin class directly.
|
|
325
|
+
|
|
326
|
+
${(0, doc_structure_1.section)('Context Information', 2)}
|
|
327
|
+
|
|
328
|
+
The ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} provides various context information during the analysis.
|
|
329
|
+
You can access the context with ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'inspectContext')}
|
|
330
|
+
to receive a read-only view of the current analysis context.
|
|
331
|
+
Likewise, you can use ${ctx.linkM(flowr_analyzer_context_1.FlowrAnalyzerContext, 'inspect')} to get a read-only view of a given context.
|
|
332
|
+
These read-only views prevent you from accidentally modifying the context during the analysis which may cause inconsistencies (this should be done either by
|
|
333
|
+
wrapping methods or by [plugins](#Plugins)).
|
|
334
|
+
The context is divided into multiple sub-contexts, each responsible for a specific aspect of the analysis.
|
|
335
|
+
These sub-contexts are described in more detail below.
|
|
336
|
+
|
|
337
|
+
For the general structure from an implementation perspective, please have a look at ${ctx.link(flowr_analyzer_context_1.FlowrAnalyzerContext)}.
|
|
338
|
+
${(0, doc_structure_1.block)({
|
|
339
|
+
type: 'TIP',
|
|
340
|
+
content: `
|
|
341
|
+
If you need a context for testing or to create analyses with lower-level components, you can use
|
|
342
|
+
either ${ctx.link(flowr_analyzer_context_1.contextFromInput)} to create a context from input data (which lifts the old ${ctx.link(retriever_1.requestFromInput)}) or
|
|
343
|
+
${ctx.link(flowr_analyzer_context_1.contextFromSources)} to create a context from source files (e.g., if you need a virtual file system).
|
|
344
|
+
`.trim()
|
|
345
|
+
})}
|
|
346
|
+
|
|
347
|
+
If for whatever reason you need to reset the context during an analysis, you can use
|
|
348
|
+
${ctx.linkM(flowr_analyzer_context_1.FlowrAnalyzerContext, 'reset')}.
|
|
349
|
+
To pre-compute all possible information in the context before starting the main analysis, you can use
|
|
350
|
+
${ctx.linkM(flowr_analyzer_context_1.FlowrAnalyzerContext, 'resolvePreAnalysis')}.
|
|
351
|
+
|
|
352
|
+
${(0, doc_structure_1.section)('Files Context', 3)}
|
|
353
|
+
|
|
354
|
+
First, let's have look at the ${ctx.link(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext)} class that provides access to the files to be analyzed and their [loading order](#Loading_Order_Context):
|
|
355
|
+
|
|
356
|
+
${ctx.hierarchy(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext, { showImplSnippet: false })}
|
|
357
|
+
|
|
358
|
+
Using the available [plugins](#Plugins),
|
|
359
|
+
the files context categorizes files by their ${ctx.link('FileRole')} (e.g., source files or DESCRIPTION files)
|
|
360
|
+
and makes them accessible by these roles (e.g., via ${ctx.linkM(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext, 'getFilesByRole', { codeFont: true, realNameWrapper: 'i' })}).
|
|
361
|
+
It also provides methods to check for whether a file exists (e.g., ${ctx.linkM(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext, 'hasFile', { codeFont: true, realNameWrapper: 'i' })},
|
|
362
|
+
${ctx.linkM(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext, 'exists', { codeFont: true, realNameWrapper: 'i' })})
|
|
363
|
+
and to translate requests so they respect the context (e.g., ${ctx.linkM(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext, 'resolveRequest', { codeFont: true, realNameWrapper: 'i' })}).
|
|
364
|
+
|
|
365
|
+
For legacy reasons it also provides the list of files considered by the dataflow analysis via
|
|
366
|
+
${ctx.linkM(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext, 'consideredFilesList', { codeFont: true, realNameWrapper: 'i' })}.
|
|
367
|
+
|
|
368
|
+
${(0, doc_structure_1.section)('Loading Order Context', 3)}
|
|
369
|
+
|
|
370
|
+
${(0, doc_structure_1.block)({
|
|
371
|
+
type: 'NOTE',
|
|
372
|
+
content: `
|
|
373
|
+
Please be aware that the loading order is inherently tied to the files context (as it determines which files are available for ordering).
|
|
374
|
+
Hence, the ${ctx.link(flowr_analyzer_loading_order_context_1.FlowrAnalyzerLoadingOrderContext)} is accessible (only) via the ${ctx.link(flowr_analyzer_files_context_1.FlowrAnalyzerFilesContext)}.
|
|
375
|
+
`.trim()
|
|
376
|
+
})}
|
|
377
|
+
|
|
378
|
+
Here is the structure of the ${ctx.link(flowr_analyzer_loading_order_context_1.FlowrAnalyzerLoadingOrderContext)} that provides access to the identified loading order of files:
|
|
379
|
+
|
|
380
|
+
${ctx.hierarchy(flowr_analyzer_loading_order_context_1.FlowrAnalyzerLoadingOrderContext, { showImplSnippet: false })}
|
|
381
|
+
|
|
382
|
+
Using the available [plugins](#Plugins), the loading order context determines the order in which files are loaded and analyzed by flowR's analyzer.
|
|
383
|
+
You can inspect the identified loading order using
|
|
384
|
+
${ctx.linkM(flowr_analyzer_loading_order_context_1.FlowrAnalyzerLoadingOrderContext, 'getLoadingOrder', { codeFont: true, realNameWrapper: 'i' })}.
|
|
385
|
+
If there are multiple possible loading orders (e.g., due to circular dependencies),
|
|
386
|
+
you can use ${ctx.linkM(flowr_analyzer_loading_order_context_1.FlowrAnalyzerLoadingOrderContext, 'currentGuesses', { codeFont: true, realNameWrapper: 'i' })}.
|
|
387
|
+
|
|
388
|
+
${(0, doc_structure_1.section)('Dependencies Context', 3)}
|
|
389
|
+
|
|
390
|
+
Here is the structure of the ${ctx.link(flowr_analyzer_dependencies_context_1.FlowrAnalyzerDependenciesContext)} that provides access to the identified dependencies and their versions,
|
|
391
|
+
including the version of R:
|
|
392
|
+
|
|
393
|
+
${ctx.hierarchy(flowr_analyzer_dependencies_context_1.FlowrAnalyzerDependenciesContext, { showImplSnippet: false })}
|
|
394
|
+
|
|
395
|
+
Probably the most important method is
|
|
396
|
+
${ctx.linkM(flowr_analyzer_dependencies_context_1.FlowrAnalyzerDependenciesContext, 'getDependency', { codeFont: true, realNameWrapper: 'i' })}
|
|
397
|
+
that allows you to query for a specific dependency by name.
|
|
398
|
+
|
|
399
|
+
${(0, doc_structure_1.section)('Caching', 2)}
|
|
400
|
+
|
|
401
|
+
To speed up analyses, flowR provides a caching mechanism that stores intermediate results of the analysis.
|
|
402
|
+
The cache is maintained by the ${ctx.link(flowr_analyzer_cache_1.FlowrAnalyzerCache)} class and is used automatically by the analyzer during the analysis.
|
|
403
|
+
Underlying, it relies on the ${ctx.link(pipeline_executor_1.PipelineExecutor)} to cache results of different pipeline stages.
|
|
404
|
+
|
|
405
|
+
Usually, you do not have to worry about the cache, as it is managed automatically by the analyzer.
|
|
406
|
+
If you want to overwrite cache information, the analysis methods in ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} (see [Conducting Analyses](#conducting-analyses) above)
|
|
407
|
+
usually provide an optional \`force\` parameter to control whether to use the cache or recompute the results.
|
|
408
|
+
`;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
exports.WikiAnalyzer = WikiAnalyzer;
|
|
412
|
+
//# sourceMappingURL=wiki-analyzer.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocMakerArgs } from './wiki-mk/doc-maker';
|
|
2
|
+
import { DocMaker } from './wiki-mk/doc-maker';
|
|
3
|
+
/**
|
|
4
|
+
* https://github.com/flowr-analysis/flowr/wiki/Control-Flow-Graph
|
|
5
|
+
*/
|
|
6
|
+
export declare class WikiCfg extends DocMaker {
|
|
7
|
+
constructor();
|
|
8
|
+
text({ ctx, shell }: DocMakerArgs): Promise<string>;
|
|
9
|
+
}
|