@eagleoutice/flowr 2.1.8 → 2.1.9
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/benchmark/summarizer/first-phase/process.js +6 -5
- package/cli/repl/commands/repl-dataflow.js +5 -2
- package/cli/repl/commands/repl-normalize.js +5 -2
- package/cli/repl/commands/repl-query.js +2 -2
- package/cli/repl/server/messages/message-query.js +1 -1
- package/dataflow/environments/default-builtin-config.js +45 -6
- package/dataflow/environments/environment.d.ts +46 -8
- package/dataflow/environments/environment.js +24 -1
- package/dataflow/environments/identifier.d.ts +49 -7
- package/dataflow/environments/identifier.js +11 -2
- package/dataflow/extractor.js +5 -4
- package/dataflow/graph/dataflowgraph-builder.d.ts +6 -0
- package/dataflow/graph/dataflowgraph-builder.js +8 -0
- package/dataflow/graph/edge.d.ts +10 -4
- package/dataflow/graph/edge.js +12 -5
- package/dataflow/graph/graph.d.ts +41 -3
- package/dataflow/graph/graph.js +39 -34
- package/dataflow/graph/vertex.d.ts +66 -7
- package/dataflow/graph/vertex.js +15 -0
- package/dataflow/info.d.ts +79 -11
- package/dataflow/info.js +20 -0
- package/dataflow/internal/linker.d.ts +4 -2
- package/dataflow/internal/linker.js +12 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +5 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +16 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +83 -6
- package/dataflow/internal/process/functions/call/common.js +1 -1
- package/documentation/doc-util/doc-dfg.d.ts +0 -1
- package/documentation/doc-util/doc-dfg.js +1 -14
- package/documentation/print-capabilities-markdown.js +1 -1
- package/documentation/print-dataflow-graph-wiki.js +26 -7
- package/documentation/print-linting-and-testing-wiki.js +60 -26
- package/documentation/print-query-wiki.js +1 -1
- package/package.json +17 -3
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +13 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +3 -1
- package/queries/catalog/call-context-query/cascade-action.d.ts +8 -0
- package/queries/catalog/call-context-query/cascade-action.js +13 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +11 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +41 -4
- package/queries/catalog/dependencies-query/dependencies-query-format.js +4 -0
- package/queries/query.d.ts +4 -4
- package/queries/query.js +17 -5
- package/r-bridge/lang-4.x/ast/model/model.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +5 -1
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +6 -1
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +6 -1
- package/slicing/static/slice-call.d.ts +7 -2
- package/slicing/static/slice-call.js +33 -44
- package/slicing/static/static-slicer.d.ts +5 -1
- package/slicing/static/static-slicer.js +22 -8
- package/slicing/static/visiting-queue.d.ts +4 -4
- package/slicing/static/visiting-queue.js +5 -3
- package/statistics/output/print-stats.js +2 -1
- package/statistics/summarizer/post-process/histogram.js +2 -1
- package/statistics/summarizer/post-process/post-process-output.js +2 -1
- package/statistics/summarizer/second-phase/process.js +3 -3
- package/util/arrays.d.ts +1 -1
- package/util/arrays.js +3 -3
- package/util/cfg/cfg.js +4 -2
- package/util/mermaid/cfg.js +1 -1
- package/util/summarizer.js +2 -2
- package/util/version.js +1 -1
|
@@ -14,6 +14,7 @@ const ansi_1 = require("../../../util/ansi");
|
|
|
14
14
|
const feature_1 = require("../../features/feature");
|
|
15
15
|
const decorate_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/decorate");
|
|
16
16
|
const file_provider_1 = require("../../output/file-provider");
|
|
17
|
+
const arrays_1 = require("../../../util/arrays");
|
|
17
18
|
/**
|
|
18
19
|
* Post process the collections in a given folder, reducing them in a memory preserving way.
|
|
19
20
|
*
|
|
@@ -79,7 +80,7 @@ function printClusterReport(report, limit = 1000) {
|
|
|
79
80
|
const shortStats = [...report.valueInfoMap.entries()].map(([name, values]) => {
|
|
80
81
|
return {
|
|
81
82
|
name,
|
|
82
|
-
count: [...values.values()]
|
|
83
|
+
count: (0, arrays_1.arraySum)([...values.values()]),
|
|
83
84
|
unique: values.size()
|
|
84
85
|
};
|
|
85
86
|
}).sort((a, b) => b.count - a.count).slice(0, limit);
|
|
@@ -50,7 +50,7 @@ function postProcessMeta(config, filepath, outputPath, logger, metaFeatureInform
|
|
|
50
50
|
out.write(`file,successfulParsed,${(0, summarizer_1.summarizedMeasurement2CsvHeader)('processing')},failedRequests,${(0, summarizer_1.summarizedMeasurement2CsvHeader)('line-length')},${(0, summarizer_1.summarizedMeasurement2CsvHeader)('lines')},${(0, summarizer_1.summarizedMeasurement2CsvHeader)('characters')},numberOfNormalizedNodes\n`);
|
|
51
51
|
for (const [file, info] of metaFeatureInformation) {
|
|
52
52
|
// we could retrieve these by summing later as well :thinking: however, this makes it more explicit
|
|
53
|
-
const characters = (0, arrays_1.
|
|
53
|
+
const characters = (0, arrays_1.arraySum)(info.stats.lines[0]);
|
|
54
54
|
out.write(`${JSON.stringify(file)},${info.stats.successfulParsed},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)(info.stats.processingTimeMs))},`
|
|
55
55
|
+ `${info.stats.failedRequests.length},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)(info.stats.lines[0]))},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)([info.stats.lines[0].length]))},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)([characters]))},${info.stats.numberOfNormalizedNodes[0]}\n`);
|
|
56
56
|
fileStatisticsSummary.successfulParsed.push(info.stats.successfulParsed);
|
|
@@ -60,8 +60,8 @@ function postProcessMeta(config, filepath, outputPath, logger, metaFeatureInform
|
|
|
60
60
|
fileStatisticsSummary.characters.push(characters);
|
|
61
61
|
fileStatisticsSummary.numberOfNormalizedNodes.push(info.stats.numberOfNormalizedNodes[0]);
|
|
62
62
|
}
|
|
63
|
-
out.write(`all,${(0, arrays_1.
|
|
64
|
-
+ `${(0, arrays_1.
|
|
63
|
+
out.write(`all,${(0, arrays_1.arraySum)(fileStatisticsSummary.successfulParsed)},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)(fileStatisticsSummary.processingTimeMs))},`
|
|
64
|
+
+ `${(0, arrays_1.arraySum)(fileStatisticsSummary.failedRequests)},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)(fileStatisticsSummary.lines.flat()))},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)(fileStatisticsSummary.lines.map(l => l.length)))},${(0, summarizer_1.summarizedMeasurement2Csv)((0, summarizer_1.summarizeMeasurement)(fileStatisticsSummary.characters))},${(0, arrays_1.arraySum)(fileStatisticsSummary.numberOfNormalizedNodes)}\n`);
|
|
65
65
|
out.close();
|
|
66
66
|
}
|
|
67
67
|
/**
|
package/util/arrays.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare function getUniqueCombinationsOfSize<T>(array: T[], minSize?: num
|
|
|
46
46
|
/**
|
|
47
47
|
* Returns the sum of all elements in the given array
|
|
48
48
|
*/
|
|
49
|
-
export declare function
|
|
49
|
+
export declare function arraySum(arr: readonly number[]): number;
|
|
50
50
|
/**
|
|
51
51
|
* Converts an array into a bag data-structure (in the form of a map mapping the entries/keys to their counts)
|
|
52
52
|
*/
|
package/util/arrays.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.partitionArray = partitionArray;
|
|
|
5
5
|
exports.allPermutations = allPermutations;
|
|
6
6
|
exports.partition = partition;
|
|
7
7
|
exports.getUniqueCombinationsOfSize = getUniqueCombinationsOfSize;
|
|
8
|
-
exports.
|
|
8
|
+
exports.arraySum = arraySum;
|
|
9
9
|
exports.array2bag = array2bag;
|
|
10
10
|
exports.arrayEqual = arrayEqual;
|
|
11
11
|
const assert_1 = require("./assert");
|
|
@@ -143,7 +143,7 @@ function* getUniqueCombinationsOfSize(array, minSize = 0, maxSize = array.length
|
|
|
143
143
|
/**
|
|
144
144
|
* Returns the sum of all elements in the given array
|
|
145
145
|
*/
|
|
146
|
-
function
|
|
146
|
+
function arraySum(arr) {
|
|
147
147
|
let sum = 0;
|
|
148
148
|
for (const elem of arr) {
|
|
149
149
|
sum += elem;
|
|
@@ -167,7 +167,7 @@ function arrayEqual(a, b) {
|
|
|
167
167
|
if (a.length !== b.length) {
|
|
168
168
|
return false;
|
|
169
169
|
}
|
|
170
|
-
for (let i = 0; i < a.length; ++
|
|
170
|
+
for (let i = 0; i < a.length; i++) {
|
|
171
171
|
if (a[i] !== b[i]) {
|
|
172
172
|
return false;
|
|
173
173
|
}
|
package/util/cfg/cfg.js
CHANGED
|
@@ -381,9 +381,11 @@ function cfgAccess(access, name, accessors) {
|
|
|
381
381
|
}
|
|
382
382
|
function cfgUnaryOp(unary, operand) {
|
|
383
383
|
const graph = operand.graph;
|
|
384
|
-
const result = { ...operand, graph, exitPoints: [unary.info.id] };
|
|
385
384
|
graph.addVertex({ id: unary.info.id, name: unary.type, type: "end-marker" /* CfgVertexType.EndMarker */ });
|
|
386
|
-
|
|
385
|
+
for (const entry of operand.exitPoints) {
|
|
386
|
+
graph.addEdge(unary.info.id, entry, { label: 'FD' });
|
|
387
|
+
}
|
|
388
|
+
return { ...operand, graph, exitPoints: [unary.info.id] };
|
|
387
389
|
}
|
|
388
390
|
function cfgExprList(_node, _grouping, expressions) {
|
|
389
391
|
const result = { graph: new ControlFlowGraph(), breaks: [], nexts: [], returns: [], exitPoints: [], entryPoints: [] };
|
package/util/mermaid/cfg.js
CHANGED
|
@@ -16,7 +16,7 @@ function cfgToMermaid(cfg, normalizedAst, prefix = '') {
|
|
|
16
16
|
output += ` n${id}[${name}]\n`;
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
output += ` n${id}((
|
|
19
|
+
output += String(id).endsWith('-exit') ? ` n${id}((${id}))\n` : ` n${id}[[${id}]]\n`;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
for (const [from, targets] of cfg.graph.edges()) {
|
package/util/summarizer.js
CHANGED
|
@@ -27,11 +27,11 @@ function summarizeMeasurement(data, totalNumberOfDataPoints) {
|
|
|
27
27
|
const min = sorted[0];
|
|
28
28
|
const max = sorted[sorted.length - 1];
|
|
29
29
|
const median = sorted[Math.floor(sorted.length / 2)];
|
|
30
|
-
const total = (0, arrays_1.
|
|
30
|
+
const total = (0, arrays_1.arraySum)(sorted);
|
|
31
31
|
const length = totalNumberOfDataPoints ?? sorted.length;
|
|
32
32
|
const mean = total / length;
|
|
33
33
|
// sqrt(sum(x-mean)^2 / n)
|
|
34
|
-
const std = Math.sqrt(sorted.map(x => (x - mean) ** 2)
|
|
34
|
+
const std = Math.sqrt((0, arrays_1.arraySum)(sorted.map(x => (x - mean) ** 2)) / length);
|
|
35
35
|
return { min, max, median, mean, std, total };
|
|
36
36
|
}
|
|
37
37
|
//# sourceMappingURL=summarizer.js.map
|
package/util/version.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.flowrVersion = flowrVersion;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
// this is automatically replaced with the current version by release-it
|
|
6
|
-
const version = '2.1.
|
|
6
|
+
const version = '2.1.9';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|