scoverage.reporter.StatementWriter.scala Maven / Gradle / Ivy
package scoverage.reporter
import scala.xml.Node
import scoverage.domain.MeasuredFile
/** @author Stephen Samuel */
class StatementWriter(mFile: MeasuredFile) {
val GREEN = "#AEF1AE"
val RED = "#F0ADAD"
def output: Node = {
def cellStyle(invoked: Boolean): String = invoked match {
case true => s"background: $GREEN"
case false => s"background: $RED"
}
Line
Stmt Id
Pos
Tree
Symbol
Tests
Code
{
mFile.statements.toSeq
.sortBy(_.line)
.map(stmt => {
{stmt.line}
{stmt.id}
{stmt.start.toString}
-
{stmt.end.toString}
{stmt.treeName}
{stmt.symbolName}
{stmt.tests.mkString(",")}
{stmt.desc}
})
}
}
}