Skip to content

Commit ce9007f

Browse files
fviernausschuberth
authored andcommitted
chore(scanoss): Align mapping functions for findings to return a Set
Make the return types consistent. Signed-off-by: Frank Viernau <frank.viernau@gmail.com>
1 parent 04ebd1b commit ce9007f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

plugins/scanners/scanoss/src/main/kotlin/ScanOssResultParser.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ internal fun generateSummary(startTime: Instant, endTime: Instant, results: List
8686
/**
8787
* Get the license findings from the given [details].
8888
*/
89-
private fun getLicenseFindings(details: ScanFileDetails, path: String): List<LicenseFinding> {
89+
private fun getLicenseFindings(details: ScanFileDetails, path: String): Set<LicenseFinding> {
9090
val score = details.matched?.removeSuffix("%")?.toFloatOrNull()
9191

92-
return details.licenseDetails.orEmpty().map { license ->
92+
return details.licenseDetails.orEmpty().mapTo(mutableSetOf()) { license ->
9393
val licenseExpression = runCatching { SpdxExpression.parse(license.name) }.getOrNull()
9494

9595
val validatedLicense = when {
@@ -113,8 +113,8 @@ private fun getLicenseFindings(details: ScanFileDetails, path: String): List<Lic
113113
/**
114114
* Get the copyright findings from the given [details].
115115
*/
116-
private fun getCopyrightFindings(details: ScanFileDetails, path: String): List<CopyrightFinding> =
117-
details.copyrightDetails.orEmpty().map { copyright ->
116+
private fun getCopyrightFindings(details: ScanFileDetails, path: String): Set<CopyrightFinding> =
117+
details.copyrightDetails.orEmpty().mapTo(mutableSetOf()) { copyright ->
118118
CopyrightFinding(
119119
statement = copyright.name,
120120
location = TextLocation(

0 commit comments

Comments
 (0)