Skip to content

Commit

Permalink
refactor(fossid): Simplify code with createAndLogIssue()
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Aug 10, 2024
1 parent 2c18272 commit 7d5deb6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions plugins/scanners/fossid/src/main/kotlin/FossIdScanResults.kt
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,11 @@ internal suspend fun mapSnippetFindings(
}

if (isNotOldMarkedAsIdentifiedFile) {
val message =
"The configuration contains a snippet choice for the snippet ${snippetChoice.choice.purl} at " +
"${snippetChoice.given.sourceLocation.prettyPrint()}, but the FossID result contains no such " +
"snippet."
logger.warn(message)
issues += Issue(
issues += snippetChoice.createAndLogIssue(
source = "FossId",
message = message,
message = "The configuration contains a snippet choice for the snippet " +
"${snippetChoice.choice.purl} at ${snippetChoice.given.sourceLocation.prettyPrint()}, but " +
"the FossID result contains no such snippet.",
severity = Severity.WARNING
)
}
Expand Down

0 comments on commit 7d5deb6

Please sign in to comment.