MetricDefinition

data class MetricDefinition(val id: String, val name: String, val unit: String, val formula: String, val question: String, val interpretation: String, val action: String, val bands: MetricBands?, val provenance: Provenance, val perModule: Boolean)(source)

One metric's definition, in the words a developer needs to act on it.

Every field is mandatory for a reason. A metric that cannot say what engineering question it answers, or how to read its number, is a number without a purpose - and Aalekh has no shortage of places to put numbers. Requiring question, interpretation, and action up front is what keeps mathematically-interesting-but-useless metrics out of the report.

Parameters

id

Stable kebab-case identifier, used as a column key and in exports.

name

Display name.

unit

Unit label ("modules", "%", "" for a bare number).

formula

How it is calculated, in one line.

question

The engineering question it answers.

interpretation

How to read the number.

action

What a bad value suggests doing.

bands

Thresholds, or null when the metric is descriptive and has no good or bad value.

provenance

Whether the metric is observed from the build or computed from the graph.

perModule

True when the metric is per-module; false when it describes the whole project.

Constructors

Link copied to clipboard
constructor(id: String, name: String, unit: String, formula: String, question: String, interpretation: String, action: String, bands: MetricBands?, provenance: Provenance, perModule: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard