All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gitlab.arturbosch.detekt.cli.console.ProjectStatisticsReport.kt Maven / Gradle / Ivy

There is a newer version: 1.23.7
Show newest version
package io.gitlab.arturbosch.detekt.cli.console

import io.gitlab.arturbosch.detekt.api.ConsoleReport
import io.gitlab.arturbosch.detekt.api.Detektion

class ProjectStatisticsReport : ConsoleReport() {

    override val priority: Int = 10

    override fun render(detektion: Detektion): String? {
        val metrics = detektion.metrics
        if (metrics.isEmpty()) return null
        return with(StringBuilder()) {
            append("Project Statistics:".format())
            metrics.sortedBy { it.priority }
                    .reversed()
                    .forEach { append(it.toString().format(PREFIX)) }
            toString()
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy