dart-lang / yaml
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 108 units with 1,713 lines of code in units (64.3% of code).
    • 2 very long units (260 lines of code)
    • 5 long units (324 lines of code)
    • 17 medium size units (435 lines of code)
    • 29 small units (400 lines of code)
    • 55 very small units (294 lines of code)
15% | 18% | 25% | 23% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart15% | 18% | 25% | 23% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src15% | 19% | 25% | 22% | 16%
benchmark0% | 0% | 72% | 0% | 27%
lib0% | 0% | 0% | 66% | 33%
example0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Token _scanFlowScalar()
in lib/src/scanner.dart
151 52 1
void _fetchNextToken()
in lib/src/scanner.dart
109 38 0
Token _scanBlockScalar()
in lib/src/scanner.dart
77 27 1
Event _parseNode()
in lib/src/parser.dart
77 22 2
Token _scanPlainScalar()
in lib/src/scanner.dart
59 21 0
num? _parseNumberValue()
in lib/src/loader.dart
59 40 3
Event _stateMachine()
in lib/src/parser.dart
52 23 0
Event _parseDocumentStart()
in lib/src/parser.dart
35 8 0
Event _parseFlowMappingKey()
in lib/src/parser.dart
32 10 1
Token _scanAnchor()
in lib/src/scanner.dart
28 13 1
Event _parseBlockMappingKey()
in lib/src/parser.dart
27 7 0
void _fetchValue()
in lib/src/scanner.dart
26 5 0
Token _scanTag()
in lib/src/scanner.dart
26 6 0
bool equals()
in lib/src/equality.dart
26 14 2
Token? _scanDirective()
in lib/src/scanner.dart
25 5 0
bool _isPlainSafeAt()
in lib/src/scanner.dart
25 20 1
YamlScalar? _tryParseScalar()
in lib/src/loader.dart
25 18 1
Event _parseFlowSequenceEntry()
in lib/src/parser.dart
25 7 1
YamlScalar _parseByTag()
in lib/src/loader.dart
24 10 1
void _scanToNextToken()
in lib/src/scanner.dart
23 10 0