Refactoring: Add getExtractionVerbosityArguments wrapper

This commit is contained in:
Henry Mercer
2024-03-13 18:27:21 +00:00
parent 070b05147a
commit 8da95d81a8
3 changed files with 20 additions and 19 deletions

17
lib/codeql.js generated
View File

@@ -363,9 +363,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"trace-command",
"--index-traceless-dbs",
...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
...(config.debugMode
? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`]
: []),
...getExtractionVerbosityArguments(config.debugMode),
...getExtraOptionsFromEnv(["database", "trace-command"]),
util.getCodeQLDatabasePath(config, language),
]);
@@ -376,9 +374,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"trace-command",
"--use-build-mode",
...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
...(config.debugMode
? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`]
: []),
...getExtractionVerbosityArguments(config.debugMode),
...getExtraOptionsFromEnv(["database", "trace-command"]),
util.getCodeQLDatabasePath(config, language),
]);
@@ -390,9 +386,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--finalize-dataset",
threadsFlag,
memoryFlag,
...(enableDebugLogging
? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`]
: []),
...getExtractionVerbosityArguments(enableDebugLogging),
...getExtraOptionsFromEnv(["database", "finalize"]),
databasePath,
];
@@ -937,4 +931,9 @@ async function getCodeScanningQueryHelpArguments(codeql) {
}
return ["--sarif-add-query-help"];
}
function getExtractionVerbosityArguments(enableDebugLogging) {
return enableDebugLogging
? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`]
: [];
}
//# sourceMappingURL=codeql.js.map