@eagleoutice/flowr 2.2.12 → 2.2.14
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 +82 -20
- package/benchmark/slicer.js +2 -2
- package/benchmark/summarizer/first-phase/input.js +1 -1
- package/benchmark/summarizer/first-phase/process.js +3 -3
- package/benchmark/summarizer/second-phase/process.js +1 -1
- package/benchmark/summarizer/summarizer.js +1 -1
- package/cli/common/options.js +4 -4
- package/cli/common/script.js +1 -1
- package/cli/flowr.js +1 -1
- package/cli/repl/commands/repl-cfg.d.ts +2 -0
- package/cli/repl/commands/repl-cfg.js +38 -24
- package/cli/repl/commands/repl-commands.js +4 -2
- package/cli/repl/commands/repl-dataflow.js +3 -3
- package/cli/repl/commands/repl-execute.js +1 -1
- package/cli/repl/commands/repl-main.d.ts +1 -1
- package/cli/repl/commands/repl-main.js +1 -1
- package/cli/repl/commands/repl-normalize.js +1 -1
- package/cli/repl/commands/repl-query.js +2 -2
- package/cli/repl/core.js +1 -1
- package/cli/repl/prompt.js +1 -1
- package/cli/repl/server/connection.js +4 -4
- package/cli/repl/server/messages/message-analysis.d.ts +1 -1
- package/cli/script-core/statistics-core.js +1 -1
- package/cli/script-core/statistics-helper-core.js +4 -4
- package/config.d.ts +47 -24
- package/config.js +3 -3
- package/control-flow/basic-cfg-guided-visitor.d.ts +39 -0
- package/control-flow/basic-cfg-guided-visitor.js +114 -0
- package/control-flow/cfg-properties.d.ts +26 -0
- package/control-flow/cfg-properties.js +100 -0
- package/control-flow/cfg-simplification.d.ts +18 -0
- package/control-flow/cfg-simplification.js +55 -0
- package/control-flow/cfg-to-basic-blocks.d.ts +5 -0
- package/control-flow/cfg-to-basic-blocks.js +81 -0
- package/control-flow/control-flow-graph.d.ts +247 -0
- package/control-flow/control-flow-graph.js +290 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +32 -0
- package/control-flow/dfg-cfg-guided-visitor.js +71 -0
- package/control-flow/diff-cfg.d.ts +11 -0
- package/control-flow/diff-cfg.js +161 -0
- package/control-flow/extract-cfg.d.ts +30 -0
- package/control-flow/extract-cfg.js +475 -0
- package/control-flow/happens-before.d.ts +7 -0
- package/{util/cfg → control-flow}/happens-before.js +3 -3
- package/control-flow/semantic-cfg-guided-visitor.d.ts +452 -0
- package/control-flow/semantic-cfg-guided-visitor.js +492 -0
- package/control-flow/simple-visitor.d.ts +25 -0
- package/control-flow/simple-visitor.js +80 -0
- package/control-flow/syntax-cfg-guided-visitor.d.ts +128 -0
- package/control-flow/syntax-cfg-guided-visitor.js +166 -0
- package/core/print/print.d.ts +1 -1
- package/core/print/slice-diff-ansi.js +1 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/dataflow/environments/built-in-config.js +9 -6
- package/dataflow/environments/built-in.d.ts +8 -4
- package/dataflow/environments/built-in.js +47 -5
- package/dataflow/environments/default-builtin-config.d.ts +2 -0
- package/dataflow/environments/default-builtin-config.js +81 -14
- package/dataflow/environments/resolve-by-name.js +15 -4
- package/dataflow/extractor.js +2 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +3 -1
- package/dataflow/graph/dataflowgraph-builder.js +4 -2
- package/dataflow/graph/diff-dataflow-graph.d.ts +16 -0
- package/dataflow/graph/{diff.js → diff-dataflow-graph.js} +30 -56
- package/dataflow/graph/graph.d.ts +11 -3
- package/dataflow/graph/graph.js +27 -12
- package/dataflow/graph/vertex.d.ts +17 -2
- package/dataflow/internal/linker.d.ts +3 -2
- package/dataflow/internal/linker.js +33 -24
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +12 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +84 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +23 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +15 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +4 -1
- package/dataflow/internal/process/functions/call/common.js +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -0
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +6 -4
- package/dataflow/internal/process/process-named-call.d.ts +1 -1
- package/dataflow/internal/process/process-named-call.js +5 -5
- package/dataflow/origin/dfg-get-origin.d.ts +82 -0
- package/dataflow/origin/dfg-get-origin.js +116 -0
- package/documentation/doc-util/doc-cfg.d.ts +13 -6
- package/documentation/doc-util/doc-cfg.js +20 -15
- package/documentation/doc-util/doc-cli-option.js +4 -2
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-escape.d.ts +7 -0
- package/documentation/doc-util/doc-escape.js +19 -0
- package/documentation/doc-util/doc-files.d.ts +1 -0
- package/documentation/doc-util/doc-files.js +2 -1
- package/documentation/doc-util/doc-normalized-ast.js +3 -3
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -1
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/doc-util/doc-server-message.js +2 -2
- package/documentation/doc-util/doc-structure.d.ts +1 -0
- package/documentation/doc-util/doc-structure.js +5 -0
- package/documentation/doc-util/doc-types.d.ts +7 -1
- package/documentation/doc-util/doc-types.js +13 -2
- package/documentation/print-capabilities-markdown.js +27 -1
- package/documentation/print-cfg-wiki.js +508 -20
- package/documentation/print-dataflow-graph-wiki.js +180 -25
- package/documentation/print-engines-wiki.js +1 -1
- package/documentation/print-faq-wiki.d.ts +1 -0
- package/documentation/print-faq-wiki.js +75 -0
- package/documentation/print-interface-wiki.js +1 -1
- package/documentation/print-linter-wiki.d.ts +1 -0
- package/documentation/print-linter-wiki.js +76 -0
- package/documentation/print-linting-and-testing-wiki.js +52 -36
- package/documentation/print-normalized-ast-wiki.js +1 -1
- package/documentation/print-onboarding-wiki.d.ts +1 -0
- package/documentation/print-onboarding-wiki.js +42 -0
- package/documentation/print-query-wiki.js +21 -1
- package/documentation/print-readme.js +10 -3
- package/linter/linter-executor.d.ts +9 -0
- package/linter/linter-executor.js +26 -0
- package/linter/linter-format.d.ts +65 -0
- package/linter/linter-format.js +9 -0
- package/linter/linter-rules.d.ts +42 -0
- package/linter/linter-rules.js +14 -0
- package/linter/rules/1-deprecated-functions.d.ts +34 -0
- package/linter/rules/1-deprecated-functions.js +54 -0
- package/linter/rules/2-file-path-validity.d.ts +48 -0
- package/linter/rules/2-file-path-validity.js +93 -0
- package/package.json +10 -6
- package/queries/catalog/call-context-query/call-context-query-executor.js +5 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +3 -3
- package/queries/catalog/call-context-query/call-context-query-format.js +7 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +2 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +24 -21
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +3 -1
- package/queries/catalog/cluster-query/cluster-query-format.js +6 -2
- package/queries/catalog/config-query/config-query-format.d.ts +2 -1
- package/queries/catalog/config-query/config-query-format.js +4 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +2 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +4 -3
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +3 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.js +11 -3
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +12 -3
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +4 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +4 -3
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +2 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +4 -3
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +2 -1
- package/queries/catalog/lineage-query/lineage-query-format.js +7 -3
- package/queries/catalog/linter-query/linter-query-executor.d.ts +3 -0
- package/queries/catalog/linter-query/linter-query-executor.js +28 -0
- package/queries/catalog/linter-query/linter-query-format.d.ts +80 -0
- package/queries/catalog/linter-query/linter-query-format.js +43 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +4 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +2 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +4 -3
- package/queries/catalog/origin-query/origin-query-executor.d.ts +5 -0
- package/queries/catalog/origin-query/origin-query-executor.js +33 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +73 -0
- package/queries/catalog/origin-query/origin-query-format.js +31 -0
- package/queries/catalog/project-query/project-query-executor.js +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +2 -1
- package/queries/catalog/project-query/project-query-format.js +4 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -3
- package/queries/catalog/search-query/search-query-format.d.ts +2 -1
- package/queries/catalog/search-query/search-query-format.js +7 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +3 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +11 -3
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -4
- package/queries/query.d.ts +143 -2
- package/queries/query.js +5 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +3 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +26 -8
- package/r-bridge/retriever.js +2 -2
- package/search/flowr-search-builder.d.ts +31 -2
- package/search/flowr-search-builder.js +30 -0
- package/search/flowr-search.d.ts +7 -1
- package/search/search-executor/search-enrichers.d.ts +73 -0
- package/search/search-executor/search-enrichers.js +98 -0
- package/search/search-executor/search-generators.d.ts +7 -2
- package/search/search-executor/search-generators.js +21 -1
- package/search/search-executor/search-mappers.d.ts +19 -0
- package/search/search-executor/search-mappers.js +21 -0
- package/search/search-executor/search-transformer.d.ts +13 -1
- package/search/search-executor/search-transformer.js +11 -1
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/static/slice-call.js +13 -3
- package/statistics/features/supported/assignments/post-process.js +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -2
- package/statistics/features/supported/used-functions/post-process.js +1 -1
- package/statistics/features/supported/used-packages/post-process.js +2 -2
- package/statistics/features/supported/values/post-process.js +2 -2
- package/statistics/output/print-stats.js +2 -2
- package/statistics/summarizer/post-process/clusterer.d.ts +1 -1
- package/statistics/summarizer/post-process/clusterer.js +1 -1
- package/statistics/summarizer/post-process/histogram.js +3 -3
- package/statistics/summarizer/post-process/post-process-output.js +3 -3
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +2 -2
- package/util/assert.js +36 -1
- package/util/cfg/cfg.d.ts +0 -80
- package/util/cfg/cfg.js +0 -549
- package/util/{arrays.d.ts → collections/arrays.d.ts} +1 -1
- package/util/{arrays.js → collections/arrays.js} +3 -3
- package/util/collections/set.js +17 -0
- package/util/diff-graph.d.ts +47 -0
- package/util/diff-graph.js +61 -0
- package/util/diff.d.ts +6 -6
- package/util/diff.js +1 -1
- package/util/mermaid/cfg.d.ts +9 -2
- package/util/mermaid/cfg.js +64 -12
- package/util/mermaid/dfg.d.ts +2 -1
- package/util/mermaid/dfg.js +26 -10
- package/util/mermaid/mermaid.d.ts +2 -0
- package/util/mermaid/mermaid.js +6 -0
- package/util/quads.js +1 -1
- package/util/schema.d.ts +1 -1
- package/util/schema.js +1 -1
- package/util/summarizer.js +1 -1
- package/util/{text.js → text/text.js} +1 -1
- package/util/{time.js → text/time.js} +1 -1
- package/util/version.js +1 -1
- package/dataflow/graph/diff.d.ts +0 -36
- package/util/cfg/happens-before.d.ts +0 -7
- package/util/cfg/visitor.d.ts +0 -9
- package/util/cfg/visitor.js +0 -30
- package/util/set.js +0 -31
- /package/util/{bimap.d.ts → collections/bimap.d.ts} +0 -0
- /package/util/{bimap.js → collections/bimap.js} +0 -0
- /package/util/{defaultmap.d.ts → collections/defaultmap.d.ts} +0 -0
- /package/util/{defaultmap.js → collections/defaultmap.js} +0 -0
- /package/util/{set.d.ts → collections/set.d.ts} +0 -0
- /package/util/{ansi.d.ts → text/ansi.d.ts} +0 -0
- /package/util/{ansi.js → text/ansi.js} +0 -0
- /package/util/{args.d.ts → text/args.d.ts} +0 -0
- /package/util/{args.js → text/args.js} +0 -0
- /package/util/{strings.d.ts → text/strings.d.ts} +0 -0
- /package/util/{strings.js → text/strings.js} +0 -0
- /package/util/{text.d.ts → text/text.d.ts} +0 -0
- /package/util/{time.d.ts → text/time.d.ts} +0 -0
|
@@ -39,7 +39,7 @@ export type WriteInfo = (DependencyInfo & {
|
|
|
39
39
|
});
|
|
40
40
|
export declare const DependenciesQueryDefinition: {
|
|
41
41
|
readonly executor: typeof executeDependenciesQuery;
|
|
42
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
42
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
43
43
|
readonly name: "parse";
|
|
44
44
|
readonly humanReadableName: "parse with R shell";
|
|
45
45
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -94,4 +94,5 @@ export declare const DependenciesQueryDefinition: {
|
|
|
94
94
|
readonly dependencies: readonly ["normalize"];
|
|
95
95
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
96
96
|
readonly schema: Joi.ObjectSchema<any>;
|
|
97
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
97
98
|
};
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DependenciesQueryDefinition = exports.Unknown = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
8
|
-
const time_1 = require("../../../util/time");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const dependencies_query_executor_1 = require("./dependencies-query-executor");
|
|
11
11
|
exports.Unknown = 'unknown';
|
|
@@ -53,6 +53,15 @@ exports.DependenciesQueryDefinition = {
|
|
|
53
53
|
sourceFunctions: functionInfoSchema.description('The set of source functions to search for.'),
|
|
54
54
|
readFunctions: functionInfoSchema.description('The set of data reading functions to search for.'),
|
|
55
55
|
writeFunctions: functionInfoSchema.description('The set of data writing functions to search for.'),
|
|
56
|
-
}).description('The dependencies query retrieves and returns the set of all dependencies in the dataflow graph, which includes libraries, sourced files, read data, and written data.')
|
|
56
|
+
}).description('The dependencies query retrieves and returns the set of all dependencies in the dataflow graph, which includes libraries, sourced files, read data, and written data.'),
|
|
57
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
58
|
+
const out = queryResults;
|
|
59
|
+
return [
|
|
60
|
+
...out.libraries.map(library => library.nodeId),
|
|
61
|
+
...out.sourcedFiles.map(sourced => sourced.nodeId),
|
|
62
|
+
...out.readData.map(read => read.nodeId),
|
|
63
|
+
...out.writtenData.map(write => write.nodeId)
|
|
64
|
+
];
|
|
65
|
+
}
|
|
57
66
|
};
|
|
58
67
|
//# sourceMappingURL=dependencies-query-format.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BasicQueryData } from '../../base-query-format';
|
|
2
2
|
import type { HappensBeforeQuery, HappensBeforeQueryResult } from './happens-before-query-format';
|
|
3
|
-
export declare function executeHappensBefore({ ast
|
|
3
|
+
export declare function executeHappensBefore({ ast }: BasicQueryData, queries: readonly HappensBeforeQuery[]): HappensBeforeQueryResult;
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeHappensBefore = executeHappensBefore;
|
|
4
4
|
const logic_1 = require("../../../util/logic");
|
|
5
5
|
const log_1 = require("../../../util/log");
|
|
6
|
-
const
|
|
7
|
-
const happens_before_1 = require("../../../
|
|
6
|
+
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
7
|
+
const happens_before_1 = require("../../../control-flow/happens-before");
|
|
8
8
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
9
|
-
function executeHappensBefore({ ast
|
|
9
|
+
function executeHappensBefore({ ast }, queries) {
|
|
10
10
|
const start = Date.now();
|
|
11
11
|
const results = {};
|
|
12
|
-
const cfg = (0,
|
|
12
|
+
const cfg = (0, extract_cfg_1.extractSimpleCfg)(ast);
|
|
13
13
|
for (const query of queries) {
|
|
14
14
|
const { a, b } = query;
|
|
15
15
|
const fingerprint = `${a}<${b}`;
|
|
@@ -13,7 +13,7 @@ export interface HappensBeforeQueryResult extends BaseQueryResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const HappensBeforeQueryDefinition: {
|
|
15
15
|
readonly executor: typeof executeHappensBefore;
|
|
16
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
17
|
readonly name: "parse";
|
|
18
18
|
readonly humanReadableName: "parse with R shell";
|
|
19
19
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -68,4 +68,5 @@ export declare const HappensBeforeQueryDefinition: {
|
|
|
68
68
|
readonly dependencies: readonly ["normalize"];
|
|
69
69
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
70
|
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
71
72
|
};
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.HappensBeforeQueryDefinition = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
8
|
-
const time_1 = require("../../../util/time");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const happens_before_query_executor_1 = require("./happens-before-query-executor");
|
|
11
11
|
exports.HappensBeforeQueryDefinition = {
|
|
@@ -22,6 +22,7 @@ exports.HappensBeforeQueryDefinition = {
|
|
|
22
22
|
type: joi_1.default.string().valid('happens-before').required().description('The type of the query.'),
|
|
23
23
|
a: joi_1.default.string().required().description('The first slicing criterion.'),
|
|
24
24
|
b: joi_1.default.string().required().description('The second slicing criterion.')
|
|
25
|
-
}).description('Happens-Before tracks whether a always happens before b.')
|
|
25
|
+
}).description('Happens-Before tracks whether a always happens before b.'),
|
|
26
|
+
flattenInvolvedNodes: () => []
|
|
26
27
|
};
|
|
27
28
|
//# sourceMappingURL=happens-before-query-format.js.map
|
|
@@ -10,7 +10,7 @@ export interface IdMapQueryResult extends BaseQueryResult {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const IdMapQueryDefinition: {
|
|
12
12
|
readonly executor: typeof executeIdMapQuery;
|
|
13
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
13
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
14
14
|
readonly name: "parse";
|
|
15
15
|
readonly humanReadableName: "parse with R shell";
|
|
16
16
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -65,4 +65,5 @@ export declare const IdMapQueryDefinition: {
|
|
|
65
65
|
readonly dependencies: readonly ["normalize"];
|
|
66
66
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
67
67
|
readonly schema: Joi.ObjectSchema<any>;
|
|
68
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
68
69
|
};
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IdMapQueryDefinition = void 0;
|
|
7
7
|
const id_map_query_executor_1 = require("./id-map-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.IdMapQueryDefinition = {
|
|
@@ -19,6 +19,7 @@ exports.IdMapQueryDefinition = {
|
|
|
19
19
|
},
|
|
20
20
|
schema: joi_1.default.object({
|
|
21
21
|
type: joi_1.default.string().valid('id-map').required().description('The type of the query.'),
|
|
22
|
-
}).description('The id map query retrieves the id map from the normalized AST.')
|
|
22
|
+
}).description('The id map query retrieves the id map from the normalized AST.'),
|
|
23
|
+
flattenInvolvedNodes: () => []
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=id-map-query-format.js.map
|
|
@@ -16,7 +16,7 @@ export interface LineageQueryResult extends BaseQueryResult {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const LineageQueryDefinition: {
|
|
18
18
|
readonly executor: typeof executeLineageQuery;
|
|
19
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
19
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
20
20
|
readonly name: "parse";
|
|
21
21
|
readonly humanReadableName: "parse with R shell";
|
|
22
22
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -71,4 +71,5 @@ export declare const LineageQueryDefinition: {
|
|
|
71
71
|
readonly dependencies: readonly ["normalize"];
|
|
72
72
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
73
73
|
readonly schema: Joi.ObjectSchema<any>;
|
|
74
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
74
75
|
};
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LineageQueryDefinition = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
8
|
-
const time_1 = require("../../../util/time");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const lineage_query_executor_1 = require("./lineage-query-executor");
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
@@ -22,6 +22,10 @@ exports.LineageQueryDefinition = {
|
|
|
22
22
|
schema: joi_1.default.object({
|
|
23
23
|
type: joi_1.default.string().valid('lineage').required().description('The type of the query.'),
|
|
24
24
|
criterion: joi_1.default.string().required().description('The slicing criterion of the node to get the lineage of.')
|
|
25
|
-
}).description('Lineage query used to find the lineage of a node in the dataflow graph')
|
|
25
|
+
}).description('Lineage query used to find the lineage of a node in the dataflow graph'),
|
|
26
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
27
|
+
const out = queryResults;
|
|
28
|
+
return Object.values(out.lineages).flatMap(lineage => [...lineage]);
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
31
|
//# sourceMappingURL=lineage-query-format.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeLinterQuery = executeLinterQuery;
|
|
4
|
+
const linter_rules_1 = require("../../../linter/linter-rules");
|
|
5
|
+
const log_1 = require("../../../util/log");
|
|
6
|
+
const linter_executor_1 = require("../../../linter/linter-executor");
|
|
7
|
+
function executeLinterQuery({ ast, dataflow }, queries) {
|
|
8
|
+
const flattened = queries.flatMap(q => q.rules ?? Object.keys(linter_rules_1.LintingRules));
|
|
9
|
+
const distinct = new Set(flattened);
|
|
10
|
+
if (distinct.size !== flattened.length) {
|
|
11
|
+
const pretty = [...distinct].filter(r => flattened.indexOf(r) !== flattened.lastIndexOf(r)).map(r => typeof r === 'string' ? r : r.name).join(', ');
|
|
12
|
+
log_1.log.warn(`Linter query collection contains duplicate rules ${pretty}, only linting for each rule once`);
|
|
13
|
+
}
|
|
14
|
+
const results = { results: {} };
|
|
15
|
+
const start = Date.now();
|
|
16
|
+
const input = { normalize: ast, dataflow };
|
|
17
|
+
for (const entry of distinct) {
|
|
18
|
+
const ruleName = typeof entry === 'string' ? entry : entry.name;
|
|
19
|
+
results.results[ruleName] = (0, linter_executor_1.executeLintingRule)(ruleName, input, entry?.config);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
...results,
|
|
23
|
+
'.meta': {
|
|
24
|
+
timing: Date.now() - start
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=linter-query-executor.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import { executeLinterQuery } from './linter-query-executor';
|
|
4
|
+
import type { LintingRuleNames } from '../../../linter/linter-rules';
|
|
5
|
+
import type { ConfiguredLintingRule, LintingResults } from '../../../linter/linter-format';
|
|
6
|
+
export interface LinterQuery extends BaseQueryFormat {
|
|
7
|
+
readonly type: 'linter';
|
|
8
|
+
/**
|
|
9
|
+
* The rules to lint for. If unset, all rules will be included.
|
|
10
|
+
* Optionally, a {@link ConfiguredLintingRule} can be provided, which additionally includes custom user-supplied values for the linting rules' configurations.
|
|
11
|
+
*/
|
|
12
|
+
readonly rules?: (LintingRuleNames | ConfiguredLintingRule)[];
|
|
13
|
+
}
|
|
14
|
+
export interface LinterQueryResult extends BaseQueryResult {
|
|
15
|
+
/**
|
|
16
|
+
* The results of the linter query, which returns a set of linting results for each rule that was executed.
|
|
17
|
+
*/
|
|
18
|
+
readonly results: {
|
|
19
|
+
[L in LintingRuleNames]?: LintingResults<L>;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare const LinterQueryDefinition: {
|
|
23
|
+
readonly executor: typeof executeLinterQuery;
|
|
24
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
25
|
+
readonly name: "parse";
|
|
26
|
+
readonly humanReadableName: "parse with R shell";
|
|
27
|
+
readonly description: "Parse the given R code into an AST";
|
|
28
|
+
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
29
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
30
|
+
readonly printer: {
|
|
31
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
32
|
+
readonly 2: {
|
|
33
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
34
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
35
|
+
};
|
|
36
|
+
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
37
|
+
};
|
|
38
|
+
readonly dependencies: readonly [];
|
|
39
|
+
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
40
|
+
} | {
|
|
41
|
+
readonly name: "normalize";
|
|
42
|
+
readonly humanReadableName: "normalize";
|
|
43
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
44
|
+
readonly processor: (results: {
|
|
45
|
+
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
46
|
+
}, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
47
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
48
|
+
readonly printer: {
|
|
49
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
50
|
+
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
51
|
+
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
52
|
+
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
53
|
+
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
54
|
+
};
|
|
55
|
+
readonly dependencies: readonly ["parse"];
|
|
56
|
+
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
57
|
+
} | {
|
|
58
|
+
readonly humanReadableName: "dataflow";
|
|
59
|
+
readonly processor: (results: {
|
|
60
|
+
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
61
|
+
}, input: {
|
|
62
|
+
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
63
|
+
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
64
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
65
|
+
readonly requiredInput: {};
|
|
66
|
+
readonly name: "dataflow";
|
|
67
|
+
readonly description: "Construct the dataflow graph";
|
|
68
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
69
|
+
readonly printer: {
|
|
70
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
71
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
72
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
73
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
74
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
75
|
+
};
|
|
76
|
+
readonly dependencies: readonly ["normalize"];
|
|
77
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
78
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
79
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
80
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LinterQueryDefinition = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const linter_query_executor_1 = require("./linter-query-executor");
|
|
9
|
+
const linter_rules_1 = require("../../../linter/linter-rules");
|
|
10
|
+
const linter_format_1 = require("../../../linter/linter-format");
|
|
11
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
12
|
+
const time_1 = require("../../../util/text/time");
|
|
13
|
+
exports.LinterQueryDefinition = {
|
|
14
|
+
executor: linter_query_executor_1.executeLinterQuery,
|
|
15
|
+
asciiSummarizer: (formatter, _processed, queryResults, result) => {
|
|
16
|
+
const out = queryResults;
|
|
17
|
+
result.push(`Query: ${(0, ansi_1.bold)('linter', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
18
|
+
for (const [ruleName, results] of Object.entries(out.results)) {
|
|
19
|
+
const rule = linter_rules_1.LintingRules[ruleName];
|
|
20
|
+
result.push(` ╰ ${ruleName}:`);
|
|
21
|
+
for (const certainty of [linter_format_1.LintingCertainty.Definitely, linter_format_1.LintingCertainty.Maybe]) {
|
|
22
|
+
const certaintyResults = results.results.filter(r => r.certainty === certainty);
|
|
23
|
+
if (certaintyResults.length) {
|
|
24
|
+
result.push(` ╰ ${certainty}:`);
|
|
25
|
+
for (const res of certaintyResults) {
|
|
26
|
+
result.push(` ╰ ${rule.prettyPrint(res)}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
result.push(` ╰ Metadata: ${JSON.stringify(results['.meta'])}`);
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
},
|
|
34
|
+
schema: joi_1.default.object({
|
|
35
|
+
type: joi_1.default.string().valid('linter').required().description('The type of the query.'),
|
|
36
|
+
rules: joi_1.default.array().items(joi_1.default.string().valid(...Object.keys(linter_rules_1.LintingRules)), joi_1.default.object({
|
|
37
|
+
name: joi_1.default.string().valid(...Object.keys(linter_rules_1.LintingRules)).required(),
|
|
38
|
+
config: joi_1.default.object()
|
|
39
|
+
})).description('The rules to lint for. If unset, all rules will be included.')
|
|
40
|
+
}).description('The linter query lints for the given set of rules and returns the result.'),
|
|
41
|
+
flattenInvolvedNodes: () => []
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=linter-query-format.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import { executeLocationMapQuery } from './location-map-query-executor';
|
|
3
|
-
import { type OutputFormatter } from '../../../util/ansi';
|
|
3
|
+
import { type OutputFormatter } from '../../../util/text/ansi';
|
|
4
4
|
import Joi from 'joi';
|
|
5
5
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import type { SourceRange } from '../../../util/range';
|
|
@@ -23,4 +23,5 @@ export declare const LocationMapQueryDefinition: {
|
|
|
23
23
|
readonly executor: typeof executeLocationMapQuery;
|
|
24
24
|
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
25
25
|
readonly schema: Joi.ObjectSchema<any>;
|
|
26
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
26
27
|
};
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LocationMapQueryDefinition = void 0;
|
|
7
7
|
const location_map_query_executor_1 = require("./location-map-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.LocationMapQueryDefinition = {
|
|
@@ -23,6 +23,7 @@ exports.LocationMapQueryDefinition = {
|
|
|
23
23
|
},
|
|
24
24
|
schema: joi_1.default.object({
|
|
25
25
|
type: joi_1.default.string().valid('location-map').required().description('The type of the query.'),
|
|
26
|
-
}).description('The location map query retrieves the location of every id in the ast.')
|
|
26
|
+
}).description('The location map query retrieves the location of every id in the ast.'),
|
|
27
|
+
flattenInvolvedNodes: () => []
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=location-map-query-format.js.map
|
|
@@ -13,7 +13,7 @@ export interface NormalizedAstQueryResult extends BaseQueryResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const NormalizedAstQueryDefinition: {
|
|
15
15
|
readonly executor: typeof executeNormalizedAstQuery;
|
|
16
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
17
|
readonly name: "parse";
|
|
18
18
|
readonly humanReadableName: "parse with R shell";
|
|
19
19
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -68,4 +68,5 @@ export declare const NormalizedAstQueryDefinition: {
|
|
|
68
68
|
readonly dependencies: readonly ["normalize"];
|
|
69
69
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
70
|
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
71
72
|
};
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.NormalizedAstQueryDefinition = void 0;
|
|
7
7
|
const normalized_ast_query_executor_1 = require("./normalized-ast-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const ast_1 = require("../../../util/mermaid/ast");
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.NormalizedAstQueryDefinition = {
|
|
@@ -19,6 +19,7 @@ exports.NormalizedAstQueryDefinition = {
|
|
|
19
19
|
},
|
|
20
20
|
schema: joi_1.default.object({
|
|
21
21
|
type: joi_1.default.string().valid('normalized-ast').required().description('The type of the query.'),
|
|
22
|
-
}).description('The normalized AST query simply returns the normalized AST, there is no need to pass it multiple times!')
|
|
22
|
+
}).description('The normalized AST query simply returns the normalized AST, there is no need to pass it multiple times!'),
|
|
23
|
+
flattenInvolvedNodes: () => []
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=normalized-ast-query-format.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
2
|
+
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
+
import type { OriginQueryResult, OriginQuery } from './origin-query-format';
|
|
4
|
+
export declare function fingerPrintOfQuery(query: OriginQuery): SingleSlicingCriterion;
|
|
5
|
+
export declare function executeResolveValueQuery({ dataflow: { graph }, ast }: BasicQueryData, queries: readonly OriginQuery[]): OriginQueryResult;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fingerPrintOfQuery = fingerPrintOfQuery;
|
|
4
|
+
exports.executeResolveValueQuery = executeResolveValueQuery;
|
|
5
|
+
const log_1 = require("../../../util/log");
|
|
6
|
+
const parse_1 = require("../../../slicing/criterion/parse");
|
|
7
|
+
const dfg_get_origin_1 = require("../../../dataflow/origin/dfg-get-origin");
|
|
8
|
+
function fingerPrintOfQuery(query) {
|
|
9
|
+
return query.criterion;
|
|
10
|
+
}
|
|
11
|
+
function executeResolveValueQuery({ dataflow: { graph }, ast }, queries) {
|
|
12
|
+
const start = Date.now();
|
|
13
|
+
const results = {};
|
|
14
|
+
for (const query of queries) {
|
|
15
|
+
const key = fingerPrintOfQuery(query);
|
|
16
|
+
if (results[key]) {
|
|
17
|
+
log_1.log.warn(`Duplicate Key for origin-query: ${key}, skipping...`);
|
|
18
|
+
}
|
|
19
|
+
const astId = (0, parse_1.slicingCriterionToId)(key, ast.idMap);
|
|
20
|
+
if (astId === undefined) {
|
|
21
|
+
log_1.log.warn(`Could not resolve id for ${key}, skipping...`);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
results[key] = (0, dfg_get_origin_1.getOriginInDfg)(graph, astId);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
'.meta': {
|
|
28
|
+
timing: Date.now() - start
|
|
29
|
+
},
|
|
30
|
+
results
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=origin-query-executor.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
+
import Joi from 'joi';
|
|
4
|
+
import { executeResolveValueQuery } from './origin-query-executor';
|
|
5
|
+
import type { Origin } from '../../../dataflow/origin/dfg-get-origin';
|
|
6
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
|
+
export interface OriginQuery extends BaseQueryFormat {
|
|
8
|
+
readonly type: 'origin';
|
|
9
|
+
/** The slicing criteria to use */
|
|
10
|
+
readonly criterion: SingleSlicingCriterion;
|
|
11
|
+
}
|
|
12
|
+
export interface OriginQueryResult extends BaseQueryResult {
|
|
13
|
+
results: Record<SingleSlicingCriterion, Origin[] | undefined>;
|
|
14
|
+
}
|
|
15
|
+
export declare const OriginQueryDefinition: {
|
|
16
|
+
readonly executor: typeof executeResolveValueQuery;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
|
+
readonly name: "parse";
|
|
19
|
+
readonly humanReadableName: "parse with R shell";
|
|
20
|
+
readonly description: "Parse the given R code into an AST";
|
|
21
|
+
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
22
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
23
|
+
readonly printer: {
|
|
24
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
25
|
+
readonly 2: {
|
|
26
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
27
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
28
|
+
};
|
|
29
|
+
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
30
|
+
};
|
|
31
|
+
readonly dependencies: readonly [];
|
|
32
|
+
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
33
|
+
} | {
|
|
34
|
+
readonly name: "normalize";
|
|
35
|
+
readonly humanReadableName: "normalize";
|
|
36
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
37
|
+
readonly processor: (results: {
|
|
38
|
+
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
39
|
+
}, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
40
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
41
|
+
readonly printer: {
|
|
42
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
43
|
+
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
44
|
+
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
45
|
+
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
46
|
+
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
47
|
+
};
|
|
48
|
+
readonly dependencies: readonly ["parse"];
|
|
49
|
+
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
50
|
+
} | {
|
|
51
|
+
readonly humanReadableName: "dataflow";
|
|
52
|
+
readonly processor: (results: {
|
|
53
|
+
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
54
|
+
}, input: {
|
|
55
|
+
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
56
|
+
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
57
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
58
|
+
readonly requiredInput: {};
|
|
59
|
+
readonly name: "dataflow";
|
|
60
|
+
readonly description: "Construct the dataflow graph";
|
|
61
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
62
|
+
readonly printer: {
|
|
63
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
64
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
65
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
66
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
67
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
68
|
+
};
|
|
69
|
+
readonly dependencies: readonly ["normalize"];
|
|
70
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
71
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
72
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
73
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OriginQueryDefinition = void 0;
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
|
+
const joi_1 = __importDefault(require("joi"));
|
|
10
|
+
const origin_query_executor_1 = require("./origin-query-executor");
|
|
11
|
+
exports.OriginQueryDefinition = {
|
|
12
|
+
executor: origin_query_executor_1.executeResolveValueQuery,
|
|
13
|
+
asciiSummarizer: (formatter, _processed, queryResults, result) => {
|
|
14
|
+
const out = queryResults;
|
|
15
|
+
result.push(`Query: ${(0, ansi_1.bold)('origin', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
16
|
+
for (const [criteria, obj] of Object.entries(out.results)) {
|
|
17
|
+
result.push(` ╰ Origins for {${criteria}}`);
|
|
18
|
+
result.push(` ╰ ${obj?.map(o => JSON.stringify(o)).join(', ')}`);
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
schema: joi_1.default.object({
|
|
23
|
+
type: joi_1.default.string().valid('origin').required().description('The type of the query.'),
|
|
24
|
+
criterion: joi_1.default.string().required().description('The slicing criteria to use'),
|
|
25
|
+
}).description('The resolve value query used to get definitions of an identifier'),
|
|
26
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
27
|
+
const out = queryResults;
|
|
28
|
+
return Object.entries(out.results).flatMap(([_, obj]) => obj?.map(origin => origin.id) ?? []);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=origin-query-format.js.map
|
|
@@ -4,7 +4,7 @@ exports.executeProjectQuery = executeProjectQuery;
|
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
5
|
function executeProjectQuery({ dataflow }, queries) {
|
|
6
6
|
if (queries.length !== 1) {
|
|
7
|
-
log_1.log.warn('
|
|
7
|
+
log_1.log.warn('Project query expects only up to one query, but got', queries.length);
|
|
8
8
|
}
|
|
9
9
|
return {
|
|
10
10
|
'.meta': {
|
|
@@ -9,7 +9,7 @@ export interface ProjectQueryResult extends BaseQueryResult {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const ProjectQueryDefinition: {
|
|
11
11
|
readonly executor: typeof executeProjectQuery;
|
|
12
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
12
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
13
13
|
readonly name: "parse";
|
|
14
14
|
readonly humanReadableName: "parse with R shell";
|
|
15
15
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -64,4 +64,5 @@ export declare const ProjectQueryDefinition: {
|
|
|
64
64
|
readonly dependencies: readonly ["normalize"];
|
|
65
65
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
66
66
|
readonly schema: Joi.ObjectSchema<any>;
|
|
67
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
67
68
|
};
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ProjectQueryDefinition = void 0;
|
|
7
7
|
const project_query_executor_1 = require("./project-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
exports.ProjectQueryDefinition = {
|
|
12
12
|
executor: project_query_executor_1.executeProjectQuery,
|
|
@@ -21,6 +21,7 @@ exports.ProjectQueryDefinition = {
|
|
|
21
21
|
},
|
|
22
22
|
schema: joi_1.default.object({
|
|
23
23
|
type: joi_1.default.string().valid('project').required().description('The type of the query.'),
|
|
24
|
-
}).description('The project query provides information on the analyzed project.')
|
|
24
|
+
}).description('The project query provides information on the analyzed project.'),
|
|
25
|
+
flattenInvolvedNodes: () => []
|
|
25
26
|
};
|
|
26
27
|
//# sourceMappingURL=project-query-format.js.map
|