dart-lang / pub_semver
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 32 units with 593 lines of code in units (59.5% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (201 lines of code)
    • 6 medium size units (169 lines of code)
    • 10 small units (138 lines of code)
    • 13 very small units (85 lines of code)
0% | 33% | 28% | 23% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 33% | 28% | 23% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 34% | 28% | 23% | 12%
example0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
VersionConstraint difference()
in lib/src/version_range.dart
94 27 1
VersionConstraint union()
in lib/src/version_range.dart
56 17 1
VersionConstraint difference()
in lib/src/version_union.dart
51 19 1
VersionConstraint intersect()
in lib/src/version_range.dart
43 14 1
String toString()
in lib/src/version_range.dart
33 14 0
VersionRange? matchComparison()
in lib/src/version_constraint.dart
26 7 0
int _compareLists()
in lib/src/version.dart
23 10 2
factory VersionRange()
in lib/src/version_range.dart
22 12 5
VersionConstraint union()
in lib/src/version.dart
22 5 1
VersionConstraint intersect()
in lib/src/version_union.dart
19 7 1
bool allowsAny()
in lib/src/version_union.dart
17 5 1
int compareTo()
in lib/src/version.dart
16 14 1
VersionConstraint? matchCompatibleWith()
in lib/src/version_constraint.dart
15 4 0
bool allowsAll()
in lib/src/version_union.dart
14 4 1
int compareTo()
in lib/src/version_range.dart
12 7 1
int _compareMax()
in lib/src/version_range.dart
12 7 1
bool allows()
in lib/src/version_range.dart
11 9 1
bool allowsAll()
in lib/src/version_range.dart
11 6 1
bool allowsAny()
in lib/src/version_range.dart
11 6 1
static Version primary()
in lib/src/version.dart
10 6 1