Skip to content

Commit

Permalink
🧹 add ScoreStats.Add for easy aggregation (#1209)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Mar 29, 2024
1 parent 83417d3 commit d7c6939
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions policy/score_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ func (b *BlastRadiusConfig) Indicator(totalWeight float32, weight float32) Blast
}
return BlastRadius_Large
}

func (s *ScoreStats) Add(other *ScoreStats) {
s.Assets += other.Assets
s.Critical += other.Critical
s.High += other.High
s.Medium += other.Medium
s.Low += other.Low
s.Pass += other.Pass
s.Unknown += other.Unknown
s.Error += other.Error
s.FirstFailureTime += other.FirstFailureTime
s.OldestScanTime += other.OldestScanTime
s.NewestScanTime += other.NewestScanTime
}

0 comments on commit d7c6939

Please sign in to comment.