Skip to content

Commit

Permalink
refactor(model): Simplify filtering resolved vulnerabilities
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Apr 9, 2024
1 parent 696dc50 commit 40d9596
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions model/src/main/kotlin/OrtResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,8 @@ data class OrtResult(
.filterKeys { !omitExcluded || !isExcluded(it) }

return if (omitResolved) {
val resolutions = getResolutions().vulnerabilities

allVulnerabilities.mapValues { (_, vulnerabilities) ->
vulnerabilities.filter { vulnerability ->
resolutions.none { it.matches(vulnerability) }
}
vulnerabilities.filter { isResolved(it) }
}.filterValues { it.isNotEmpty() }
} else {
allVulnerabilities
Expand Down

0 comments on commit 40d9596

Please sign in to comment.