dart-lang / co19
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 6,623 units with 34,276 lines of code in units (12.7% of code).
    • 1 very long units (117 lines of code)
    • 9 long units (505 lines of code)
    • 231 medium size units (6,213 lines of code)
    • 542 small units (7,990 lines of code)
    • 5,840 very small units (19,451 lines of code)
<1% | 1% | 18% | 23% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart<1% | 1% | 18% | 23% | 56%
py0% | 0% | 32% | 39% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
LibTest/async9% | 0% | 21% | 30% | 38%
Utils0% | 24% | 25% | 16% | 33%
LibTest/ffi0% | 4% | 24% | 48% | 22%
LibTest/typed_data0% | 1% | 17% | 18% | 61%
LanguageFeatures/Subtyping0% | 26% | 23% | 29% | 20%
LibTest/io0% | 1% | 41% | 21% | 35%
LanguageFeatures/Constructor-tear-offs0% | 10% | 5% | 18% | 66%
Language/Statements0% | 0% | 45% | 31% | 22%
LibTest/isolate0% | 0% | 17% | 43% | 39%
LibTest/collection0% | 0% | 13% | 24% | 62%
LibTest/core0% | 0% | 7% | 41% | 51%
LanguageFeatures/nnbd0% | 0% | 2% | 2% | 95%
LibTest/html0% | 0% | 12% | 9% | 77%
ROOT0% | 0% | 32% | 39% | 28%
LanguageFeatures/Instantiate-to-bound0% | 0% | 6% | 76% | 17%
Language/Expressions0% | 0% | 0% | 10% | 89%
LanguageFeatures/Spread-collections0% | 0% | 0% | 46% | 53%
LanguageFeatures/int-to-double0% | 0% | 0% | 48% | 51%
Language/Types0% | 0% | 0% | 17% | 82%
LibTest/math0% | 0% | 0% | 9% | 90%
LanguageFeatures/FinalizationRegistry0% | 0% | 0% | 100% | 0%
Language/Functions0% | 0% | 0% | 4% | 95%
LanguageFeatures/Simple-bounds0% | 0% | 0% | 15% | 85%
LanguageFeatures/Super-mixins0% | 0% | 0% | 0% | 100%
Language/Classes0% | 0% | 0% | 0% | 100%
LanguageFeatures/Extension-methods0% | 0% | 0% | 0% | 100%
Language/Reference0% | 0% | 0% | 0% | 100%
LibTest/convert0% | 0% | 0% | 0% | 100%
LanguageFeatures/Generic-functions-as-type-args0% | 0% | 0% | 0% | 100%
Language/Generics0% | 0% | 0% | 0% | 100%
LanguageFeatures/Set-literals0% | 0% | 0% | 0% | 100%
Language/Interfaces0% | 0% | 0% | 0% | 100%
Language/Libraries_and_Scripts0% | 0% | 0% | 0% | 100%
LanguageFeatures/Enhanced-Enum0% | 0% | 0% | 0% | 100%
LanguageFeatures/Abstract-external-fields0% | 0% | 0% | 0% | 100%
Language/Errors_and_Warnings0% | 0% | 0% | 0% | 100%
Language/Overview0% | 0% | 0% | 0% | 100%
Language/Mixins0% | 0% | 0% | 0% | 100%
LibTest/mirrors0% | 0% | 0% | 0% | 100%
Language/Metadata0% | 0% | 0% | 0% | 100%
LanguageFeatures/Named-arguments-anywhere0% | 0% | 0% | 0% | 100%
Language/Variables0% | 0% | 0% | 0% | 100%
LanguageFeatures/regression0% | 0% | 0% | 0% | 100%
LanguageFeatures/Super-parameters0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void test()
in LibTest/async/Stream/allTests_A01.lib.dart
117 1 1
void generateTests()
in LanguageFeatures/Subtyping/generator/generator.dart
65 12 5
Future main()
in Utils/status_files_checker.dart
61 12 1
void main()
in LibTest/ffi/Array/Array.multi_A01_t01.dart
60 7 0
void check()
in LibTest/typed_data/ByteBuffer/asFloat32x4List_A02_t01.dart
55 5 1
void check()
in LibTest/typed_data/ByteBuffer/asInt32x4List_A02_t01.dart
55 5 1
Future checkExpend()
in LibTest/io/RawDatagramSocket/expand_A04_t01.dart
53 7 1
static void deepEquals()
in Utils/expect_common.dart
53 13 3
void main()
in LanguageFeatures/Constructor-tear-offs/summary_A02_t01.dart
52 1 0
void main()
in LibTest/ffi/Array/Array_A01_t03.dart
51 6 0
static Options read()
in Utils/status_files_checker.dart
50 12 1
Future checkEvery()
in LibTest/io/RawDatagramSocket/every_A02_t03.dart
49 6 1
void check()
in LibTest/typed_data/ByteBuffer/asFloat64x2List_A02_t01.dart
47 5 1
static void stringEquals()
in Utils/expect_common.dart
47 14 3
void check0()
in LibTest/collection/IterableMixin/IterableMixin_class_A01_t02.dart
46 1 1
Future checkDistant()
in LibTest/io/RawDatagramSocket/distinct_A02_t01.dart
46 4 0
void main()
in LibTest/ffi/IntPtr/IntPtr_A01_t02.dart
45 2 0
void check2()
in LibTest/collection/IterableMixin/IterableMixin_class_A01_t02.dart
43 1 1
void check1()
in LibTest/collection/IterableMixin/IterableMixin_class_A01_t02.dart
41 1 1
void test()
in LibTest/async/Stream/allTests_A02.lib.dart
39 1 1