fix(report): fix the number of fixed/total in reporting (#817)

This commit is contained in:
Kota Kanbe
2019-05-20 14:30:29 +09:00
committed by GitHub
parent 98fee7b5d2
commit e750bd53fc
3 changed files with 3 additions and 3 deletions

View File

@@ -185,6 +185,7 @@ func (r ScanResult) FilterUnfixed() ScanResult {
return r
}
filtered := r.ScannedCves.Find(func(v VulnInfo) bool {
// Report cves detected by CPE because Vuls can't know 'fixed' or 'unfixed'
if len(v.CpeURIs) != 0 {
return true
}

View File

@@ -115,7 +115,7 @@ func (v VulnInfos) FormatFixedStatus(packs Packages) string {
continue
}
total++
if vInfo.PatchStatus(packs) == "Fixed" {
if vInfo.PatchStatus(packs) == "fixed" {
fixed++
}
}

View File

@@ -114,8 +114,7 @@ func FillWordPress(r *models.ScanResult, token string) (int, error) {
wpVinfos = append(wpVinfos, v)
util.Log.Infof("[match] %s installed: %s, fixedIn: %s", pkg.Name, pkg.Version, fixstat.FixedIn)
} else {
//TODO Debugf
util.Log.Infof("[miss] %s installed: %s, fixedIn: %s", pkg.Name, pkg.Version, fixstat.FixedIn)
util.Log.Debugf("[miss] %s installed: %s, fixedIn: %s", pkg.Name, pkg.Version, fixstat.FixedIn)
}
}
}