dart-lang / language
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 14 units with 290 lines of code in units (1.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (157 lines of code)
    • 1 medium size units (29 lines of code)
    • 4 small units (61 lines of code)
    • 7 very small units (43 lines of code)
0% | 54% | 10% | 21% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 54% | 10% | 21% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
working/macros/example0% | 54% | 10% | 21% | 14%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
void main()
in working/macros/example/run.dart
89 21 0
Future buildDeclarationsForClass()
in working/macros/example/data_class.dart
68 16 2
Future buildDeclarationsForClass()
in working/macros/example/data_class.dart
29 4 2
Future buildDefinitionForClass()
in working/macros/example/data_class.dart
18 2 2
Future buildDefinitionForClass()
in working/macros/example/data_class.dart
16 2 2
Future buildDefinitionForClass()
in working/macros/example/data_class.dart
15 2 2
Stream allFields()
in working/macros/example/data_class.dart
12 5 1
Future buildDeclarationsForClass()
in working/macros/example/data_class.dart
8 1 2
void buildDeclarationsForClass()
in working/macros/example/data_class.dart
8 1 2
Future buildDefinitionForClass()
in working/macros/example/data_class.dart
6 1 2
void buildDeclarationsForClass()
in working/macros/example/data_class.dart
6 1 2
void buildDeclarationsForClass()
in working/macros/example/data_class.dart
6 1 2
T? firstWhereOrNull()
in working/macros/example/data_class.dart
6 3 1
void _log()
in working/macros/example/run.dart
3 1 1