dart-lang / mockito
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 89 units with 1,638 lines of code in units (70.2% of code).
    • 1 very long units (122 lines of code)
    • 6 long units (350 lines of code)
    • 19 medium size units (612 lines of code)
    • 21 small units (338 lines of code)
    • 42 very small units (216 lines of code)
7% | 21% | 37% | 20% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart7% | 21% | 37% | 20% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
example94% | 0% | 0% | 0% | 5%
lib/src0% | 23% | 41% | 22% | 12%
example/iss0% | 0% | 0% | 45% | 54%
lib0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void main()
in example/example.dart
122 1 0
72 22 2
void _buildOverridingMethod()
in lib/src/builder.dart
61 16 2
56 10 2
Expression _dummyValue()
in lib/src/builder.dart
56 18 1
List _checkFunction()
in lib/src/builder.dart
53 13 5
Reference _typeReference()
in lib/src/builder.dart
52 13 2
Class _buildMockClass()
in lib/src/builder.dart
50 8 0
Future build()
in lib/src/builder.dart
45 5 1
void _checkClassesToMockAreValid()
in lib/src/builder.dart
44 6 0
38 5 1
37 6 1
void _addType()
in lib/src/builder.dart
35 13 1
void _addTypesFromConstant()
in lib/src/builder.dart
35 16 1
String toPrettyString()
in lib/src/mock.dart
35 9 0
bool _isArgumentsMatches()
in lib/src/mock.dart
32 9 1
Verification _makeVerify()
in lib/src/mock.dart
31 5 1
dynamic noSuchMethod()
in lib/src/mock.dart
30 5 3
void _checkMethodsToStubAreValid()
in lib/src/builder.dart
29 6 1
Parameter _matchingParameter()
in lib/src/builder.dart
29 6 3