precision property

double get precision

Of the findings reported, the fraction that were real. Undefined when the rule reported nothing; reported as 1.0 (a rule that says nothing is never wrong).

Implementation

double get precision {
  final reported = truePositives + falsePositives;
  return reported == 0 ? 1.0 : truePositives / reported;
}