dart-lang / usage
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 52 units with 342 lines of code in units (45.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (77 lines of code)
    • 4 small units (57 lines of code)
    • 45 very small units (208 lines of code)
0% | 0% | 22% | 16% | 60%
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% | 22% | 16% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 0% | 25% | 19% | 55%
example0% | 0% | 44% | 0% | 55%
lib0% | 0% | 0% | 20% | 79%
lib/uuid0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Future _enqueuePayload()
in lib/src/usage_impl.dart
34 6 2
void _trySendBatches()
in lib/src/usage_impl.dart
22 8 1
void main()
in example/ga.dart
21 3 1
String createUserAgent()
in lib/src/usage_impl_io.dart
17 6 0
Future sendException()
in lib/src/usage_impl.dart
15 5 2
14 3 2
Future sendEvent()
in lib/src/usage_impl.dart
11 3 5
Future sendPost()
in lib/src/usage_impl_io.dart
10 1 2
Future sendTiming()
in lib/src/usage_impl.dart
10 3 4
Future sendTiming()
in lib/usage.dart
9 1 4
void syncSettings()
in lib/src/usage_impl_io.dart
9 3 0
Future sendPost()
in lib/src/usage_impl_html.dart
9 1 2
bool removeDrop()
in lib/src/usage_impl.dart
9 2 0
Future sendEvent()
in lib/usage.dart
8 1 5
String generateV4()
in lib/uuid/uuid.dart
8 1 0
void _checkReplenish()
in lib/src/usage_impl.dart
8 2 0
Analytics getAnalytics()
in example/example.dart
8 3 0
String? getPlatformLocale()
in lib/src/usage_impl_io.dart
7 2 0
void setSessionValue()
in lib/src/usage_impl.dart
7 2 2
Future finish()
in lib/usage.dart
6 2 0