dart-lang / gcloud
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 186 units with 1,495 lines of code in units (45.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (112 lines of code)
    • 10 medium size units (282 lines of code)
    • 30 small units (417 lines of code)
    • 144 very small units (684 lines of code)
0% | 7% | 18% | 27% | 45%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 7% | 18% | 27% | 45%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 19% | 8% | 23% | 48%
lib/src/db0% | 0% | 28% | 35% | 35%
lib0% | 0% | 18% | 14% | 66%
example0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static Future runQuery()
in lib/src/datastore_impl.dart
60 19 5
Future commit()
in lib/src/datastore_impl.dart
52 9 5
Future _commitHelper()
in lib/src/db/db.dart
47 9 4
Map _propertiesFromModelDescription()
in lib/src/db/model_db_impl.dart
42 8 1
Stream run()
in lib/src/db/db.dart
30 6 0
26 9 1
26 12 1
Future _runScopeExitHandlers()
in lib/service_scope.dart
24 4 0
Key fromDatastoreKey()
in lib/src/db/model_db_impl.dart
23 5 1
bool _compareApiKey()
in lib/src/datastore_impl.dart
22 11 2
void _initialize()
in lib/src/db/model_db_impl.dart
21 5 1
void _tryLoadNewModelClass()
in lib/src/db/model_db_impl.dart
21 8 1
void _tryLoadNewModelClassFull()
in lib/src/db/model_db_impl.dart
19 3 3
void _encodeProperty()
in lib/src/db/model_db_impl.dart
18 2 6
ObjectMetadata replace()
in lib/src/storage_impl.dart
17 2 7
T? fromDatastoreEntity()
in lib/src/db/model_db_impl.dart
17 4 1
void initialize()
in lib/src/db/model_db_impl.dart
17 2 1
void _decodeProperty()
in lib/src/db/model_db_impl.dart
17 3 5
static Future _handleError()
in lib/src/datastore_impl.dart
17 5 2
void _onData()
in lib/src/storage_impl.dart
16 3 1