From c0de20583379233bdefa3d9129d3317c83cd88e2 Mon Sep 17 00:00:00 2001 From: delarea Date: Thu, 5 Oct 2023 14:35:34 +0300 Subject: [PATCH] Fix table order --- xray/utils/resultstable.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xray/utils/resultstable.go b/xray/utils/resultstable.go index c73968e65..b2e005bbb 100644 --- a/xray/utils/resultstable.go +++ b/xray/utils/resultstable.go @@ -259,8 +259,9 @@ func sortVulnerabilityOrViolationRows(rows []formats.VulnerabilityOrViolationRow if rows[i].SeverityNumValue != rows[j].SeverityNumValue { return rows[i].SeverityNumValue > rows[j].SeverityNumValue } + // No fix versions available should appear higher. if len(rows[i].FixedVersions) != len(rows[j].FixedVersions) { - return len(rows[i].FixedVersions) > len(rows[j].FixedVersions) + return len(rows[i].FixedVersions) < len(rows[j].FixedVersions) } return rows[i].ImpactedDependencyName > rows[j].ImpactedDependencyName })