dart-lang / site-www
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 133 units with 1,394 lines of code in units (21.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (94 lines of code)
    • 11 medium size units (321 lines of code)
    • 32 small units (450 lines of code)
    • 89 very small units (529 lines of code)
0% | 6% | 23% | 32% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 15% | 25% | 35% | 23%
rb0% | 0% | 34% | 23% | 41%
js0% | 0% | 0% | 40% | 59%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/get-dart0% | 20% | 15% | 31% | 32%
src/_plugins0% | 0% | 34% | 23% | 41%
tool0% | 0% | 56% | 38% | 4%
tool/dartpad_picker0% | 0% | 13% | 42% | 43%
src/assets0% | 0% | 0% | 46% | 53%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void updateTable()
in src/get-dart/dart_sdk_archive/lib/src/version_selector.dart
94 25 1
compress_command
in src/_plugins/asset_bundler.rb
46 10 1
self.config
in src/_plugins/asset_bundler.rb
42 12 1
load_content
in src/_plugins/asset_bundler.rb
35 9 1
List srcHtmlWithTips()
in tool/create_code_with_tooltips.dart
29 7 0
String processTipInstruction()
in tool/create_code_with_tooltips.dart
28 5 3
Future runApp()
in src/get-dart/dart_sdk_archive/lib/src/run_app.dart
27 1 0
render
in src/_plugins/render.rb
26 7 1
static VersionInfo parse()
in src/get-dart/sdk_builds.dart/lib/src/version_info.dart
24 3 3
void filterTable()
in src/get-dart/dart_sdk_archive/lib/src/version_selector.dart
22 5 0
void main()
in tool/dartpad_picker/web/dartpad_picker_main.dart
21 4 0
render
in src/_plugins/asset_bundler.rb
21 3 1
remote_asset_cache
in src/_plugins/asset_bundler.rb
19 3 1
void _initDartPad()
in tool/dartpad_picker/lib/dartpad_picker.dart
18 5 0
Future createDownloadLink()
in src/get-dart/sdk_builds.dart/lib/src/dart_downloads.dart
17 5 3
Future init()
in src/get-dart/dart_sdk_archive/lib/src/version_selector.dart
17 2 0
function setupOsTabs()
in src/assets/js/os-tabs.js
17 4 0
initialize
in src/_plugins/asset_bundler.rb
17 2 3
render
in src/_plugins/code_sample.rb
17 2 1
Stream fetchVersionPaths()
in src/get-dart/sdk_builds.dart/lib/src/dart_downloads.dart
16 4 1