From 4b8bf9d8a731de2c370171590133a84150af63b8 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Mon, 27 Nov 2023 16:34:41 +0100 Subject: [PATCH] refactor(helper-cli): Use a more speaking name for `getProvenance()` Signed-off-by: Frank Viernau --- helper-cli/src/main/kotlin/utils/Extensions.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helper-cli/src/main/kotlin/utils/Extensions.kt b/helper-cli/src/main/kotlin/utils/Extensions.kt index b99a3d2b7f7c7..b590209c00922 100644 --- a/helper-cli/src/main/kotlin/utils/Extensions.kt +++ b/helper-cli/src/main/kotlin/utils/Extensions.kt @@ -95,7 +95,7 @@ internal fun OrtResult.fetchScannedSources(id: Identifier): File { val tempDir = createTempDirectory(Paths.get("."), ORTH_NAME).toFile() val pkg = getPackageOrProject(id)!!.metadata.let { - if (getProvenance(id) is ArtifactProvenance) { + if (getScannedProvenance(id) is ArtifactProvenance) { it.copy(vcs = VcsInfo.EMPTY, vcsProcessed = VcsInfo.EMPTY) } else { it.copy(sourceArtifact = RemoteArtifact.EMPTY) @@ -229,7 +229,8 @@ internal fun OrtResult.getViolatedRulesByLicense( /** * Return the [Provenance] of the first scan result matching the given [id] or null if there is no match. */ -internal fun OrtResult.getProvenance(id: Identifier): Provenance? = getScanResultsForId(id).firstOrNull()?.provenance +internal fun OrtResult.getScannedProvenance(id: Identifier): Provenance? = + getScanResultsForId(id).firstOrNull()?.provenance /** * Return all issues from scan results. Issues for excludes [Project]s or [Package]s are not returned if and only if