@eagleoutice/flowr 2.4.8 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -45
- package/benchmark/slicer.js +1 -1
- package/benchmark/summarizer/second-phase/graph.js +2 -2
- package/cli/flowr.js +3 -29
- package/cli/repl/commands/repl-cfg.d.ts +5 -5
- package/cli/repl/commands/repl-cfg.js +21 -22
- package/cli/repl/commands/repl-commands.d.ts +3 -3
- package/cli/repl/commands/repl-commands.js +2 -0
- package/cli/repl/commands/repl-dataflow.d.ts +5 -5
- package/cli/repl/commands/repl-dataflow.js +27 -30
- package/cli/repl/commands/repl-execute.js +1 -0
- package/cli/repl/commands/repl-lineage.js +1 -0
- package/cli/repl/commands/repl-main.d.ts +34 -3
- package/cli/repl/commands/repl-normalize.d.ts +3 -3
- package/cli/repl/commands/repl-normalize.js +15 -19
- package/cli/repl/commands/repl-parse.d.ts +2 -2
- package/cli/repl/commands/repl-parse.js +13 -8
- package/cli/repl/commands/repl-query.d.ts +3 -3
- package/cli/repl/commands/repl-query.js +29 -19
- package/cli/repl/commands/repl-quit.js +1 -0
- package/cli/repl/commands/repl-version.js +1 -0
- package/cli/repl/core.d.ts +4 -1
- package/cli/repl/core.js +21 -1
- package/cli/repl/server/connection.d.ts +7 -3
- package/cli/repl/server/connection.js +40 -48
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/slicer-app.js +8 -3
- package/config.d.ts +1 -1
- package/config.js +4 -1
- package/control-flow/extract-cfg.d.ts +1 -1
- package/control-flow/extract-cfg.js +1 -1
- package/core/pipeline-executor.d.ts +5 -0
- package/core/pipeline-executor.js +5 -0
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +42 -42
- package/core/steps/pipeline/default-pipelines.js +4 -1
- package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
- package/dataflow/graph/dataflowgraph-builder.js +6 -6
- package/documentation/doc-util/doc-query.d.ts +3 -6
- package/documentation/doc-util/doc-query.js +5 -17
- package/documentation/doc-util/doc-search.js +7 -10
- package/documentation/doc-util/doc-structure.d.ts +4 -0
- package/documentation/doc-util/doc-structure.js +28 -0
- package/documentation/doc-util/doc-types.d.ts +5 -1
- package/documentation/doc-util/doc-types.js +29 -3
- package/documentation/print-analyzer-wiki.d.ts +1 -0
- package/documentation/print-analyzer-wiki.js +137 -0
- package/documentation/print-core-wiki.d.ts +2 -1
- package/documentation/print-core-wiki.js +58 -4
- package/documentation/print-dataflow-graph-wiki.js +15 -22
- package/documentation/print-interface-wiki.js +18 -1
- package/documentation/print-linter-wiki.js +5 -1
- package/documentation/print-linting-and-testing-wiki.js +4 -0
- package/documentation/print-normalized-ast-wiki.js +6 -8
- package/documentation/print-readme.js +6 -0
- package/engines.d.ts +9 -0
- package/engines.js +38 -0
- package/linter/linter-executor.d.ts +2 -8
- package/linter/linter-executor.js +9 -4
- package/linter/linter-format.d.ts +8 -9
- package/linter/linter-rules.d.ts +57 -15
- package/linter/linter-rules.js +2 -0
- package/linter/rules/absolute-path.d.ts +1 -0
- package/linter/rules/dataframe-access-validation.d.ts +4 -3
- package/linter/rules/dataframe-access-validation.js +7 -4
- package/linter/rules/dead-code.d.ts +2 -1
- package/linter/rules/deprecated-functions.d.ts +15 -28
- package/linter/rules/deprecated-functions.js +5 -43
- package/linter/rules/file-path-validity.d.ts +2 -1
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/function-finder-util.d.ts +51 -0
- package/linter/rules/function-finder-util.js +77 -0
- package/linter/rules/naming-convention.d.ts +2 -1
- package/linter/rules/network-functions.d.ts +40 -0
- package/linter/rules/network-functions.js +24 -0
- package/linter/rules/seeded-randomness.d.ts +2 -1
- package/linter/rules/unused-definition.d.ts +2 -1
- package/linter/rules/useless-loop.d.ts +3 -2
- package/linter/rules/useless-loop.js +4 -6
- package/package.json +5 -1
- package/project/cache/flowr-analyzer-cache.d.ts +93 -0
- package/project/cache/flowr-analyzer-cache.js +156 -0
- package/project/cache/flowr-cache.d.ts +28 -0
- package/project/cache/flowr-cache.js +49 -0
- package/project/context/abstract-flowr-analyzer-context.d.ts +35 -0
- package/project/context/abstract-flowr-analyzer-context.js +46 -0
- package/project/context/flowr-analyzer-context.d.ts +48 -0
- package/project/context/flowr-analyzer-context.js +47 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +38 -0
- package/project/context/flowr-analyzer-dependencies-context.js +39 -0
- package/project/context/flowr-analyzer-files-context.d.ts +86 -0
- package/project/context/flowr-analyzer-files-context.js +130 -0
- package/project/context/flowr-analyzer-loading-order-context.d.ts +76 -0
- package/project/context/flowr-analyzer-loading-order-context.js +90 -0
- package/project/context/flowr-file.d.ts +89 -0
- package/project/context/flowr-file.js +78 -0
- package/project/flowr-analyzer-builder.d.ts +106 -0
- package/project/flowr-analyzer-builder.js +197 -0
- package/project/flowr-analyzer.d.ts +125 -0
- package/project/flowr-analyzer.js +81 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
- package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
- package/project/plugins/file-plugins/flowr-description-file.js +38 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
- package/project/plugins/flowr-analyzer-plugin.js +82 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
- package/project/plugins/package-version-plugins/package.d.ts +15 -0
- package/project/plugins/package-version-plugins/package.js +56 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
- package/queries/base-query-format.d.ts +2 -8
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +20 -13
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.js +5 -5
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
- package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
- package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- 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 +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
- package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
- package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
- 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-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
- package/queries/catalog/origin-query/origin-query-format.js +1 -1
- package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
- package/queries/catalog/project-query/project-query-executor.js +2 -2
- package/queries/catalog/project-query/project-query-format.d.ts +1 -54
- package/queries/catalog/project-query/project-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
- package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.js +3 -3
- package/queries/catalog/search-query/search-query-format.d.ts +1 -54
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
- package/queries/query-print.d.ts +4 -4
- package/queries/query-print.js +12 -12
- package/queries/query.d.ts +29 -885
- package/queries/query.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +1 -1
- package/r-bridge/retriever.d.ts +15 -2
- package/r-bridge/retriever.js +15 -5
- package/search/flowr-search-executor.d.ts +3 -5
- package/search/flowr-search-executor.js +6 -4
- package/search/flowr-search-filters.d.ts +12 -6
- package/search/flowr-search-filters.js +1 -1
- package/search/flowr-search.d.ts +5 -16
- package/search/flowr-search.js +14 -5
- package/search/search-executor/search-enrichers.d.ts +37 -36
- package/search/search-executor/search-enrichers.js +4 -4
- package/search/search-executor/search-generators.d.ts +12 -12
- package/search/search-executor/search-generators.js +27 -19
- package/search/search-executor/search-mappers.d.ts +5 -5
- package/search/search-executor/search-transformer.d.ts +17 -17
- package/search/search-executor/search-transformer.js +14 -7
- package/util/collections/arrays.d.ts +1 -0
- package/util/collections/arrays.js +15 -0
- package/util/collections/objectmap.d.ts +17 -0
- package/util/collections/objectmap.js +28 -0
- package/util/containers.d.ts +0 -1
- package/util/containers.js +0 -1
- package/util/files.d.ts +17 -0
- package/util/files.js +65 -0
- package/util/formats/adapter-format.d.ts +6 -0
- package/util/formats/adapter-format.js +3 -0
- package/util/formats/adapter.d.ts +18 -0
- package/util/formats/adapter.js +49 -0
- package/util/formats/adapters/r-adapter.d.ts +4 -0
- package/util/formats/adapters/r-adapter.js +7 -0
- package/util/formats/adapters/rmd-adapter.d.ts +26 -0
- package/util/formats/adapters/rmd-adapter.js +91 -0
- package/util/version.js +1 -1
|
@@ -4,19 +4,21 @@ import Joi from 'joi';
|
|
|
4
4
|
import { executeDependenciesQuery } from './dependencies-query-executor';
|
|
5
5
|
import type { FunctionInfo } from './function-info/function-info';
|
|
6
6
|
import type { CallContextQueryResult } from '../call-context-query/call-context-query-format';
|
|
7
|
+
import type { Range } from 'semver';
|
|
8
|
+
import type { AsyncOrSync } from 'ts-essentials';
|
|
7
9
|
export declare const Unknown = "unknown";
|
|
8
10
|
export interface DependencyCategorySettings {
|
|
9
11
|
queryDisplayName?: string;
|
|
10
12
|
functions: FunctionInfo[];
|
|
11
13
|
defaultValue?: string;
|
|
12
|
-
additionalAnalysis?: (data: BasicQueryData, ignoreDefault: boolean, functions: FunctionInfo[], queryResults: CallContextQueryResult, result: DependencyInfo[]) => void
|
|
14
|
+
additionalAnalysis?: (data: BasicQueryData, ignoreDefault: boolean, functions: FunctionInfo[], queryResults: CallContextQueryResult, result: DependencyInfo[]) => AsyncOrSync<void>;
|
|
13
15
|
}
|
|
14
16
|
export declare const DefaultDependencyCategories: {
|
|
15
17
|
readonly library: {
|
|
16
18
|
readonly queryDisplayName: "Libraries";
|
|
17
19
|
readonly functions: FunctionInfo[];
|
|
18
20
|
readonly defaultValue: "unknown";
|
|
19
|
-
readonly additionalAnalysis: (data: BasicQueryData, ignoreDefault: boolean, _functions: FunctionInfo[], _queryResults: CallContextQueryResult, result: DependencyInfo[]) => void
|
|
21
|
+
readonly additionalAnalysis: (data: BasicQueryData, ignoreDefault: boolean, _functions: FunctionInfo[], _queryResults: CallContextQueryResult, result: DependencyInfo[]) => Promise<void>;
|
|
20
22
|
};
|
|
21
23
|
readonly source: {
|
|
22
24
|
readonly queryDisplayName: "Sourced Files";
|
|
@@ -59,64 +61,13 @@ export interface DependencyInfo extends Record<string, unknown> {
|
|
|
59
61
|
lexemeOfArgument?: string;
|
|
60
62
|
/** The library name, file, source, destination etc. being sourced, read from, or written to. */
|
|
61
63
|
value?: string;
|
|
64
|
+
versionConstraints?: Range[];
|
|
65
|
+
derivedVersion?: Range;
|
|
62
66
|
}
|
|
63
67
|
export declare function getAllCategories(queries: readonly DependenciesQuery[]): Record<DependencyCategoryName, DependencyCategorySettings>;
|
|
64
68
|
export declare const DependenciesQueryDefinition: {
|
|
65
69
|
readonly executor: typeof executeDependenciesQuery;
|
|
66
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
67
|
-
readonly name: "parse";
|
|
68
|
-
readonly humanReadableName: "parse with R shell";
|
|
69
|
-
readonly description: "Parse the given R code into an AST";
|
|
70
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
71
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
72
|
-
readonly printer: {
|
|
73
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
74
|
-
readonly 2: {
|
|
75
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
76
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
77
|
-
};
|
|
78
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
79
|
-
};
|
|
80
|
-
readonly dependencies: readonly [];
|
|
81
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
82
|
-
} | {
|
|
83
|
-
readonly name: "normalize";
|
|
84
|
-
readonly humanReadableName: "normalize";
|
|
85
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
86
|
-
readonly processor: (results: {
|
|
87
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
88
|
-
}, 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>>;
|
|
89
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
90
|
-
readonly printer: {
|
|
91
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
92
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
93
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
94
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
95
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
96
|
-
};
|
|
97
|
-
readonly dependencies: readonly ["parse"];
|
|
98
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
99
|
-
} | {
|
|
100
|
-
readonly humanReadableName: "dataflow";
|
|
101
|
-
readonly processor: (results: {
|
|
102
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
103
|
-
}, input: {
|
|
104
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
105
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
106
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
107
|
-
readonly requiredInput: {};
|
|
108
|
-
readonly name: "dataflow";
|
|
109
|
-
readonly description: "Construct the dataflow graph";
|
|
110
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
111
|
-
readonly printer: {
|
|
112
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
113
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
114
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
115
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
116
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
117
|
-
};
|
|
118
|
-
readonly dependencies: readonly ["normalize"];
|
|
119
|
-
}>>, queryResults: BaseQueryResult, result: string[], queries: readonly import("../../query").Query[]) => true;
|
|
70
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[], queries: readonly import("../../query").Query[]) => true;
|
|
120
71
|
readonly schema: Joi.ObjectSchema<any>;
|
|
121
72
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, query: readonly import("../../query").Query[]) => NodeId[];
|
|
122
73
|
};
|
|
@@ -23,15 +23,18 @@ exports.DefaultDependencyCategories = {
|
|
|
23
23
|
functions: library_functions_1.LibraryFunctions,
|
|
24
24
|
defaultValue: exports.Unknown,
|
|
25
25
|
/* for libraries, we have to additionally track all uses of `::` and `:::`, for this we currently simply traverse all uses */
|
|
26
|
-
additionalAnalysis: (data, ignoreDefault, _functions, _queryResults, result) => {
|
|
26
|
+
additionalAnalysis: async (data, ignoreDefault, _functions, _queryResults, result) => {
|
|
27
27
|
if (!ignoreDefault) {
|
|
28
|
-
(0, visitor_1.visitAst)(data.
|
|
28
|
+
(0, visitor_1.visitAst)((await data.analyzer.normalize()).ast, n => {
|
|
29
29
|
if (n.type === type_1.RType.Symbol && n.namespace) {
|
|
30
|
+
const dep = data.analyzer.context().deps.getDependency(n.namespace);
|
|
30
31
|
/* we should improve the identification of ':::' */
|
|
31
32
|
result.push({
|
|
32
33
|
nodeId: n.info.id,
|
|
33
34
|
functionName: (n.info.fullLexeme ?? n.lexeme).includes(':::') ? ':::' : '::',
|
|
34
35
|
value: n.namespace,
|
|
36
|
+
versionConstraints: dep?.versionConstraints,
|
|
37
|
+
derivedVersion: dep?.derivedVersion
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
});
|
|
@@ -75,7 +78,7 @@ function printResultSection(title, infos, result) {
|
|
|
75
78
|
}, new Map());
|
|
76
79
|
for (const [functionName, infos] of grouped) {
|
|
77
80
|
result.push(` ╰ \`${functionName}\``);
|
|
78
|
-
result.push(infos.map(i => ` ╰ Node Id: ${i.nodeId}${i.value !== undefined ? `, \`${i.value}\`` : ''}`).join('\n'));
|
|
81
|
+
result.push(infos.map(i => ` ╰ Node Id: ${i.nodeId}${i.value !== undefined ? `, \`${i.value}\`` : ''}${i.derivedVersion !== undefined ? `, Version: \`${i.derivedVersion.format()}\`` : ''}`).join('\n'));
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
function getAllCategories(queries) {
|
|
@@ -95,7 +98,7 @@ const functionInfoSchema = joi_1.default.array().items(joi_1.default.object({
|
|
|
95
98
|
})).optional();
|
|
96
99
|
exports.DependenciesQueryDefinition = {
|
|
97
100
|
executor: dependencies_query_executor_1.executeDependenciesQuery,
|
|
98
|
-
asciiSummarizer: (formatter,
|
|
101
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result, queries) => {
|
|
99
102
|
const out = queryResults;
|
|
100
103
|
result.push(`Query: ${(0, ansi_1.bold)('dependencies', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
101
104
|
for (const [category, value] of Object.entries(getAllCategories(queries))) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DfShapeQuery, DfShapeQueryResult } from './df-shape-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDfShapeQuery({
|
|
3
|
+
export declare function executeDfShapeQuery({ analyzer }: BasicQueryData, queries: readonly DfShapeQuery[]): Promise<DfShapeQueryResult>;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDfShapeQuery = executeDfShapeQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
-
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
6
5
|
const shape_inference_1 = require("../../../abstract-interpretation/data-frame/shape-inference");
|
|
7
6
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
8
|
-
function executeDfShapeQuery({
|
|
7
|
+
async function executeDfShapeQuery({ analyzer }, queries) {
|
|
9
8
|
if (queries.length !== 1 && queries.some(query => query.criterion === undefined)) {
|
|
10
9
|
log_1.log.warn('The dataframe shape query expects only up to one query without slicing criterion, but got', queries.length);
|
|
11
10
|
queries = [{ type: 'df-shape' }];
|
|
12
11
|
}
|
|
12
|
+
const ast = await analyzer.normalize();
|
|
13
|
+
const graph = (await analyzer.dataflow()).graph;
|
|
13
14
|
const start = Date.now();
|
|
14
|
-
const
|
|
15
|
-
const domains = (0, shape_inference_1.inferDataFrameShapes)(cfg, graph, ast, config);
|
|
15
|
+
const domains = (0, shape_inference_1.inferDataFrameShapes)(await analyzer.controlflow(), graph, ast, analyzer.flowrConfig);
|
|
16
16
|
if (queries.length === 1 && queries[0].criterion === undefined) {
|
|
17
17
|
return {
|
|
18
18
|
'.meta': {
|
|
@@ -13,60 +13,7 @@ export interface DfShapeQueryResult extends BaseQueryResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const DfShapeQueryDefinition: {
|
|
15
15
|
readonly executor: typeof executeDfShapeQuery;
|
|
16
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
17
|
-
readonly name: "parse";
|
|
18
|
-
readonly humanReadableName: "parse with R shell";
|
|
19
|
-
readonly description: "Parse the given R code into an AST";
|
|
20
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
21
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
22
|
-
readonly printer: {
|
|
23
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
24
|
-
readonly 2: {
|
|
25
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
26
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
27
|
-
};
|
|
28
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
29
|
-
};
|
|
30
|
-
readonly dependencies: readonly [];
|
|
31
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
32
|
-
} | {
|
|
33
|
-
readonly name: "normalize";
|
|
34
|
-
readonly humanReadableName: "normalize";
|
|
35
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
36
|
-
readonly processor: (results: {
|
|
37
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
38
|
-
}, 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>>;
|
|
39
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
40
|
-
readonly printer: {
|
|
41
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
42
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
43
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
44
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
45
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
46
|
-
};
|
|
47
|
-
readonly dependencies: readonly ["parse"];
|
|
48
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
49
|
-
} | {
|
|
50
|
-
readonly humanReadableName: "dataflow";
|
|
51
|
-
readonly processor: (results: {
|
|
52
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
53
|
-
}, input: {
|
|
54
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
55
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
56
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
-
readonly requiredInput: {};
|
|
58
|
-
readonly name: "dataflow";
|
|
59
|
-
readonly description: "Construct the dataflow graph";
|
|
60
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
-
readonly printer: {
|
|
62
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
-
};
|
|
68
|
-
readonly dependencies: readonly ["normalize"];
|
|
69
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
17
|
readonly schema: Joi.ObjectSchema<any>;
|
|
71
18
|
readonly flattenInvolvedNodes: () => never[];
|
|
72
19
|
};
|
|
@@ -11,7 +11,7 @@ const df_shape_query_executor_1 = require("./df-shape-query-executor");
|
|
|
11
11
|
const json_1 = require("../../../util/json");
|
|
12
12
|
exports.DfShapeQueryDefinition = {
|
|
13
13
|
executor: df_shape_query_executor_1.executeDfShapeQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('df-shape', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
17
|
result.push(...out.domains.entries().take(20).map(([key, domain]) => {
|
|
@@ -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({
|
|
3
|
+
export declare function executeHappensBefore({ analyzer }: BasicQueryData, queries: readonly HappensBeforeQuery[]): Promise<HappensBeforeQueryResult>;
|
|
@@ -6,9 +6,10 @@ const log_1 = require("../../../util/log");
|
|
|
6
6
|
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
7
7
|
const happens_before_1 = require("../../../control-flow/happens-before");
|
|
8
8
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
9
|
-
function executeHappensBefore({
|
|
9
|
+
async function executeHappensBefore({ analyzer }, queries) {
|
|
10
10
|
const start = Date.now();
|
|
11
11
|
const results = {};
|
|
12
|
+
const ast = await analyzer.normalize();
|
|
12
13
|
const cfg = (0, extract_cfg_1.extractCfgQuick)(ast);
|
|
13
14
|
for (const query of queries) {
|
|
14
15
|
const { a, b } = query;
|
|
@@ -13,60 +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/text/ansi").OutputFormatter,
|
|
17
|
-
readonly name: "parse";
|
|
18
|
-
readonly humanReadableName: "parse with R shell";
|
|
19
|
-
readonly description: "Parse the given R code into an AST";
|
|
20
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
21
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
22
|
-
readonly printer: {
|
|
23
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
24
|
-
readonly 2: {
|
|
25
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
26
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
27
|
-
};
|
|
28
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
29
|
-
};
|
|
30
|
-
readonly dependencies: readonly [];
|
|
31
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
32
|
-
} | {
|
|
33
|
-
readonly name: "normalize";
|
|
34
|
-
readonly humanReadableName: "normalize";
|
|
35
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
36
|
-
readonly processor: (results: {
|
|
37
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
38
|
-
}, 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>>;
|
|
39
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
40
|
-
readonly printer: {
|
|
41
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
42
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
43
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
44
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
45
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
46
|
-
};
|
|
47
|
-
readonly dependencies: readonly ["parse"];
|
|
48
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
49
|
-
} | {
|
|
50
|
-
readonly humanReadableName: "dataflow";
|
|
51
|
-
readonly processor: (results: {
|
|
52
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
53
|
-
}, input: {
|
|
54
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
55
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
56
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
-
readonly requiredInput: {};
|
|
58
|
-
readonly name: "dataflow";
|
|
59
|
-
readonly description: "Construct the dataflow graph";
|
|
60
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
-
readonly printer: {
|
|
62
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
-
};
|
|
68
|
-
readonly dependencies: readonly ["normalize"];
|
|
69
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
17
|
readonly schema: Joi.ObjectSchema<any>;
|
|
71
18
|
readonly flattenInvolvedNodes: () => never[];
|
|
72
19
|
};
|
|
@@ -10,7 +10,7 @@ const joi_1 = __importDefault(require("joi"));
|
|
|
10
10
|
const happens_before_query_executor_1 = require("./happens-before-query-executor");
|
|
11
11
|
exports.HappensBeforeQueryDefinition = {
|
|
12
12
|
executor: happens_before_query_executor_1.executeHappensBefore,
|
|
13
|
-
asciiSummarizer: (formatter,
|
|
13
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
14
14
|
const out = queryResults;
|
|
15
15
|
result.push(`Query: ${(0, ansi_1.bold)('happens-before', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
16
16
|
for (const [key, value] of Object.entries(out.results)) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IdMapQuery, IdMapQueryResult } from './id-map-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeIdMapQuery({
|
|
3
|
+
export declare function executeIdMapQuery({ analyzer }: BasicQueryData, queries: readonly IdMapQuery[]): Promise<IdMapQueryResult>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeIdMapQuery = executeIdMapQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
-
function executeIdMapQuery({
|
|
5
|
+
async function executeIdMapQuery({ analyzer }, queries) {
|
|
6
6
|
if (queries.length !== 1) {
|
|
7
7
|
log_1.log.warn('Id-Map query expects only up to one query, but got', queries.length);
|
|
8
8
|
}
|
|
@@ -11,7 +11,7 @@ function executeIdMapQuery({ ast }, queries) {
|
|
|
11
11
|
/* there is no sense in measuring a get */
|
|
12
12
|
timing: 0
|
|
13
13
|
},
|
|
14
|
-
idMap:
|
|
14
|
+
idMap: (await analyzer.normalize()).idMap
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=id-map-query-executor.js.map
|
|
@@ -10,60 +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/text/ansi").OutputFormatter,
|
|
14
|
-
readonly name: "parse";
|
|
15
|
-
readonly humanReadableName: "parse with R shell";
|
|
16
|
-
readonly description: "Parse the given R code into an AST";
|
|
17
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
18
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
19
|
-
readonly printer: {
|
|
20
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
21
|
-
readonly 2: {
|
|
22
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
23
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
24
|
-
};
|
|
25
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
26
|
-
};
|
|
27
|
-
readonly dependencies: readonly [];
|
|
28
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
29
|
-
} | {
|
|
30
|
-
readonly name: "normalize";
|
|
31
|
-
readonly humanReadableName: "normalize";
|
|
32
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
33
|
-
readonly processor: (results: {
|
|
34
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
35
|
-
}, 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>>;
|
|
36
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
37
|
-
readonly printer: {
|
|
38
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
39
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
40
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
41
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
42
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
43
|
-
};
|
|
44
|
-
readonly dependencies: readonly ["parse"];
|
|
45
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
46
|
-
} | {
|
|
47
|
-
readonly humanReadableName: "dataflow";
|
|
48
|
-
readonly processor: (results: {
|
|
49
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
50
|
-
}, input: {
|
|
51
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
52
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
53
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
54
|
-
readonly requiredInput: {};
|
|
55
|
-
readonly name: "dataflow";
|
|
56
|
-
readonly description: "Construct the dataflow graph";
|
|
57
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
58
|
-
readonly printer: {
|
|
59
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
60
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
61
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
62
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
63
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
64
|
-
};
|
|
65
|
-
readonly dependencies: readonly ["normalize"];
|
|
66
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
13
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
67
14
|
readonly schema: Joi.ObjectSchema<any>;
|
|
68
15
|
readonly flattenInvolvedNodes: () => never[];
|
|
69
16
|
};
|
|
@@ -11,10 +11,10 @@ const joi_1 = __importDefault(require("joi"));
|
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.IdMapQueryDefinition = {
|
|
13
13
|
executor: id_map_query_executor_1.executeIdMapQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('id-map', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
|
-
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter,
|
|
17
|
+
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, Array.from(out.idMap.keys()))}}`);
|
|
18
18
|
return true;
|
|
19
19
|
},
|
|
20
20
|
schema: joi_1.default.object({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LineageQuery, LineageQueryResult } from './lineage-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeLineageQuery({
|
|
3
|
+
export declare function executeLineageQuery({ analyzer }: BasicQueryData, queries: readonly LineageQuery[]): Promise<LineageQueryResult>;
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeLineageQuery = executeLineageQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
5
|
const repl_lineage_1 = require("../../../cli/repl/commands/repl-lineage");
|
|
6
|
-
function executeLineageQuery({
|
|
6
|
+
async function executeLineageQuery({ analyzer }, queries) {
|
|
7
7
|
const start = Date.now();
|
|
8
8
|
const result = {};
|
|
9
9
|
for (const { criterion } of queries) {
|
|
10
10
|
if (result[criterion]) {
|
|
11
11
|
log_1.log.warn('Duplicate criterion in lineage query:', criterion);
|
|
12
12
|
}
|
|
13
|
-
result[criterion] = (0, repl_lineage_1.getLineage)(criterion, graph,
|
|
13
|
+
result[criterion] = (0, repl_lineage_1.getLineage)(criterion, (await analyzer.dataflow()).graph, (await analyzer.normalize()).idMap);
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
16
16
|
'.meta': {
|
|
@@ -16,60 +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/text/ansi").OutputFormatter,
|
|
20
|
-
readonly name: "parse";
|
|
21
|
-
readonly humanReadableName: "parse with R shell";
|
|
22
|
-
readonly description: "Parse the given R code into an AST";
|
|
23
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
24
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
25
|
-
readonly printer: {
|
|
26
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
27
|
-
readonly 2: {
|
|
28
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
29
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
30
|
-
};
|
|
31
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
32
|
-
};
|
|
33
|
-
readonly dependencies: readonly [];
|
|
34
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
35
|
-
} | {
|
|
36
|
-
readonly name: "normalize";
|
|
37
|
-
readonly humanReadableName: "normalize";
|
|
38
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
39
|
-
readonly processor: (results: {
|
|
40
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
41
|
-
}, 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>>;
|
|
42
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
43
|
-
readonly printer: {
|
|
44
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
45
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
46
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
47
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
48
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
49
|
-
};
|
|
50
|
-
readonly dependencies: readonly ["parse"];
|
|
51
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
52
|
-
} | {
|
|
53
|
-
readonly humanReadableName: "dataflow";
|
|
54
|
-
readonly processor: (results: {
|
|
55
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
56
|
-
}, input: {
|
|
57
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
58
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
59
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
60
|
-
readonly requiredInput: {};
|
|
61
|
-
readonly name: "dataflow";
|
|
62
|
-
readonly description: "Construct the dataflow graph";
|
|
63
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
64
|
-
readonly printer: {
|
|
65
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
66
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
67
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
68
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
69
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
70
|
-
};
|
|
71
|
-
readonly dependencies: readonly ["normalize"];
|
|
72
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
19
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
73
20
|
readonly schema: Joi.ObjectSchema<any>;
|
|
74
21
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
75
22
|
};
|
|
@@ -11,7 +11,7 @@ const lineage_query_executor_1 = require("./lineage-query-executor");
|
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.LineageQueryDefinition = {
|
|
13
13
|
executor: lineage_query_executor_1.executeLineageQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('lineage', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
17
|
for (const [criteria, lineage] of Object.entries(out.lineages)) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BasicQueryData } from '../../base-query-format';
|
|
2
2
|
import type { LinterQuery, LinterQueryResult } from './linter-query-format';
|
|
3
|
-
export declare function executeLinterQuery({
|
|
3
|
+
export declare function executeLinterQuery({ analyzer }: BasicQueryData, queries: readonly LinterQuery[]): Promise<LinterQueryResult>;
|
|
@@ -4,7 +4,7 @@ exports.executeLinterQuery = executeLinterQuery;
|
|
|
4
4
|
const linter_rules_1 = require("../../../linter/linter-rules");
|
|
5
5
|
const log_1 = require("../../../util/log");
|
|
6
6
|
const linter_executor_1 = require("../../../linter/linter-executor");
|
|
7
|
-
function executeLinterQuery({
|
|
7
|
+
async function executeLinterQuery({ analyzer }, queries) {
|
|
8
8
|
const flattened = queries.flatMap(q => q.rules ?? Object.keys(linter_rules_1.LintingRules));
|
|
9
9
|
const distinct = new Set(flattened);
|
|
10
10
|
if (distinct.size !== flattened.length) {
|
|
@@ -13,10 +13,9 @@ function executeLinterQuery({ ast, dataflow, config }, queries) {
|
|
|
13
13
|
}
|
|
14
14
|
const results = { results: {} };
|
|
15
15
|
const start = Date.now();
|
|
16
|
-
const input = { normalize: ast, dataflow, config };
|
|
17
16
|
for (const entry of distinct) {
|
|
18
17
|
const ruleName = typeof entry === 'string' ? entry : entry.name;
|
|
19
|
-
results.results[ruleName] = (0, linter_executor_1.executeLintingRule)(ruleName,
|
|
18
|
+
results.results[ruleName] = await (0, linter_executor_1.executeLintingRule)(ruleName, analyzer, entry?.config);
|
|
20
19
|
}
|
|
21
20
|
return {
|
|
22
21
|
...results,
|