Skip to content
Open
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
4 changes: 0 additions & 4 deletions media/riskManagement.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ button:hover {
filter: brightness(1.5);
}

.disabled-result {
cursor: not-allowed;
}

svg {
vertical-align: text-top;
color: var(--cx-main-color);
Expand Down
17 changes: 3 additions & 14 deletions media/riskManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,28 +400,17 @@
return results.results.map((result) => {
const matchedScore = getMatchedScore(result, app.applicationID);

const isNA =
result.engine.toLowerCase() === "sca" ||
result.engine.toLowerCase() === "kics";
const tooltip = isNA
? 'title="Coming soon..." data-bs-toggle="tooltip" data-bs-placement="top"'
: "";

const resultElement = createResultElement(
result,
matchedScore,
isNA,
tooltip
);

if (!isNA) {
resultElement.addEventListener("click", () => {
vscode.postMessage({
command: "openVulnerabilityDetails",
result: result,
});
});
}

return resultElement;
});
Expand All @@ -434,9 +423,9 @@
return matchedScore || result.riskScore;
}

function createResultElement(result, score, isSCA, tooltip) {
function createResultElement(result, score) {
const resultElement = document.createElement("div");
resultElement.className = `result${isSCA ? " disabled-result" : ""}`;
resultElement.className = "result";

score = formatScore(score);

Expand All @@ -445,7 +434,7 @@
<span>${icons[result.severity]}</span>
<span>${score}</span>
</span>
<span class="ellipsis" ${isSCA ? tooltip : ""}> ${
<span class="ellipsis"> ${
result.name
}</span>
`;
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@
"@popperjs/core": "^2.11.8",
"@vscode/codicons": "^0.0.36",
"axios": "^1.8.3",
"@checkmarxdev/ast-cli-javascript-wrapper": "0.0.129",
"@checkmarxdev/ast-cli-javascript-wrapper": "0.0.130",
"copyfiles": "2.4.1",
"dotenv": "^16.4.7",
"eslint-config-prettier": "^9.1.0",
Expand Down
2 changes: 2 additions & 0 deletions src/commands/webViewCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import * as os from "os";
import { GptResult } from "../models/gptResult";
import { cx } from "../cx";

const SYSTEM_NOT_FIND_PATH_ERROR = "The system cannot find the path specified.";

export class WebViewCommand {
private thinkID: number;
context: vscode.ExtensionContext;
Expand Down
2 changes: 2 additions & 0 deletions src/models/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class AstResult extends CxResult {
language = "";
description = "";
descriptionHTML = "";
alternateId = "";
similarityId = "";
declare data: any;
state = "";
Expand Down Expand Up @@ -60,6 +61,7 @@ export class AstResult extends CxResult {
: result.vulnerabilityDetails.cveName,
result.id,
result.status,
result.alternateId,
result.similarityId,
result.state,
result.severity,
Expand Down
12 changes: 4 additions & 8 deletions src/views/riskManagementView/riskManagementView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ export class riskManagementView implements vscode.WebviewViewProvider {

private async handleMessage(message: {
command: string;
result?: { hash: string; engine: string };
result?: { hash: string };
}): Promise<void> {
switch (message.command) {
case "openVulnerabilityDetails": {
const hash = message.result.hash;
const type = message.result.engine;
const result = this.findResultByHash(hash, type);
const result = this.findResultByHash(message.result.hash);
if (result) {
const astResult = new AstResult(result);
await vscode.commands.executeCommand(commands.newDetails, astResult);
Expand All @@ -64,10 +62,8 @@ export class riskManagementView implements vscode.WebviewViewProvider {
}
}

private findResultByHash(hash: string, type: string): CxResult | undefined {
if (type === constants.sast) {
return this.cxResults.find((result) => result.data.resultHash === hash);
}
private findResultByHash(hash: string): CxResult | undefined {
return this.cxResults.find((result) => result.alternateId === hash);
}

public async updateContent(options?: {
Expand Down
Loading