Skip to content

Commit

Permalink
refactor(helper-cli): Use a more speaking name for getProvenance()
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 27, 2023
1 parent d785b4f commit 4b8bf9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helper-cli/src/main/kotlin/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4b8bf9d

Please sign in to comment.