aboutsummaryrefslogtreecommitdiff
blob: a49f21d65dddf83adedc89c7555c8595e18804fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package utils

import (
	"soko/pkg/models"
)

func CountBugsCategories(bugs []*models.Bug) (generalCount, stabilizationCount, keywordingCount int) {
	for _, bug := range bugs {
		switch bug.Component {
		case string(models.BugComponentVulnerabilities):
			continue
		case string(models.BugComponentStabilization):
			stabilizationCount++
		case string(models.BugComponentKeywording):
			keywordingCount++
		default:
			generalCount++
		}
	}
	return
}