Skip to content

Commit

Permalink
refactor(ScannerRun): Use a better name for getIssues()
Browse files Browse the repository at this point in the history
Align with the naming used in `AnalyzerResult` for consistency.
Aligning the other way round is impossible, because there would be a
conflict between `getIssues()` and the `issues` property.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Apr 9, 2024
1 parent 9707529 commit 43f6201
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion model/src/main/kotlin/OrtResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ data class OrtResult(
@JsonIgnore
fun getIssues(): Map<Identifier, Set<Issue>> {
val analyzerIssues = analyzer?.result?.getAllIssues().orEmpty()
val scannerIssues = scanner?.getIssues().orEmpty()
val scannerIssues = scanner?.getAllIssues().orEmpty()
val advisorIssues = advisor?.results?.getIssues().orEmpty()

val analyzerAndScannerIssues = analyzerIssues.zipWithCollections(scannerIssues)
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/ScannerRun.kt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ data class ScannerRun(
fun getFileList(id: Identifier): FileList? = fileListById[id]

@JsonIgnore
fun getIssues(): Map<Identifier, Set<Issue>> =
fun getAllIssues(): Map<Identifier, Set<Issue>> =
scanResultsById.mapValues { (_, scanResults) ->
scanResults.flatMapTo(mutableSetOf()) { it.summary.issues }
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/commands/scanner/src/main/kotlin/ScannerCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ScannerCommand : OrtCommand(
echo("The scan took $duration.")

val resolutionProvider = DefaultResolutionProvider.create(ortResult, resolutionsFile)
val issues = scannerRun.getIssues().flatMap { it.value }
val issues = scannerRun.getAllIssues().flatMap { it.value }
SeverityStatsPrinter(terminal, resolutionProvider).stats(issues)
.print().conclude(ortConfig.severeIssueThreshold, ORT_FAILURE_STATUS_CODE)
}
Expand Down

0 comments on commit 43f6201

Please sign in to comment.