averageSLOC function

int averageSLOC(
  1. Iterable<LintFileReport> records
)

Implementation

int averageSLOC(Iterable<LintFileReport> records) {
  final functionsCount = records.fold<int>(
    0,
    (prevValue, fileReport) => prevValue + fileReport.functions.keys.length,
  );

  return functionsCount > 0 ? totalSLOC(records) ~/ functionsCount : 0;
}