Skip to content

Commit

Permalink
refactor(twistlock): remove obsolete methods
Browse files Browse the repository at this point in the history
  • Loading branch information
error418 committed Sep 12, 2019
1 parent a434d0b commit 4bdafd1
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/twistlock/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export namespace TwistlockModel {
this.ignoredVulnerabilityIssues.push(vuln);
} else {
if (vuln.cvss >= minCvss) {
this.addVulnerabilityIssue(vuln);
this.vulnerabilityIssues.push(vuln);
this.updateCounterMap(this.vulnerabilityCounts, vuln.severity);
} else {
this.ignoredVulnerabilityIssues.push(vuln);
}
Expand All @@ -45,7 +46,8 @@ export namespace TwistlockModel {
if (result.compliances) {
result.compliances.forEach((comp) => {
if (TwistlockModel.SeverityUtil.isComplianceEqualOrHigher(comp.severity, complianceSeverity)) {
this.addComplianceIssue(comp);
this.complianceIssues.push(comp);
this.updateCounterMap(this.complianceCounts, comp.severity);
} else {
this.ignoredComplianceIssues.push(comp);
}
Expand All @@ -65,16 +67,6 @@ export namespace TwistlockModel {
}
}

private addComplianceIssue(issue: Compliance) {
this.complianceIssues.push(issue);
this.updateCounterMap(this.complianceCounts, issue.severity);
}

private addVulnerabilityIssue(issue: Vulnerability) {
this.vulnerabilityIssues.push(issue);
this.updateCounterMap(this.vulnerabilityCounts, issue.severity);
}

public issuesCount(): number {
return this.complianceIssues.length + this.vulnerabilityIssues.length;
}
Expand Down

0 comments on commit 4bdafd1

Please sign in to comment.