dart-lang / dartbug.com
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 7 units with 149 lines of code in units (53.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (104 lines of code)
    • 3 small units (37 lines of code)
    • 1 very small units (8 lines of code)
0% | 0% | 69% | 24% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 0% | 69% | 24% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 0% | 77% | 17% | 5%
tool0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 7 longest units
Unit# linesMcCabe index# params
Response _handler()
in lib/server.dart
50 6 1
Future currentProjectId()
in lib/utils.dart
31 4 0
23 4 0
Future main()
in tool/update_sdk_labels.dart
14 1 0
Uri? findRedirect()
in lib/redirect.dart
12 4 1
Future serveHandler()
in lib/utils.dart
11 1 1
String? _checkMatch()
in lib/redirect.dart
8 2 2