@eagleoutice/flowr 2.5.0 → 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 +57 -42
- 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 +1 -1
- 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-normalized-ast-wiki.js +6 -8
- 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 +2 -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/retriever.d.ts +6 -5
- package/r-bridge/retriever.js +9 -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.d.ts +4 -2
- package/util/formats/adapter.js +11 -4
- package/util/version.js +1 -1
|
@@ -13,4 +13,4 @@ export type PromotedLinkTo = Omit<LinkTo, 'callName'> & {
|
|
|
13
13
|
* This happens during the main resolution!
|
|
14
14
|
* 4. Attach `linkTo` calls to the respective calls.
|
|
15
15
|
*/
|
|
16
|
-
export declare function executeCallContextQueries({
|
|
16
|
+
export declare function executeCallContextQueries({ analyzer }: BasicQueryData, queries: readonly CallContextQuery[]): Promise<CallContextQueryResult>;
|
|
@@ -5,7 +5,6 @@ exports.executeCallContextQueries = executeCallContextQueries;
|
|
|
5
5
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
6
6
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
7
|
const edge_1 = require("../../../dataflow/graph/edge");
|
|
8
|
-
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
9
8
|
const two_layer_collector_1 = require("../../two-layer-collector");
|
|
10
9
|
const objects_1 = require("../../../util/objects");
|
|
11
10
|
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
@@ -15,7 +14,7 @@ function isQuoted(node, graph) {
|
|
|
15
14
|
if (vertex === undefined) {
|
|
16
15
|
return false;
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return vertex.values().some(({ types }) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.NonStandardEvaluation));
|
|
19
18
|
}
|
|
20
19
|
function makeReport(collector) {
|
|
21
20
|
const result = {};
|
|
@@ -109,9 +108,10 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
109
108
|
}
|
|
110
109
|
const [info, outgoing] = vertex;
|
|
111
110
|
if (info.tag !== vertex_1.VertexType.FunctionCall) {
|
|
112
|
-
const x =
|
|
111
|
+
const x = outgoing.entries()
|
|
113
112
|
.filter(([, { types }]) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall))
|
|
114
|
-
.map(([t]) => [(0, node_id_1.recoverContent)(t, graph) ?? '', t])
|
|
113
|
+
.map(([t]) => [(0, node_id_1.recoverContent)(t, graph) ?? '', t])
|
|
114
|
+
.toArray();
|
|
115
115
|
/** only follow defined-by and reads */
|
|
116
116
|
queue = queue.concat(x);
|
|
117
117
|
continue;
|
|
@@ -120,7 +120,7 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
120
120
|
if (id !== nodeId) {
|
|
121
121
|
track |= edge_1.EdgeType.Returns;
|
|
122
122
|
}
|
|
123
|
-
const out =
|
|
123
|
+
const out = outgoing.entries()
|
|
124
124
|
.filter(([, e]) => (0, edge_1.edgeIncludesType)(e.types, track) && (nodeId !== id || !(0, edge_1.edgeIncludesType)(e.types, edge_1.EdgeType.Argument)))
|
|
125
125
|
.map(([t]) => t);
|
|
126
126
|
for (const call of out) {
|
|
@@ -173,7 +173,9 @@ function isParameterDefaultValue(nodeId, ast) {
|
|
|
173
173
|
* This happens during the main resolution!
|
|
174
174
|
* 4. Attach `linkTo` calls to the respective calls.
|
|
175
175
|
*/
|
|
176
|
-
function executeCallContextQueries({
|
|
176
|
+
async function executeCallContextQueries({ analyzer }, queries) {
|
|
177
|
+
const dataflow = await analyzer.dataflow();
|
|
178
|
+
const ast = await analyzer.normalize();
|
|
177
179
|
/* omit performance page load */
|
|
178
180
|
const now = Date.now();
|
|
179
181
|
/* the node id and call targets if present */
|
|
@@ -182,10 +184,10 @@ function executeCallContextQueries({ dataflow: { graph }, ast, config }, queries
|
|
|
182
184
|
const { promotedQueries, requiresCfg } = promoteQueryCallNames(queries);
|
|
183
185
|
let cfg = undefined;
|
|
184
186
|
if (requiresCfg) {
|
|
185
|
-
cfg =
|
|
187
|
+
cfg = await analyzer.controlflow([], true);
|
|
186
188
|
}
|
|
187
189
|
const queriesWhichWantAliases = promotedQueries.filter(q => q.includeAliases);
|
|
188
|
-
for (const [nodeId, info] of graph.vertices(true)) {
|
|
190
|
+
for (const [nodeId, info] of dataflow.graph.vertices(true)) {
|
|
189
191
|
if (info.tag !== vertex_1.VertexType.FunctionCall) {
|
|
190
192
|
continue;
|
|
191
193
|
}
|
|
@@ -196,7 +198,7 @@ function executeCallContextQueries({ dataflow: { graph }, ast, config }, queries
|
|
|
196
198
|
* by checking all of these queries would be satisfied otherwise,
|
|
197
199
|
* in general, we first want a call to happen, i.e., trace the called targets of this!
|
|
198
200
|
*/
|
|
199
|
-
const targets = retrieveAllCallAliases(nodeId, graph);
|
|
201
|
+
const targets = retrieveAllCallAliases(nodeId, dataflow.graph);
|
|
200
202
|
for (const [l, ids] of targets.entries()) {
|
|
201
203
|
for (const query of queriesWhichWantAliases) {
|
|
202
204
|
if (query.callName instanceof RegExp ? query.callName.test(l) : query.callName.has(l)) {
|
|
@@ -212,12 +214,12 @@ function executeCallContextQueries({ dataflow: { graph }, ast, config }, queries
|
|
|
212
214
|
}
|
|
213
215
|
let targets = undefined;
|
|
214
216
|
if (query.callTargets) {
|
|
215
|
-
targets = (0, identify_link_to_last_call_relation_1.satisfiesCallTargets)(nodeId, graph, query.callTargets);
|
|
217
|
+
targets = (0, identify_link_to_last_call_relation_1.satisfiesCallTargets)(nodeId, dataflow.graph, query.callTargets);
|
|
216
218
|
if (targets === 'no') {
|
|
217
219
|
continue;
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
|
-
if (isQuoted(nodeId, graph)) {
|
|
222
|
+
if (isQuoted(nodeId, dataflow.graph)) {
|
|
221
223
|
/* if the call is quoted, we do not want to link to it */
|
|
222
224
|
continue;
|
|
223
225
|
}
|
|
@@ -229,7 +231,7 @@ function executeCallContextQueries({ dataflow: { graph }, ast, config }, queries
|
|
|
229
231
|
const linked = Array.isArray(query.linkTo) ? query.linkTo : [query.linkTo];
|
|
230
232
|
for (const link of linked) {
|
|
231
233
|
/* if we have a linkTo query, we have to find the last call */
|
|
232
|
-
const lastCall = (0, identify_link_to_last_call_relation_1.identifyLinkToLastCallRelation)(nodeId, cfg.graph, graph, link);
|
|
234
|
+
const lastCall = (0, identify_link_to_last_call_relation_1.identifyLinkToLastCallRelation)(nodeId, cfg.graph, dataflow.graph, link);
|
|
233
235
|
if (lastCall) {
|
|
234
236
|
linkedIds ??= new Set();
|
|
235
237
|
for (const l of lastCall) {
|
|
@@ -243,7 +245,12 @@ function executeCallContextQueries({ dataflow: { graph }, ast, config }, queries
|
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
|
-
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({
|
|
248
|
+
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({
|
|
249
|
+
id: nodeId,
|
|
250
|
+
name: info.name,
|
|
251
|
+
calls: targets,
|
|
252
|
+
linkedIds: linkedIds ? [...linkedIds] : undefined
|
|
253
|
+
}));
|
|
247
254
|
}
|
|
248
255
|
}
|
|
249
256
|
removeIdenticalDuplicates(initialIdCollector);
|
|
@@ -3,13 +3,12 @@ import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/nod
|
|
|
3
3
|
import { executeCallContextQueries } from './call-context-query-executor';
|
|
4
4
|
import type { OutputFormatter } from '../../../util/text/ansi';
|
|
5
5
|
import Joi from 'joi';
|
|
6
|
-
import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
|
|
7
|
-
import type { DEFAULT_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
|
|
8
6
|
import { CallTargets } from './identify-link-to-last-call-relation';
|
|
9
7
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
10
8
|
import type { DataflowGraphVertexInfo } from '../../../dataflow/graph/vertex';
|
|
11
9
|
import type { CascadeAction } from './cascade-action';
|
|
12
10
|
import type { NoInfo } from '../../../r-bridge/lang-4.x/ast/model/model';
|
|
11
|
+
import type { FlowrAnalysisProvider } from '../../../project/flowr-analyzer';
|
|
13
12
|
export interface FileFilter<FilterType> {
|
|
14
13
|
/**
|
|
15
14
|
* Regex that a node's file attribute must match to be considered
|
|
@@ -109,7 +108,7 @@ export interface CallContextQueryResult extends BaseQueryResult {
|
|
|
109
108
|
export type CallContextQuery<CallName extends CallNameTypes = CallNameTypes, AttachLinkInfo = NoInfo> = DefaultCallContextQueryFormat<CallName> | SubCallContextQueryFormat<CallName, AttachLinkInfo>;
|
|
110
109
|
export declare const CallContextQueryDefinition: {
|
|
111
110
|
readonly executor: typeof executeCallContextQueries;
|
|
112
|
-
readonly asciiSummarizer: (formatter: OutputFormatter,
|
|
111
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
113
112
|
readonly schema: Joi.ObjectSchema<any>;
|
|
114
113
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
115
114
|
};
|
|
@@ -19,10 +19,10 @@ const CallContextQueryLinkTo = joi_1.default.object({
|
|
|
19
19
|
});
|
|
20
20
|
exports.CallContextQueryDefinition = {
|
|
21
21
|
executor: call_context_query_executor_1.executeCallContextQueries,
|
|
22
|
-
asciiSummarizer: (formatter,
|
|
22
|
+
asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
|
|
23
23
|
const out = queryResults;
|
|
24
24
|
result.push(`Query: ${(0, ansi_1.bold)('call-context', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
25
|
-
result.push((0, query_print_1.asciiCallContext)(formatter, out,
|
|
25
|
+
result.push((0, query_print_1.asciiCallContext)(formatter, out, (await analyzer.normalize()).idMap));
|
|
26
26
|
return true;
|
|
27
27
|
},
|
|
28
28
|
schema: joi_1.default.object({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DataflowClusterQuery, DataflowClusterQueryResult } from './cluster-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDataflowClusterQuery({
|
|
3
|
+
export declare function executeDataflowClusterQuery({ analyzer }: BasicQueryData, queries: readonly DataflowClusterQuery[]): Promise<DataflowClusterQueryResult>;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeDataflowClusterQuery = executeDataflowClusterQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
5
|
const cluster_1 = require("../../../dataflow/cluster");
|
|
6
|
-
function executeDataflowClusterQuery({
|
|
6
|
+
async function executeDataflowClusterQuery({ analyzer }, queries) {
|
|
7
7
|
if (queries.length !== 1) {
|
|
8
8
|
log_1.log.warn('The dataflow cluster query expects only up to one query, but got', queries.length);
|
|
9
9
|
}
|
|
10
10
|
const start = Date.now();
|
|
11
|
-
const clusters = (0, cluster_1.findAllClusters)(graph);
|
|
11
|
+
const clusters = (0, cluster_1.findAllClusters)((await analyzer.dataflow()).graph);
|
|
12
12
|
return {
|
|
13
13
|
'.meta': {
|
|
14
14
|
timing: Date.now() - start
|
|
@@ -15,60 +15,7 @@ export interface DataflowClusterQueryResult extends BaseQueryResult {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const ClusterQueryDefinition: {
|
|
17
17
|
readonly executor: typeof executeDataflowClusterQuery;
|
|
18
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
19
|
-
readonly name: "parse";
|
|
20
|
-
readonly humanReadableName: "parse with R shell";
|
|
21
|
-
readonly description: "Parse the given R code into an AST";
|
|
22
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
23
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
24
|
-
readonly printer: {
|
|
25
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
26
|
-
readonly 2: {
|
|
27
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
28
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
29
|
-
};
|
|
30
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
31
|
-
};
|
|
32
|
-
readonly dependencies: readonly [];
|
|
33
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
34
|
-
} | {
|
|
35
|
-
readonly name: "normalize";
|
|
36
|
-
readonly humanReadableName: "normalize";
|
|
37
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
38
|
-
readonly processor: (results: {
|
|
39
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
40
|
-
}, 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>>;
|
|
41
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
42
|
-
readonly printer: {
|
|
43
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
44
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
45
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
46
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
47
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
48
|
-
};
|
|
49
|
-
readonly dependencies: readonly ["parse"];
|
|
50
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
51
|
-
} | {
|
|
52
|
-
readonly humanReadableName: "dataflow";
|
|
53
|
-
readonly processor: (results: {
|
|
54
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
55
|
-
}, input: {
|
|
56
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
57
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
58
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
59
|
-
readonly requiredInput: {};
|
|
60
|
-
readonly name: "dataflow";
|
|
61
|
-
readonly description: "Construct the dataflow graph";
|
|
62
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
63
|
-
readonly printer: {
|
|
64
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
65
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
66
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
67
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
68
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
69
|
-
};
|
|
70
|
-
readonly dependencies: readonly ["normalize"];
|
|
71
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
18
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
72
19
|
readonly schema: Joi.ObjectSchema<any>;
|
|
73
20
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
74
21
|
};
|
|
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
|
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.ClusterQueryDefinition = {
|
|
13
13
|
executor: cluster_query_executor_1.executeDataflowClusterQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('dataflow-cluster', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
|
|
17
17
|
result.push(` ╰ Found ${out.clusters.length} cluster${out.clusters.length === 1 ? '' : 's'}`);
|
|
@@ -19,7 +19,7 @@ exports.ClusterQueryDefinition = {
|
|
|
19
19
|
const unknownSideEffects = cluster.hasUnknownSideEffects ? '(has unknown side effect)' : '';
|
|
20
20
|
let suffix = '';
|
|
21
21
|
if (formatter === ansi_1.markdownFormatter) {
|
|
22
|
-
suffix = `([marked](${(0, dfg_1.graphToMermaidUrl)(
|
|
22
|
+
suffix = `([marked](${(0, dfg_1.graphToMermaidUrl)((await analyzer.dataflow()).graph, false, new Set(cluster.members))}))`;
|
|
23
23
|
}
|
|
24
24
|
result.push(` ╰ ${unknownSideEffects} {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, cluster.members)}} ${suffix}`);
|
|
25
25
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ConfigQuery, ConfigQueryResult } from './config-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeConfigQuery({
|
|
3
|
+
export declare function executeConfigQuery({ analyzer }: BasicQueryData, queries: readonly ConfigQuery[]): Promise<ConfigQueryResult>;
|
|
@@ -4,20 +4,20 @@ exports.executeConfigQuery = executeConfigQuery;
|
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
5
|
const assert_1 = require("../../../util/assert");
|
|
6
6
|
const objects_1 = require("../../../util/objects");
|
|
7
|
-
function executeConfigQuery({
|
|
7
|
+
function executeConfigQuery({ analyzer }, queries) {
|
|
8
8
|
if (queries.length !== 1) {
|
|
9
9
|
log_1.log.warn('Config query usually expects only up to one query, but got', queries.length);
|
|
10
10
|
}
|
|
11
11
|
const updates = queries.map(q => q.update).filter(assert_1.isNotUndefined);
|
|
12
12
|
for (const update of updates) {
|
|
13
|
-
(0, objects_1.deepMergeObjectInPlace)(
|
|
13
|
+
(0, objects_1.deepMergeObjectInPlace)(analyzer.flowrConfig, update);
|
|
14
14
|
}
|
|
15
|
-
return {
|
|
15
|
+
return Promise.resolve({
|
|
16
16
|
'.meta': {
|
|
17
17
|
/* there is no sense in measuring a get */
|
|
18
18
|
timing: 0
|
|
19
19
|
},
|
|
20
|
-
config:
|
|
21
|
-
};
|
|
20
|
+
config: analyzer.flowrConfig
|
|
21
|
+
});
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=config-query-executor.js.map
|
|
@@ -15,7 +15,7 @@ declare function configReplCompleter(partialLine: readonly string[], config: Flo
|
|
|
15
15
|
declare function configQueryLineParser(line: readonly string[], _config: FlowrConfigOptions): [ConfigQuery];
|
|
16
16
|
export declare const ConfigQueryDefinition: {
|
|
17
17
|
readonly executor: typeof executeConfigQuery;
|
|
18
|
-
readonly asciiSummarizer: (formatter: OutputFormatter,
|
|
18
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
19
19
|
readonly completer: typeof configReplCompleter;
|
|
20
20
|
readonly fromLine: typeof configQueryLineParser;
|
|
21
21
|
readonly schema: Joi.ObjectSchema<any>;
|
|
@@ -79,7 +79,7 @@ function configQueryLineParser(line, _config) {
|
|
|
79
79
|
}
|
|
80
80
|
exports.ConfigQueryDefinition = {
|
|
81
81
|
executor: config_query_executor_1.executeConfigQuery,
|
|
82
|
-
asciiSummarizer: (formatter,
|
|
82
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
83
83
|
const out = queryResults;
|
|
84
84
|
result.push(`Query: ${(0, ansi_1.bold)('config', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
85
85
|
result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ControlFlowQuery, ControlFlowQueryResult } from './control-flow-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeControlFlowQuery({
|
|
3
|
+
export declare function executeControlFlowQuery({ analyzer }: BasicQueryData, queries: readonly ControlFlowQuery[]): Promise<ControlFlowQueryResult>;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeControlFlowQuery = executeControlFlowQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
-
|
|
6
|
-
function executeControlFlowQuery({ dataflow: { graph }, ast, config }, queries) {
|
|
5
|
+
async function executeControlFlowQuery({ analyzer }, queries) {
|
|
7
6
|
if (queries.length !== 1) {
|
|
8
7
|
log_1.log.warn('The control flow query expects only up to one query, but got', queries.length);
|
|
9
8
|
}
|
|
10
9
|
const query = queries[0];
|
|
11
10
|
const start = Date.now();
|
|
12
|
-
const controlFlow =
|
|
11
|
+
const controlFlow = await analyzer.controlflow(query.config?.simplificationPasses, true);
|
|
13
12
|
return {
|
|
14
13
|
'.meta': {
|
|
15
14
|
timing: Date.now() - start
|
|
@@ -22,60 +22,7 @@ export interface ControlFlowQueryResult extends BaseQueryResult {
|
|
|
22
22
|
}
|
|
23
23
|
export declare const ControlFlowQueryDefinition: {
|
|
24
24
|
readonly executor: typeof executeControlFlowQuery;
|
|
25
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
26
|
-
readonly name: "parse";
|
|
27
|
-
readonly humanReadableName: "parse with R shell";
|
|
28
|
-
readonly description: "Parse the given R code into an AST";
|
|
29
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
30
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
31
|
-
readonly printer: {
|
|
32
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
33
|
-
readonly 2: {
|
|
34
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
35
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
36
|
-
};
|
|
37
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
38
|
-
};
|
|
39
|
-
readonly dependencies: readonly [];
|
|
40
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
41
|
-
} | {
|
|
42
|
-
readonly name: "normalize";
|
|
43
|
-
readonly humanReadableName: "normalize";
|
|
44
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
45
|
-
readonly processor: (results: {
|
|
46
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
47
|
-
}, 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>>;
|
|
48
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
49
|
-
readonly printer: {
|
|
50
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
51
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
52
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
53
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
54
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
55
|
-
};
|
|
56
|
-
readonly dependencies: readonly ["parse"];
|
|
57
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
58
|
-
} | {
|
|
59
|
-
readonly humanReadableName: "dataflow";
|
|
60
|
-
readonly processor: (results: {
|
|
61
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
62
|
-
}, input: {
|
|
63
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
64
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
65
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
66
|
-
readonly requiredInput: {};
|
|
67
|
-
readonly name: "dataflow";
|
|
68
|
-
readonly description: "Construct the dataflow graph";
|
|
69
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
70
|
-
readonly printer: {
|
|
71
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
72
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
73
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
74
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
75
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
76
|
-
};
|
|
77
|
-
readonly dependencies: readonly ["normalize"];
|
|
78
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
25
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
79
26
|
readonly schema: Joi.ObjectSchema<any>;
|
|
80
27
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
81
28
|
};
|
|
@@ -12,10 +12,10 @@ const cfg_1 = require("../../../util/mermaid/cfg");
|
|
|
12
12
|
const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
|
|
13
13
|
exports.ControlFlowQueryDefinition = {
|
|
14
14
|
executor: control_flow_query_executor_1.executeControlFlowQuery,
|
|
15
|
-
asciiSummarizer: (formatter,
|
|
15
|
+
asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
|
|
16
16
|
const out = queryResults;
|
|
17
17
|
result.push(`Query: ${(0, ansi_1.bold)('control-flow', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
|
|
18
|
-
result.push(` ╰ CFG: ${(0, cfg_1.cfgToMermaidUrl)(out.controlFlow,
|
|
18
|
+
result.push(` ╰ CFG: ${(0, cfg_1.cfgToMermaidUrl)(out.controlFlow, await analyzer.normalize())}`);
|
|
19
19
|
return true;
|
|
20
20
|
},
|
|
21
21
|
schema: joi_1.default.object({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DataflowLensQuery, DataflowLensQueryResult } from './dataflow-lens-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDataflowLensQuery({
|
|
3
|
+
export declare function executeDataflowLensQuery({ analyzer }: BasicQueryData, queries: readonly DataflowLensQuery[]): Promise<DataflowLensQueryResult>;
|
|
@@ -4,12 +4,12 @@ exports.executeDataflowLensQuery = executeDataflowLensQuery;
|
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
5
|
const dfg_view_1 = require("../../../util/simple-df/dfg-view");
|
|
6
6
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
|
-
function executeDataflowLensQuery({
|
|
7
|
+
async function executeDataflowLensQuery({ analyzer }, queries) {
|
|
8
8
|
if (queries.length !== 1) {
|
|
9
9
|
log_1.log.warn('Dataflow query expects only up to one query, but got', queries.length);
|
|
10
10
|
}
|
|
11
11
|
const now = Date.now();
|
|
12
|
-
const simplifiedGraph = (0, dfg_view_1.reduceDfg)(graph, {
|
|
12
|
+
const simplifiedGraph = (0, dfg_view_1.reduceDfg)((await analyzer.dataflow()).graph, {
|
|
13
13
|
vertices: {
|
|
14
14
|
keepEnv: false,
|
|
15
15
|
keepCd: true,
|
|
@@ -14,60 +14,7 @@ export interface DataflowLensQueryResult extends BaseQueryResult {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const DataflowLensQueryDefinition: {
|
|
16
16
|
readonly executor: typeof executeDataflowLensQuery;
|
|
17
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
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
|
-
}, config: import("../../../config").FlowrConfigOptions) => 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;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
71
18
|
readonly schema: Joi.ObjectSchema<any>;
|
|
72
19
|
readonly flattenInvolvedNodes: () => never[];
|
|
73
20
|
};
|
|
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
|
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.DataflowLensQueryDefinition = {
|
|
13
13
|
executor: dataflow_lens_query_executor_1.executeDataflowLensQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('dataflow-lens', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
17
|
result.push(` ╰ [Simplified Graph](${(0, dfg_1.graphToMermaidUrl)(out.simplifiedGraph, false, undefined, true)})`);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DataflowQuery, DataflowQueryResult } from './dataflow-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDataflowQuery({
|
|
3
|
+
export declare function executeDataflowQuery({ analyzer }: BasicQueryData, queries: readonly DataflowQuery[]): Promise<DataflowQueryResult>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDataflowQuery = executeDataflowQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
-
function executeDataflowQuery({
|
|
5
|
+
async function executeDataflowQuery({ analyzer }, queries) {
|
|
6
6
|
if (queries.length !== 1) {
|
|
7
7
|
log_1.log.warn('Dataflow query expects only up to one query, but got', queries.length);
|
|
8
8
|
}
|
|
@@ -11,7 +11,7 @@ function executeDataflowQuery({ dataflow: { graph } }, queries) {
|
|
|
11
11
|
/* there is no sense in measuring a get */
|
|
12
12
|
timing: 0
|
|
13
13
|
},
|
|
14
|
-
graph
|
|
14
|
+
graph: (await analyzer.dataflow()).graph
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=dataflow-query-executor.js.map
|
|
@@ -15,60 +15,7 @@ export interface DataflowQueryResult extends BaseQueryResult {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const DataflowQueryDefinition: {
|
|
17
17
|
readonly executor: typeof executeDataflowQuery;
|
|
18
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
19
|
-
readonly name: "parse";
|
|
20
|
-
readonly humanReadableName: "parse with R shell";
|
|
21
|
-
readonly description: "Parse the given R code into an AST";
|
|
22
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
23
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
24
|
-
readonly printer: {
|
|
25
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
26
|
-
readonly 2: {
|
|
27
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
28
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
29
|
-
};
|
|
30
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
31
|
-
};
|
|
32
|
-
readonly dependencies: readonly [];
|
|
33
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
34
|
-
} | {
|
|
35
|
-
readonly name: "normalize";
|
|
36
|
-
readonly humanReadableName: "normalize";
|
|
37
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
38
|
-
readonly processor: (results: {
|
|
39
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
40
|
-
}, 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>>;
|
|
41
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
42
|
-
readonly printer: {
|
|
43
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
44
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
45
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
46
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
47
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
48
|
-
};
|
|
49
|
-
readonly dependencies: readonly ["parse"];
|
|
50
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
51
|
-
} | {
|
|
52
|
-
readonly humanReadableName: "dataflow";
|
|
53
|
-
readonly processor: (results: {
|
|
54
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
55
|
-
}, input: {
|
|
56
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
57
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
58
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
59
|
-
readonly requiredInput: {};
|
|
60
|
-
readonly name: "dataflow";
|
|
61
|
-
readonly description: "Construct the dataflow graph";
|
|
62
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
63
|
-
readonly printer: {
|
|
64
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
65
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
66
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
67
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
68
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
69
|
-
};
|
|
70
|
-
readonly dependencies: readonly ["normalize"];
|
|
71
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
18
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
72
19
|
readonly schema: Joi.ObjectSchema<any>;
|
|
73
20
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
74
21
|
};
|