dart-lang / coverage
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 35 units with 602 lines of code in units (53.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (53 lines of code)
    • 6 medium size units (208 lines of code)
    • 17 small units (276 lines of code)
    • 11 very small units (65 lines of code)
0% | 8% | 34% | 45% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 8% | 34% | 45% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 8% | 34% | 45% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Future Function()
in lib/src/chrome.dart
53 12 1
String? resolve()
in lib/src/resolver.dart
48 9 1
String formatLcov()
in lib/src/formatter.dart
44 11 4
Future prettyPrint()
in lib/src/formatter.dart
38 10 5
static Map _parsePackages()
in lib/src/resolver.dart
27 6 1
Future retry()
in lib/src/util.dart
27 6 1
String? resolve()
in lib/src/resolver.dart
24 7 1
Future _waitIsolatesPaused()
in lib/src/collect.dart
20 4 2
void fillHitMap()
in lib/src/hitmap.dart
20 7 2
void merge()
in lib/src/hitmap.dart
20 4 1
Map hitmapToJson()
in lib/src/hitmap.dart
19 3 2
await retry()
in lib/src/collect.dart
18 1 1
bool _shouldIgnoreLine()
in lib/src/hitmap.dart
18 11 2
void mergeHitmaps()
in lib/src/hitmap.dart
18 3 2
int? _getLineFromTokenPos()
in lib/src/collect.dart
17 5 2
Future _resumeIsolates()
in lib/src/collect.dart
16 4 1
Set _coveredPositions()
in lib/src/chrome.dart
16 4 2
Future _processFunction()
in lib/src/collect.dart
15 3 5
List _sortHits()
in lib/src/hitmap.dart
15 3 1
List _coverageInfoFor()
in lib/src/chrome.dart
15 3 1