feat(report): range notion calc by severity when no-cvss-score (#1145)

This commit is contained in:
Kota Kanbe
2021-01-25 13:22:55 +09:00
committed by GitHub
parent e4f1e03f62
commit 3c1489e588
9 changed files with 258 additions and 281 deletions

View File

@@ -128,13 +128,7 @@ type Kernel struct {
// FilterByCvssOver is filter function.
func (r ScanResult) FilterByCvssOver(over float64) ScanResult {
filtered := r.ScannedCves.Find(func(v VulnInfo) bool {
v2Max := v.MaxCvss2Score()
v3Max := v.MaxCvss3Score()
max := v2Max.Value.Score
if max < v3Max.Value.Score {
max = v3Max.Value.Score
}
if over <= max {
if over <= v.MaxCvssScore().Value.Score {
return true
}
return false