updateCounts updates the count fields in the result.
(result *ScanResult)
| 1131 | |
| 1132 | // updateCounts updates the count fields in the result. |
| 1133 | func (s *Scanner) updateCounts(result *ScanResult) { |
| 1134 | result.TotalCount = len(result.Findings) |
| 1135 | for _, f := range result.Findings { |
| 1136 | switch f.Severity { |
| 1137 | case SeverityCritical: |
| 1138 | result.CriticalCount++ |
| 1139 | case SeverityHigh: |
| 1140 | result.HighCount++ |
| 1141 | case SeverityMedium: |
| 1142 | result.MediumCount++ |
| 1143 | case SeverityLow: |
| 1144 | result.LowCount++ |
| 1145 | } |
| 1146 | } |
| 1147 | } |
| 1148 | |
| 1149 | // HasCritical returns true if any CRITICAL severity findings exist. |
| 1150 | // Use this to quickly check for definite security vulnerabilities that |