Skip to content

Commit

Permalink
revert the if statemenet
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcold committed Sep 11, 2023
1 parent 60402a4 commit 00a6faa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions vulnerability/events_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,11 @@ func (e EventsCreator) getCVSSScore(vul trivyTypes.DetectedVulnerability) float6
const NVDVulnDetailBaseURL = "https://nvd.nist.gov/vuln/detail/"

func getReference(vul trivyTypes.DetectedVulnerability) string {
if vul.CVSS == nil {
if _, ok := vul.CVSS[trivyVul.NVD]; !ok {
return vul.PrimaryURL
}

if _, ok := vul.CVSS[trivyVul.NVD]; ok {
return fmt.Sprintf("%s%s", NVDVulnDetailBaseURL, vul.VulnerabilityID)
}

return vul.PrimaryURL
return fmt.Sprintf("%s%s", NVDVulnDetailBaseURL, vul.VulnerabilityID)
}

func getCVSSValue[T comparable](vul trivyTypes.DetectedVulnerability, value func(cvss dbTypes.CVSS) T, zeroVal T) T {
Expand Down

0 comments on commit 00a6faa

Please sign in to comment.