flutter / codelabs
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 2,914 units with 32,631 lines of code in units (55.0% of code).
    • 1 very long units (107 lines of code)
    • 75 long units (4,776 lines of code)
    • 408 medium size units (12,652 lines of code)
    • 467 small units (6,462 lines of code)
    • 1,963 very small units (8,634 lines of code)
<1% | 14% | 38% | 19% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart<1% | 18% | 39% | 15% | 25%
ts0% | 34% | 14% | 21% | 29%
cpp0% | 0% | 36% | 38% | 25%
cc0% | 0% | 48% | 20% | 30%
java0% | 0% | 62% | 0% | 37%
c0% | 0% | 60% | 18% | 21%
swift0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
webview_flutter7% | 36% | 29% | 9% | 16%
firebase-get-to-know-flutter0% | 57% | 21% | 11% | 10%
dartpad_codelabs0% | 20% | 42% | 6% | 30%
cupertino_store0% | 21% | 43% | 4% | 30%
in_app_purchases0% | 6% | 30% | 30% | 33%
star_counter0% | 26% | 15% | 32% | 25%
photos-sharing0% | 4% | 45% | 22% | 27%
adaptive_app0% | 0% | 44% | 32% | 23%
startup_namer0% | 0% | 38% | 34% | 26%
friendly_chat0% | 0% | 45% | 26% | 28%
github-client0% | 0% | 45% | 25% | 28%
testing_codelab0% | 0% | 47% | 29% | 23%
plugin_codelab0% | 0% | 51% | 17% | 31%
cookbook0% | 0% | 42% | 32% | 25%
google-maps-in-flutter0% | 0% | 17% | 47% | 34%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Widget build()
in webview_flutter/step_12/lib/src/menu.dart
107 13 1
Widget build()
in firebase-get-to-know-flutter/step_04/lib/src/authentication.dart
90 5 1
Widget build()
in firebase-get-to-know-flutter/step_05/lib/src/authentication.dart
90 5 1
Widget build()
in firebase-get-to-know-flutter/step_02/lib/src/authentication.dart
90 5 1
Widget build()
in firebase-get-to-know-flutter/step_09/lib/src/authentication.dart
90 5 1
Widget build()
in firebase-get-to-know-flutter/step_07/lib/src/authentication.dart
90 5 1
Widget build()
in firebase-get-to-know-flutter/step_06/lib/src/authentication.dart
90 5 1
Widget build()
in webview_flutter/step_11/lib/src/menu.dart
86 10 1
Widget build()
in cupertino_store/step_04/lib/product_row_item.dart
75 2 1
Widget build()
in cupertino_store/step_05/lib/product_row_item.dart
75 2 1
Widget build()
in cupertino_store/step_02/lib/product_row_item.dart
75 2 1
Widget build()
in cupertino_store/step_03/lib/product_row_item.dart
75 2 1
Widget build()
in cupertino_store/step_06/lib/product_row_item.dart
75 2 1
SliverChildBuilderDelegate _buildSliverChildBuilderDelegate()
in cupertino_store/step_06/lib/shopping_cart_tab.dart
72 8 1
Widget build()
in dartpad_codelabs/src/getting_started_with_slivers/step_04/solution.dart
72 1 1
Widget build()
in dartpad_codelabs/src/getting_started_with_slivers/step_05/solution.dart
72 1 1
Widget build()
in dartpad_codelabs/src/getting_started_with_slivers/step_05/snippet.dart
72 1 1
Widget build()
in dartpad_codelabs/src/getting_started_with_slivers/step_08/snippet.dart
72 1 1
Widget build()
in dartpad_codelabs/src/getting_started_with_slivers/step_07/solution.dart
72 1 1
Widget build()
in dartpad_codelabs/src/getting_started_with_slivers/step_07/snippet.dart
72 1 1