Skip to content

Commit

Permalink
refactor(static-html): Extract a variable for the effective license
Browse files Browse the repository at this point in the history
Improve consistency.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed May 6, 2024
1 parent c889a18 commit 4893dac
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ private fun getProjectTable(input: ReporterInput, project: Project): ProjectTabl
.sortedBy { it.license.toString() }
val detectedLicenses = resolvedLicenseInfo.filter { LicenseSource.DETECTED in it.sources }
.sortedBy { it.license.toString() }
val effectiveLicense = resolvedLicenseInfo.filterExcluded().effectiveLicense(
LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED,
input.ortResult.getPackageLicenseChoices(id),
input.ortResult.getRepositoryLicenseChoices()
)?.sorted()

val analyzerIssues = projectIssuesForId[id].orEmpty() + input.ortResult.analyzer?.result?.issues?.get(id)
.orEmpty()
Expand All @@ -151,11 +156,7 @@ private fun getProjectTable(input: ReporterInput, project: Project): ProjectTabl
concludedLicense = concludedLicense,
declaredLicenses = declaredLicenses,
detectedLicenses = detectedLicenses,
effectiveLicense = resolvedLicenseInfo.filterExcluded().effectiveLicense(
LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED,
input.ortResult.getPackageLicenseChoices(id),
input.ortResult.getRepositoryLicenseChoices()
)?.sorted(),
effectiveLicense = effectiveLicense,
analyzerIssues = analyzerIssues.map {
it.toTableReportIssue(input.ortResult, input.howToFixTextProvider)
},
Expand Down

0 comments on commit 4893dac

Please sign in to comment.