dart-lang / dart-services
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 294 units with 3,422 lines of code in units (45.3% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (499 lines of code)
    • 33 medium size units (969 lines of code)
    • 67 small units (1,048 lines of code)
    • 186 very small units (906 lines of code)
0% | 14% | 28% | 30% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 14% | 28% | 30% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 16% | 30% | 26% | 26%
tool0% | 29% | 22% | 36% | 11%
lib/src/protos0% | 0% | 30% | 33% | 36%
lib0% | 0% | 62% | 12% | 25%
benchmark0% | 0% | 36% | 0% | 63%
example/web0% | 0% | 0% | 70% | 29%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
72 9 3
Future testPath()
in tool/fuzz_driver.dart
70 13 3
Future compileDDC()
in lib/src/compiler.dart
68 9 1
Widget build()
in lib/src/common.dart
67 1 1
Future compile()
in lib/src/compiler.dart
63 8 3
Future buildFlutterProjectTemplate()
in lib/src/project_creator.dart
53 5 3
Future _compileDart2js()
in lib/src/common_server_impl.dart
53 8 3
Future main()
in tool/fuzz_driver.dart
53 11 1
factory VersionResponse()
in lib/src/protos/dart_services.pb.dart
49 12 12
factory AnalysisIssue()
in lib/src/protos/dart_services.pb.dart
45 11 11
Future analyze()
in lib/src/analysis_server.dart
45 4 1
Future _processRequest()
in lib/src/common_server_api.dart
44 6 2
Future _compileDDC()
in lib/src/common_server_impl.dart
41 5 1
Future complete()
in lib/src/analysis_server.dart
40 6 2
String mutate()
in tool/fuzz_driver.dart
39 3 1
Future init()
in lib/src/analysis_server.dart
38 5 0
void _reconnect()
in lib/src/server_cache.dart
35 4 1
Future main()
in lib/services_cloud_run.dart
34 3 1
Widget build()
in lib/src/common.dart
34 2 1
void main()
in benchmark/bench.dart
30 2 1