Skip to content

Commit

Permalink
refactor(static-html): Extract constant for the rule violation table ID
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Apr 30, 2024
1 parent 92d2be5 commit a313d42
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import org.ossreviewtoolkit.utils.spdx.SpdxExpression
import org.ossreviewtoolkit.utils.spdx.SpdxLicenseIdExpression
import org.ossreviewtoolkit.utils.spdx.SpdxLicenseWithExceptionExpression

private const val RULE_VIOLATION_TABLE_ID = "rule-violation-summary"

@Suppress("LargeClass", "TooManyFunctions")
class StaticHtmlReporter : Reporter {
override val type = "StaticHtml"
Expand Down Expand Up @@ -196,7 +198,7 @@ class StaticHtmlReporter : Reporter {
ul {
reportTableModel.ruleViolations?.let { ruleViolations ->
li {
a("#rule-violation-summary") {
a("#$RULE_VIOLATION_TABLE_ID") {
+getRuleViolationSummaryString(ruleViolations)
}
}
Expand Down Expand Up @@ -237,7 +239,7 @@ class StaticHtmlReporter : Reporter {

private fun DIV.evaluatorTable(ruleViolations: List<ReportTableModel.ResolvableViolation>) {
h2 {
id = "rule-violation-summary"
id = RULE_VIOLATION_TABLE_ID
+getRuleViolationSummaryString(ruleViolations)
}

Expand Down

0 comments on commit a313d42

Please sign in to comment.