From bb620022f5c2f8de4c55be1e9e6c69c902e26e2d Mon Sep 17 00:00:00 2001 From: Alan Buscaglia Date: Fri, 5 Dec 2025 13:40:54 +0100 Subject: [PATCH] fix(ui): use severity sum for failed findings count in Risk Plot Ensure tooltip and horizontal bar chart show consistent numbers by using the sum of severity counts instead of separate API field --- .../overview/risk-plot/risk-plot.adapter.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/actions/overview/risk-plot/risk-plot.adapter.ts b/ui/actions/overview/risk-plot/risk-plot.adapter.ts index d2b27cc06e..57c3f6502e 100644 --- a/ui/actions/overview/risk-plot/risk-plot.adapter.ts +++ b/ui/actions/overview/risk-plot/risk-plot.adapter.ts @@ -44,43 +44,45 @@ export function adaptToRiskPlotData( // Build severity data for the horizontal bar chart with percentages let severityData; + let totalFailedFindings = 0; + if (providerData.severity) { const { critical, high, medium, low, informational } = providerData.severity; - const total = critical + high + medium + low + informational; + totalFailedFindings = critical + high + medium + low + informational; severityData = [ { name: "Critical", value: critical, - percentage: calculatePercentage(critical, total), + percentage: calculatePercentage(critical, totalFailedFindings), }, { name: "High", value: high, - percentage: calculatePercentage(high, total), + percentage: calculatePercentage(high, totalFailedFindings), }, { name: "Medium", value: medium, - percentage: calculatePercentage(medium, total), + percentage: calculatePercentage(medium, totalFailedFindings), }, { name: "Low", value: low, - percentage: calculatePercentage(low, total), + percentage: calculatePercentage(low, totalFailedFindings), }, { name: "Info", value: informational, - percentage: calculatePercentage(informational, total), + percentage: calculatePercentage(informational, totalFailedFindings), }, ]; } points.push({ x: providerData.overallScore ?? 0, - y: providerData.failedFindings, + y: totalFailedFindings, provider: providerDisplayName, name: providerData.providerName, providerId: providerData.providerId,