flutter / platform_tests
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 30 units with 474 lines of code in units (43.7% of code).
    • 1 very long units (233 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (79 lines of code)
    • 3 small units (44 lines of code)
    • 24 very small units (118 lines of code)
49% | 0% | 16% | 9% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart67% | 0% | 14% | 6% | 11%
java0% | 0% | 32% | 21% | 45%
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
ios_widget_catalog_compare/lib90% | 0% | 0% | 0% | 9%
scroll_overlay/lib0% | 0% | 56% | 27% | 16%
scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay0% | 0% | 32% | 21% | 45%
ios_widget_catalog_compare/ios/Runner0% | 0% | 0% | 0% | 100%
scroll_overlay/ios/Runner0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Widget widgetPicker()
in ios_widget_catalog_compare/lib/main.dart
233 18 1
Widget build()
in scroll_overlay/lib/main.dart
49 1 1
public void onCreate()
in scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay/ScrollOverlayActivity.java
30 1 1
public View getView()
in scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay/ScrollOverlayActivity.java
20 2 3
void initState()
in scroll_overlay/lib/main.dart
13 3 0
void main()
in scroll_overlay/lib/main.dart
11 1 0
Widget build()
in ios_widget_catalog_compare/lib/main.dart
10 1 1
void main()
in ios_widget_catalog_compare/lib/main.dart
8 1 0
void initState()
in ios_widget_catalog_compare/lib/main.dart
7 2 0
func makeUIView()
in ios_widget_catalog_compare/ios/Runner/OverlaySwiftUIView.swift
7 1 1
public void onBackPressed()
in scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay/ScrollOverlayActivity.java
7 2 0
InstrumentingScrollPhysics applyTo()
in scroll_overlay/lib/main.dart
6 1 1
protected void onDestroy()
in scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay/ScrollOverlayActivity.java
6 2 0
protected void onStop()
in scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay/ScrollOverlayActivity.java
6 2 0
protected void onStart()
in scroll_overlay/android/app/src/main/java/io/flutter/scroll_overlay/ScrollOverlayActivity.java
6 2 0
func onListen()
in ios_widget_catalog_compare/ios/Runner/OverlayFlutterViewController.swift
5 1 2
func fallsInStackView()
in ios_widget_catalog_compare/ios/Runner/OverlayFlutterViewController.swift
5 1 2
int main()
in scroll_overlay/ios/Runner/main.m
5 1 2
Simulation createBallisticSimulation()
in scroll_overlay/lib/main.dart
4 1 2
double applyPhysicsToUserOffset()
in scroll_overlay/lib/main.dart
4 1 2