@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
32 lines • 1.54 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CallGraphQueryDefinition = void 0;
const call_graph_query_executor_1 = require("./call-graph-query-executor");
const ansi_1 = require("../../../util/text/ansi");
const time_1 = require("../../../util/text/time");
const joi_1 = __importDefault(require("joi"));
const call_graph_1 = require("../../../dataflow/graph/call-graph");
exports.CallGraphQueryDefinition = {
executor: call_graph_query_executor_1.executeCallGraphQuery,
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
const out = queryResults;
result.push(`Query: ${(0, ansi_1.bold)('call-graph', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
result.push(` ╰ [Call Graph](${call_graph_1.CallGraph.visualize.mermaid.url(out.graph)})`);
return true;
},
schema: joi_1.default.object({
type: joi_1.default.string().valid('call-graph').required().description('The type of the query.'),
}).description('A query to compute the Call Graph of the analyzed project.'),
flattenInvolvedNodes: queryResults => {
const flattened = [];
const out = queryResults;
for (const id of out.graph.idMap?.keys() ?? []) {
flattened.push(id);
}
return flattened;
}
};
//# sourceMappingURL=call-graph-query-format.js.map