Cleanup CodeQL DBs and output their location for later steps

This commit is contained in:
Edoardo Pirovano 2021-05-24 17:26:13 +01:00 committed by Edoardo Pirovano
parent cbdf0df97b
commit ddb83a462d
12 changed files with 113 additions and 14 deletions

9
lib/analyze.js generated
View file

@ -175,6 +175,15 @@ async function runAnalyze(outputDir, memoryFlag, addSnippetsFlag, threadsFlag, a
return { ...queriesStats };
}
exports.runAnalyze = runAnalyze;
async function runCleanup(config, cleanupLevel, logger) {
logger.info("Cleaning up databases...");
for (const language of config.languages) {
const codeql = codeql_1.getCodeQL(config.codeQLCmd);
const databasePath = util.getCodeQLDatabasePath(config, language);
await codeql.databaseCleanup(databasePath, cleanupLevel);
}
}
exports.runCleanup = runCleanup;
async function injectLinesOfCode(sarifFile, language, locPromise) {
const lineCounts = await locPromise;
const idPrefix = count_loc_1.getIdPrefix(language);