android / views-widgets-samples
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 791 units with 6,798 lines of code in units (62.1% of code).
    • 3 very long units (342 lines of code)
    • 5 long units (382 lines of code)
    • 66 medium size units (1,987 lines of code)
    • 91 small units (1,326 lines of code)
    • 626 very small units (2,761 lines of code)
5% | 5% | 29% | 19% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java6% | 6% | 32% | 18% | 36%
kt0% | 4% | 20% | 21% | 53%
js0% | 0% | 0% | 44% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ConstraintLayoutExamples11% | 10% | 30% | 23% | 25%
RecyclerViewKotlin0% | 27% | 11% | 12% | 48%
AnimationsInterpolatorPlayground0% | 0% | 72% | 8% | 18%
SwipeRefreshMultipleViews0% | 0% | 20% | 24% | 54%
SwipeRefreshLayoutBasic0% | 0% | 22% | 21% | 56%
RecyclerView0% | 0% | 33% | 12% | 54%
MultiWindowPlayground0% | 0% | 25% | 3% | 71%
ViewPager20% | 0% | 22% | 26% | 51%
SimpleTransition0% | 0% | 78% | 21% | 0%
CardView0% | 0% | 58% | 0% | 41%
DataBindingDataBoundList0% | 0% | 16% | 33% | 50%
DataBindingDataBoundRecyclerView0% | 0% | 15% | 6% | 78%
MultiWindowPlaygroundKotlin0% | 0% | 12% | 0% | 87%
CardViewKotlin0% | 0% | 0% | 36% | 63%
WebView0% | 0% | 0% | 44% | 55%
RecyclerViewSimple0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public CycleEdit()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleEdit.java
123 1 3
public void paint()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleView.java
115 21 3
public void parseXML()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleModel.java
104 25 1
public void paint()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/AnimationPanel.java
99 12 1
public void parse()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleSetModel.java
85 21 0
fun flowerList()
in RecyclerViewKotlin/app/src/main/java/com/example/recyclersample/data/Flowers.kt
70 1 1
void updateUIelements()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleModel.java
67 7 0
private HashSet preParse()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleSetModel.java
61 16 1
public double getLength2D()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/MonotoneSpline.java
48 8 1
private void createParamaterizedInterpolator()
in AnimationsInterpolatorPlayground/app/src/main/java/com/example/android/interpolatorplayground/MainActivity.java
47 3 6
public boolean onTouchEvent()
in AnimationsInterpolatorPlayground/app/src/main/java/com/example/android/interpolatorplayground/CurveVisualizer.java
47 16 1
public void println()
in SwipeRefreshMultipleViews/Application/src/main/java/com/example/android/common/logger/LogView.java
44 9 4
public void println()
in SwipeRefreshLayoutBasic/Application/src/main/java/com/example/android/common/logger/LogView.java
44 9 4
public void println()
in RecyclerView/Application/src/main/java/com/example/android/common/logger/LogView.java
44 9 4
private void populateParametersUI()
in AnimationsInterpolatorPlayground/app/src/main/java/com/example/android/interpolatorplayground/MainActivity.java
44 11 2
public void println()
in MultiWindowPlayground/Application/src/main/java/com/example/android/common/logger/LogView.java
44 9 4
private void createCubicPathInterpolator()
in AnimationsInterpolatorPlayground/app/src/main/java/com/example/android/interpolatorplayground/MainActivity.java
43 1 1
public MonotoneSpline()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/MonotoneSpline.java
38 8 2
public void setCycle()
in ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/CycleView.java
37 4 7
private void alignButtons()
in SimpleTransition/app/src/main/java/com/android/example/simpletransition/MainActivity.java
36 9 2