dart-lang / csslib
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 522 units with 5,279 lines of code in units (63.7% of code).
    • 4 very long units (592 lines of code)
    • 8 long units (511 lines of code)
    • 39 medium size units (1,266 lines of code)
    • 65 small units (922 lines of code)
    • 406 very small units (1,988 lines of code)
11% | 9% | 23% | 17% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart11% | 9% | 23% | 17% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib20% | 15% | 33% | 12% | 19%
lib/src5% | 4% | 18% | 21% | 50%
example0% | 93% | 0% | 0% | 6%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Token next()
in lib/src/tokenizer.dart
172 76 1
171 57 0
dynamic processTerm()
in lib/parser.dart
148 45 1
101 45 3
79 19 0
static String kindToString()
in lib/src/token_kind.dart
76 36 1
76 29 3
65 28 0
void main()
in example/call_parser.dart
60 9 0
52 15 1
Expressions processExpr()
in lib/parser.dart
52 14 1
static void template()
in lib/src/validate.dart
51 14 1
50 11 1
49 11 0
static String? _convertCssToArgb()
in lib/src/property.dart
47 17 1
int readEscapeSequence()
in lib/src/tokenizer_base.dart
43 15 0
43 14 1
42 15 1
42 9 0
40 20 2