From f6fa2cbbfb0938261324e96da1bdc66df1c6d9ae Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Tue, 28 May 2024 11:54:04 +0200 Subject: [PATCH] refactor(evaluated-model): Inline `actualScanResult` Having to deal with `scanResult`, `evaluatedScanResult` and `actualScanResult` is more complicated, than having only two of them. So, inline the latter to simplify a bit. Signed-off-by: Frank Viernau --- .../src/main/kotlin/EvaluatedModelMapper.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt b/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt index 52bfdc387f27f..41819ce8dd77a 100644 --- a/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt +++ b/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt @@ -426,21 +426,19 @@ internal class EvaluatedModelMapper(private val input: ReporterInput) { calculatePackageVerificationCode(fileList.files.map { it.sha1 }.asSequence()) }.orEmpty(), issues = issues - ) - - val actualScanResult = scanResults.addIfRequired(evaluatedScanResult) + ).run { scanResults.addIfRequired(this) } issues += addIssues( result.summary.issues, EvaluatedIssueType.SCANNER, pkg, - actualScanResult, + evaluatedScanResult, null ) - addLicensesAndCopyrights(pkg.id, result, actualScanResult, findings) + addLicensesAndCopyrights(pkg.id, result, evaluatedScanResult, findings) - return actualScanResult + return evaluatedScanResult } private fun addDependencyTree(project: Project, pkg: EvaluatedPackage, deduplicateDependencyTree: Boolean) {