Skip to content

Commit

Permalink
refactor(model): Make resolveResolutions() an extension function
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Dec 19, 2023
1 parent c08a624 commit c9fdf41
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions model/src/main/kotlin/utils/ConfigurationResolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ object ConfigurationResolver {
ruleViolations: List<RuleViolation>,
vulnerabilities: List<Vulnerability>,
resolutionProvider: ResolutionProvider
): Resolutions {
val issueResolutions = issues.flatMap { resolutionProvider.getResolutionsFor(it) }.distinct()
val ruleViolationResolutions = ruleViolations.flatMap { resolutionProvider.getResolutionsFor(it) }.distinct()
val vulnerabilityResolutions = vulnerabilities.flatMap { resolutionProvider.getResolutionsFor(it) }.distinct()

return Resolutions(issueResolutions, ruleViolationResolutions, vulnerabilityResolutions)
}
) = Resolutions(
issues = issues.flatMap { resolutionProvider.getResolutionsFor(it) }.distinct(),
ruleViolations = ruleViolations.flatMap { resolutionProvider.getResolutionsFor(it) }.distinct(),
vulnerabilities = vulnerabilities.flatMap { resolutionProvider.getResolutionsFor(it) }.distinct()
)
}

0 comments on commit c9fdf41

Please sign in to comment.