From d7c6939239adfae74370d7f2ccce0df1c677d285 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Fri, 29 Mar 2024 03:53:27 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20add=20ScoreStats.Add=20for=20eas?= =?UTF-8?q?y=20aggregation=20(#1209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dominik Richter --- policy/score_stats.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/policy/score_stats.go b/policy/score_stats.go index f2c69d0f..19a7437e 100644 --- a/policy/score_stats.go +++ b/policy/score_stats.go @@ -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 +}