mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-01-16 00:34:18 +01:00
24 lines
593 B
Scala
24 lines
593 B
Scala
package controllers
|
|
|
|
import controllers.WarningSeverity.WarningSeverity
|
|
import play.twirl.api.Html
|
|
|
|
object WarningSeverity extends Enumeration {
|
|
type WarningSeverity = Value
|
|
// Order is important
|
|
val Info = Value("info")
|
|
val Warning = Value("warning")
|
|
val Error = Value("error")
|
|
}
|
|
|
|
sealed abstract class Warning {
|
|
def optimize: Warning
|
|
def html: Html
|
|
def id: String
|
|
def allowSnoozes = true
|
|
def severity: WarningSeverity
|
|
}
|
|
|
|
final case class IdentifiedWarning(id: String, html: Html, severity: WarningSeverity) extends Warning{
|
|
def optimize = copy(html = Html(html.body))
|
|
} |