getHotspots method

List<FileDebtSummary> getHotspots(
  1. int n
)

Get hotspots (files with highest debt cost).

Implementation

List<FileDebtSummary> getHotspots(int n) {
  final files = byFile.values.toList();
  files.sort((a, b) => b.totalCost.compareTo(a.totalCost));
  return files.take(n).toList();
}