metricViolations function

int metricViolations(
  1. Iterable<LintFileReport> records,
  2. String metricId
)

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),
          ),
    );