flutter / cocoon
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 953 units with 11,807 lines of code in units (55.2% of code).
    • 2 very long units (217 lines of code)
    • 26 long units (1,749 lines of code)
    • 128 medium size units (3,969 lines of code)
    • 188 small units (2,741 lines of code)
    • 609 very small units (3,131 lines of code)
1% | 14% | 33% | 23% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart1% | 15% | 33% | 22% | 26%
go0% | 18% | 46% | 18% | 15%
cpp0% | 0% | 40% | 35% | 24%
cc0% | 0% | 52% | 20% | 27%
swift0% | 0% | 0% | 85% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
app_dart/lib2% | 15% | 34% | 25% | 23%
release_dashboard/lib7% | 23% | 36% | 8% | 24%
dashboard/lib0% | 16% | 29% | 22% | 31%
repo_dashboard/lib0% | 14% | 31% | 18% | 35%
oneoff/cirrus_stats0% | 18% | 46% | 18% | 15%
device_doctor/lib0% | 0% | 20% | 55% | 23%
dashboard/windows0% | 0% | 40% | 35% | 24%
licenses0% | 0% | 63% | 11% | 25%
app_dart/dev0% | 0% | 50% | 50% | 0%
dashboard/linux0% | 0% | 54% | 20% | 24%
release_dashboard/linux0% | 0% | 50% | 19% | 30%
device_doctor/tool0% | 0% | 0% | 100% | 0%
app_dart/integration_test0% | 0% | 0% | 0% | 100%
release_dashboard/macos0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Future _sendStatusUpdates()
in app_dart/lib/src/request_handlers/push_gold_status_to_github.dart
114 26 2
Widget build()
in release_dashboard/lib/widgets/merge_pr_substeps.dart
103 11 1
TestOwnership getTestOwnership()
in app_dart/lib/src/request_handlers/flaky_handler_utils.dart
100 32 3
Widget build()
in release_dashboard/lib/widgets/cherrypicks_substeps.dart
92 8 1
Widget _settingsDialog()
in dashboard/lib/build_dashboard_page.dart
92 4 2
Widget build()
in dashboard/lib/widgets/task_overlay.dart
87 10 1
factory Task()
in dashboard/lib/model/task.pb.dart
81 20 20
Future post()
in app_dart/lib/src/request_handlers/reset_prod_task.dart
80 9 0
Future service()
in app_dart/lib/src/request_handling/subscription_handler.dart
78 7 2
Future _checkStatuses()
in app_dart/lib/src/request_handlers/check_for_waiting_pull_requests.dart
77 19 8
Future fetchBuildStatus()
in repo_dashboard/lib/services/build_status_service.dart
76 18 1
Widget build()
in repo_dashboard/lib/details/roll.dart
72 1 1
query LabeledPullRequcodeestsWithReviews()
in app_dart/lib/src/request_handlers/check_for_waiting_pull_requests_queries.dart
69 1 3
Widget build()
in release_dashboard/lib/widgets/progression.dart
68 7 1
Widget build()
in dashboard/lib/widgets/commit_box.dart
67 2 1
Future triggerPresubmitTargets()
in app_dart/lib/src/service/scheduler.dart
61 4 3
Widget build()
in repo_dashboard/lib/repository.dart
59 4 1
RenderBox updateLatticeChild()
in dashboard/lib/widgets/lattice.dart
58 8 3
factory Target()
in app_dart/lib/src/model/proto/internal/scheduler.pb.dart
57 14 7
Widget build()
in release_dashboard/lib/widgets/create_release_substeps.dart
56 5 1