metricViolations function
Implementation
int metricViolations(Iterable<LintFileReport> records, String metricId) =>
records.fold<int>(
0,
(prevValue, fileReport) =>
prevValue +
fileReport.functions.values.fold(
0,
(prevValue, functionReport) =>
prevValue +
(isReportLevel(functionReport.metric(metricId)?.level ??
MetricValueLevel.none)
? 1
: 0),
),
);