Skip to content

Commit 927af1e

Browse files
Michael SterpkaMichael Sterpka
authored andcommitted
report: add color highlight for RISK score, center RISK text
1 parent 1ae3c99 commit 927af1e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/report/html-template.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ function renderHTML (title, summary, report, whitelist) {
3131
: `<div style="color:${['#89a19d', '#ffb726', '#ff8b40', '#ff6040'][i]}">${v} ${['Low', 'Medium', 'High', 'Critical'][i]}</div>`)
3232
const pkgLicense = license && license.data && license.data.spdx ? license.data.spdx : 'UNKNOWN'
3333
const pkgLicensePass = license && license.pass === true
34-
const pkgSeverity = SEVERITY_RMAP[maxSeverity]
34+
const pkgSeverity = maxSeverity === 0
35+
? SEVERITY_RMAP[maxSeverity]
36+
: `<div style="color:${['#89a19d', '#ffb726', '#ff8b40', '#ff6040'][maxSeverity - 1]}">${SEVERITY_RMAP[maxSeverity]}</div>`
3537

3638
alternate = !alternate
3739
return `
3840
<tr class="module-element" ${alternate ? 'style="background:#2e3535"' : ''}>
3941
<td>
4042
<div id="name" style="display:inline-block;color:#e1e7e6;">${name}</div>@${version}
4143
</td>
42-
<td>
44+
<td style="text-align:center;">
4345
${pkgSeverity}
4446
</div>
4547
<td>

0 commit comments

Comments
 (0)