dart-lang / webdev
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 545 units with 7,732 lines of code in units (58.6% of code).
    • 3 very long units (328 lines of code)
    • 28 long units (1,814 lines of code)
    • 76 medium size units (2,263 lines of code)
    • 116 small units (1,660 lines of code)
    • 322 very small units (1,667 lines of code)
4% | 23% | 29% | 21% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart4% | 23% | 29% | 21% | 21%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
webdev/lib18% | 20% | 29% | 18% | 13%
dwds/web33% | 0% | 31% | 14% | 20%
dwds/lib0% | 23% | 28% | 26% | 21%
frontend_server_common/lib0% | 29% | 29% | 19% | 21%
frontend_server_client/lib0% | 38% | 23% | 14% | 24%
frontend_server_client/example0% | 85% | 0% | 0% | 14%
dwds/debug_extension0% | 24% | 35% | 16% | 23%
fixtures/_testSound0% | 0% | 55% | 16% | 28%
fixtures/_test0% | 0% | 54% | 16% | 28%
example/web0% | 0% | 48% | 14% | 36%
fixtures/_webdevSmoke0% | 0% | 50% | 15% | 34%
fixtures/_testPackageSound0% | 0% | 31% | 0% | 68%
fixtures/_testPackage0% | 0% | 32% | 0% | 67%
fixtures/_webdevSoundSmoke0% | 0% | 0% | 100% | 0%
dwds/tool0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Future main()
in dwds/web/client.dart
115 25 0
static Future start()
in webdev/lib/src/serve/webdev_server.dart
107 13 2
static Configuration fromArgs()
in webdev/lib/src/command/configuration.dart
106 27 2
Future compile()
in frontend_server_client/lib/src/frontend_server_client.dart
97 21 1
static Future start()
in dwds/lib/dwds.dart
89 6 20
static Future create()
in dwds/lib/src/dwds_vm_client.dart
86 5 2
Future _startSseClient()
in dwds/debug_extension/web/background.dart
81 13 6
Future _pauseHandler()
in dwds/lib/src/debugging/debugger.dart
76 14 1
void main()
in frontend_server_client/example/web_client.dart
74 6 1
Future _startLocalDebugService()
in dwds/lib/src/handlers/dev_handler.dart
72 12 2
void handler()
in frontend_server_common/lib/src/frontend_server_client.dart
72 16 1
Future update()
in frontend_server_common/lib/src/devfs.dart
71 5 6
Future run()
in webdev/lib/src/command/build_command.dart
69 11 0
Future _instanceRefForRemote()
in dwds/lib/src/debugging/instance.dart
68 12 1
static Future start()
in dwds/lib/src/services/debug_service.dart
68 5 9
List write()
in frontend_server_common/lib/src/asset_server.dart
67 9 4
void _handleConnection()
in dwds/lib/src/handlers/dev_handler.dart
64 16 1
Future _compile()
in frontend_server_common/lib/src/frontend_server_client.dart
61 10 3
void main()
in frontend_server_client/example/vm_client.dart
58 3 1
Future run()
in webdev/lib/src/command/daemon_command.dart
57 7 0