Skip to content

Commit

Permalink
Fix Exec report crash due to missing N/A field in API
Browse files Browse the repository at this point in the history
  • Loading branch information
leSamo committed Nov 28, 2023
1 parent e17982f commit 8f2390b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
6 changes: 0 additions & 6 deletions src/Components/SmartComponents/Reports/BuildExecReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ const BuildExecReport = ({ data, intl }) => {
rules_by_severity: rulesBySeverity
} = data;

// if there's no CVE with N/A CVSS do not display N/A in graph/table
if (cvesBySeverity?.na?.count === 0) {
delete cvesBySeverity.na;
delete CVSSMapping.na;
}

const rulesBySeverityMap = Object.keys(rulesBySeverity).reverse().map(severity =>{
return [
EXEC_RULES_SEVERITY_MAP[severity],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ const data = {
"count": 105,
"percentage": 18,
"known_exploit_count": 2
},
"na": {
"count": 0,
"percentage": 0,
"known_exploit_count": 0
}
},
"cves_total": 595,
Expand Down
3 changes: 1 addition & 2 deletions src/Helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ export const recentCvesHeader = [
export const CVSSMapping = {
'8to10': '8.0 - 10.0',
'4to7.9': '4.0 - 7.9',
'0to3.9': '0.0 - 3.9',
na: 'N/A'
'0to3.9': '0.0 - 3.9'
};

export const recentCvesMapping = {
Expand Down

0 comments on commit 8f2390b

Please sign in to comment.