databaseRunQueries(): accept a list of flags

This refactoring commit changes databaseRunQueries() to accept a list of
flags instead of separate memory and threads flags.
This commit is contained in:
Chuan-kai Lin 2023-02-14 11:53:52 -08:00
parent e00cd12e3e
commit 3095a09bb0
6 changed files with 13 additions and 17 deletions

View file

@ -212,6 +212,7 @@ export async function runQueries(
const statusReport: QueriesStatusReport = {};
const codeql = await getCodeQL(config.codeQLCmd);
const queryFlags = [memoryFlag, threadsFlag];
await util.logCodeScanningConfigInCli(codeql, featureEnablement, logger);
@ -391,8 +392,7 @@ export async function runQueries(
databasePath,
searchPath,
querySuitePath,
memoryFlag,
threadsFlag
queryFlags
);
logger.debug(`BQRS results produced for ${language} (queries: ${type})"`);
@ -424,8 +424,7 @@ export async function runQueries(
databasePath,
undefined,
querySuitePath,
memoryFlag,
threadsFlag
queryFlags
);
return querySuitePath;

View file

@ -153,8 +153,7 @@ export interface CodeQL {
databasePath: string,
extraSearchPath: string | undefined,
querySuitePath: string | undefined,
memoryFlag: string,
threadsFlag: string
flags: string[]
): Promise<void>;
/**
* Run 'codeql database interpret-results'.
@ -789,14 +788,12 @@ export async function getCodeQLForCmd(
databasePath: string,
extraSearchPath: string | undefined,
querySuitePath: string | undefined,
memoryFlag: string,
threadsFlag: string
flags: string[]
): Promise<void> {
const codeqlArgs = [
"database",
"run-queries",
memoryFlag,
threadsFlag,
...flags,
databasePath,
"--min-disk-free=1024", // Try to leave at least 1GB free
"-v",