android / camera-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 225 units with 2,438 lines of code in units (35.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 36 medium size units (962 lines of code)
    • 45 small units (633 lines of code)
    • 143 very small units (791 lines of code)
0% | 2% | 39% | 25% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt0% | 2% | 38% | 25% | 33%
java0% | 0% | 42% | 27% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
CameraXBasic/app0% | 20% | 22% | 10% | 46%
HdrViewfinder/Application0% | 0% | 42% | 27% | 29%
Camera2Basic/utils0% | 0% | 68% | 10% | 21%
Camera2SlowMotion/utils0% | 0% | 68% | 10% | 21%
CameraUtils/lib0% | 0% | 68% | 10% | 21%
CameraXAdvanced/utils0% | 0% | 68% | 10% | 21%
Camera2Video/utils0% | 0% | 68% | 10% | 21%
CameraXVideo/utils0% | 0% | 68% | 10% | 21%
Camera2Extensions/app0% | 0% | 27% | 26% | 45%
Camera2Basic/app0% | 0% | 24% | 47% | 27%
CameraXAdvanced/tflite0% | 0% | 42% | 35% | 21%
Camera2SlowMotion/app0% | 0% | 16% | 38% | 44%
Camera2Video/app0% | 0% | 16% | 38% | 44%
CameraXVideo/app0% | 0% | 0% | 62% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
override fun onViewCreated()
in CameraXBasic/app/src/main/java/com/android/example/cameraxbasic/fragments/GalleryFragment.kt
52 4 2
private void findAndOpenCamera()
in HdrViewfinder/Application/src/main/java/com/example/android/hdrviewfinder/HdrViewfinderActivity.java
44 11 0
override fun onViewCreated()
in Camera2Extensions/app/src/main/java/com/example/android/camera2/extensions/fragments/CameraFragment.kt
39 4 2
public void onCaptureCompleted()
in HdrViewfinder/Application/src/main/java/com/example/android/hdrviewfinder/HdrViewfinderActivity.java
38 8 3
protected void onMeasure()
in HdrViewfinder/Application/src/main/java/com/example/android/hdrviewfinder/FixedAspectSurfaceView.java
35 12 2
override fun onCaptureCompleted()
in Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/CameraFragment.kt
32 6 3
private void configureSurfaces()
in HdrViewfinder/Application/src/main/java/com/example/android/hdrviewfinder/HdrViewfinderActivity.java
31 7 0
fun yuvToRgb()
in Camera2Basic/utils/src/main/java/com/example/android/camera/utils/YuvToRgbConverter.kt
30 2 2
override fun analyze()
in CameraXBasic/app/src/main/java/com/android/example/cameraxbasic/fragments/CameraFragment.kt
30 4 1
fun yuvToRgb()
in Camera2SlowMotion/utils/src/main/java/com/example/android/camera/utils/YuvToRgbConverter.kt
30 2 2
fun yuvToRgb()
in CameraUtils/lib/src/main/java/com/example/android/camera/utils/YuvToRgbConverter.kt
30 2 2
fun yuvToRgb()
in CameraXAdvanced/utils/src/main/java/com/example/android/camera/utils/YuvToRgbConverter.kt
30 2 2
fun yuvToRgb()
in Camera2Video/utils/src/main/java/com/example/android/camera/utils/YuvToRgbConverter.kt
30 2 2
fun yuvToRgb()
in CameraXVideo/utils/src/main/java/com/example/android/camera/utils/YuvToRgbConverter.kt
30 2 2
override fun onImageSaved()
in CameraXBasic/app/src/main/java/com/android/example/cameraxbasic/fragments/CameraFragment.kt
28 5 1
override fun onCreate()
in CameraXAdvanced/tflite/src/main/java/com/example/android/camerax/tflite/CameraActivity.kt
27 3 1
public void onRequestPermissionsResult()
in HdrViewfinder/Application/src/main/java/com/example/android/hdrviewfinder/HdrViewfinderActivity.java
26 4 3
override fun onCreateView()
in Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/SelectorFragment.kt
25 1 3
override fun onCreateView()
in Camera2SlowMotion/app/src/main/java/com/example/android/camera2/slowmo/fragments/SelectorFragment.kt
25 1 3
override fun onCreateView()
in Camera2Extensions/app/src/main/java/com/example/android/camera2/extensions/fragments/SelectorFragment.kt
25 1 3