Add messy debug statements

This commit is contained in:
Andrew Eisenberg
2021-05-11 11:03:34 -07:00
parent a19f1a7b3c
commit f1d500967a
4 changed files with 41 additions and 15 deletions

19
lib/analyze.js generated
View File

@@ -103,12 +103,18 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
allSarifFiles.push(sarifFile);
}
}
logger.info("111111111");
logger.info("About to start LoC");
logger.info("111111111");
if (allSarifFiles.length > 0) {
const linesOfCode = await count_loc_1.countLoc(path.resolve(),
// config.paths specifies external directories. the current
// directory is included in the analysis by default. Replicate
// that here.
config.paths, config.pathsIgnore, config.languages, logger);
logger.info("22222222");
logger.info("Finished LoC");
logger.info("22222222");
for (const sarifFile of allSarifFiles) {
injectLinesOfCode(sarifFile, language, linesOfCode);
}
@@ -138,8 +144,17 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
fs.writeFileSync(querySuitePath, querySuiteContents);
logger.debug(`Query suite file for ${language}...\n${querySuiteContents}`);
const sarifFile = path.join(destinationFolder, `${language}-${type}.sarif`);
const codeql = codeql_1.getCodeQL(config.codeQLCmd);
await codeql.databaseAnalyze(databasePath, sarifFile, searchPath, querySuitePath, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId);
// const codeql = getCodeQL(config.codeQLCmd);
// await codeql.databaseAnalyze(
// databasePath,
// sarifFile,
// searchPath,
// querySuitePath,
// memoryFlag,
// addSnippetsFlag,
// threadsFlag,
// automationDetailsId
// );
logger.debug(`SARIF results for database ${language} created at "${sarifFile}"`);
logger.endGroup();
return sarifFile;

File diff suppressed because one or more lines are too long

View File

@@ -154,10 +154,13 @@ class LocDir {
ignore: this.exclude,
nodir: true
});
console.log(`Excluding: ${this.exclude}`);
const files = [];
const info = { ...defaultInfo };
let languages = {};
await Promise.all(paths.map(async (pathItem) => {
console.log(`Processing ${pathItem}`);
const fullPath = slash2_1.default(path_1.default.join(this.cwd, pathItem));
if (!pathItem ||
this.ignoreLanguage(pathItem) ||
@@ -205,4 +208,4 @@ function ensureArray(arr, dfault) {
? arr
: [arr];
}
//# sourceMappingURL=directory.js.map
//# sourceMappingURL=directory.js.map

View File

@@ -190,6 +190,10 @@ export async function runQueries(
}
}
logger.info("111111111");
logger.info("About to start LoC");
logger.info("111111111");
if (allSarifFiles.length > 0) {
const linesOfCode = await countLoc(
path.resolve(),
@@ -202,6 +206,10 @@ export async function runQueries(
logger
);
logger.info("22222222");
logger.info("Finished LoC");
logger.info("22222222");
for (const sarifFile of allSarifFiles) {
injectLinesOfCode(sarifFile, language, linesOfCode);
}
@@ -245,17 +253,17 @@ export async function runQueries(
const sarifFile = path.join(destinationFolder, `${language}-${type}.sarif`);
const codeql = getCodeQL(config.codeQLCmd);
await codeql.databaseAnalyze(
databasePath,
sarifFile,
searchPath,
querySuitePath,
memoryFlag,
addSnippetsFlag,
threadsFlag,
automationDetailsId
);
// const codeql = getCodeQL(config.codeQLCmd);
// await codeql.databaseAnalyze(
// databasePath,
// sarifFile,
// searchPath,
// querySuitePath,
// memoryFlag,
// addSnippetsFlag,
// threadsFlag,
// automationDetailsId
// );
logger.debug(
`SARIF results for database ${language} created at "${sarifFile}"`