Skip to content

Commit

Permalink
adding not relevant to resolved and treat them as such
Browse files Browse the repository at this point in the history
  • Loading branch information
siewer committed Dec 7, 2023
1 parent c64fa5c commit c0f4f15
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ private void createAdditionalInfo(Project project, VulnHistory vulnHistory) {
int detectedVulnerabilities = projectVulnerabilities.size();
long detectedCriticalVulnerabilities = projectVulnerabilities.stream().filter(pv -> pv.getSeverity().equals(Constants.API_SEVERITY_CRITICAL)).count();
long resolvedCriticalVulnerabilities = projectVulnerabilities.stream().filter(pv -> pv.getSeverity().equals(Constants.API_SEVERITY_CRITICAL) && Objects.equals(pv.getStatus().getId(), vulnTemplate.STATUS_REMOVED.getId()) && pv.getGrade()!=0).count();
long acknowlegedVulnerabilities = projectVulnerabilities.stream().filter(pv -> pv.getSeverity().equals(Constants.API_SEVERITY_CRITICAL) && pv.getGrade() == 0).count();
resolvedCriticalVulnerabilities += acknowlegedVulnerabilities;
List<ProjectVulnerability> solvedVulnerabilities = projectVulnerabilities.stream().filter(pv -> pv.getStatus().getId().equals(vulnTemplate.STATUS_REMOVED.getId())).collect(Collectors.toList());
int percentResolvedCritical = (int) Math.ceil(((double) resolvedCriticalVulnerabilities / detectedCriticalVulnerabilities) * 100);
int avgTimeToFix= (int) Math.ceil(calculateAverageDifferenceInDays(solvedVulnerabilities));
Expand Down

0 comments on commit c0f4f15

Please sign in to comment.