func (rs ResultSet) GetSummaryByCategory() CountSummaryByCategory {
	summaries := CountSummaryByCategory{}
	for _, result := range rs {
		cs, ok := summaries[result.Category]
		if !ok {
			cs = CountSummary{}
		}
		cs.AddResult(result)
		summaries[result.Category] = cs
	}
	return summaries
}
GetSummaryByCategory summarizes a ResultSet
package validator
import (
	"sort"
	"strings"
	"github.com/fairwindsops/polaris/pkg/config"
)
type CountSummary struct {
	Successes uint
	Warnings  uint
	Dangers   uint
}
type CountSummaryByCategory map[string]CountSummary
func (cs CountSummary) GetScore() uint {
	total := (cs.Successes * 2) + cs.Warnings + (cs.Dangers * 2)
	if total == 0 {
		return uint(100)
	}
	score := uint((float64(cs.Successes*2) / float64(total)) * 100)
	return score
}
func (cs *CountSummary) AddSummary(other CountSummary) {
	cs.Successes += other.Successes
	cs.Warnings += other.Warnings
	cs.Dangers += other.Dangers
}
func (cs *CountSummary) AddResult(result ResultMessage) {
	if result.Success == false {
		if result.Severity == config.SeverityWarning {
			cs.Warnings++
		} else {
			cs.Dangers++
		}
	} else {
		cs.Successes++
	}
}
func (csc CountSummaryByCategory) AddSummary(other CountSummaryByCategory) {
	categories := []string{}
	for cat := range csc {
		categories = append(categories, cat)
	}
	for cat := range other {
		categories = append(categories, cat)
	}
	for _, cat := range categories {
		cur := csc[cat]
		cur.AddSummary(other[cat])
		csc[cat] = cur
	}
}
func (rs ResultSet) GetSummary() CountSummary {
	cs := CountSummary{}
	for _, result := range rs {
		cs.AddResult(result)
	}
	return cs
}