Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@
"description": "Path to the CodeQL CLI executable",
"scope": "application"
},
"codeql-scanner.codeqlQueryPackPath": {
"type": "string",
"default": "",
"description": "Path to where the CodeQL query packs are stored",
"scope": "application"
},
"codeql-scanner.autoDetectGitHubExtension": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -284,4 +290,4 @@
"axios": "^1.3.4",
"js-yaml": "^4.1.0"
}
}
}
16 changes: 10 additions & 6 deletions src/services/codeqlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export class CodeQLService {
addedLanguages.add(lang);
continue;
}

//TODO: If language detected is typescript, map it to javascript
// Check if it's an alias for a CodeQL language
for (const [codeqlLang, aliases] of Object.entries(this.languages)) {
if (aliases.includes(lang) && !addedLanguages.has(codeqlLang)) {
Expand Down Expand Up @@ -469,9 +469,8 @@ export class CodeQLService {
}

progress.report({
message: `Waiting for analysis (${
recentAnalysis?.status || "pending"
})...`,
message: `Waiting for analysis (${recentAnalysis?.status || "pending"
})...`,
});
} catch (error) {
// Continue waiting even if there's an error
Expand Down Expand Up @@ -958,8 +957,13 @@ export class CodeQLService {
}

private findQueryPack(language: string): string | undefined {
const config = vscode.workspace.getConfiguration("codeql-scanner")
const codeqlDir = this.getCodeQLDirectory();
const queryPackPath = path.join(codeqlDir, "packages");
const queryPackPath = config.get<string>(
"codeqlQueryPackPath",
path.join(codeqlDir, "packages")
);
// const queryPackPath = path.join(codeqlDir, "packages");

// List all directories in the packages folder
if (!fs.existsSync(queryPackPath)) {
Expand Down Expand Up @@ -1096,7 +1100,7 @@ export class CodeQLService {
else if (parseLevel >= 5.0) return "medium";
else if (parseLevel >= 3.0) return "low";
else return "info";
} catch (error) {}
} catch (error) { }

// Check if the level is a float
switch (level?.toLowerCase()) {
Expand Down