android / android-test
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 943 units with 9,910 lines of code in units (61.7% of code).
    • 9 very long units (1,269 lines of code)
    • 19 long units (1,492 lines of code)
    • 69 medium size units (2,025 lines of code)
    • 130 small units (1,861 lines of code)
    • 716 very small units (3,263 lines of code)
12% | 15% | 20% | 18% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py27% | 20% | 18% | 14% | 19%
java4% | 11% | 21% | 21% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tools/android/emulator27% | 20% | 18% | 14% | 19%
tools/device_broker/java/com/google/android/apps/common/testing/suite14% | 18% | 11% | 23% | 31%
tools/device_broker/java/com/google/android/apps/common/testing/broker0% | 9% | 25% | 20% | 44%
tools/device_broker/java/com/google/android/apps/common/testing/testrunner0% | 0% | 0% | 0% | 100%
build_extensions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _PollEmulatorStatus()
in tools/android/emulator/emulated_device.py
178 15 3
def _InitializeRamdisk()
in tools/android/emulator/emulated_device.py
161 17 3
def Configure()
in tools/android/emulator/emulated_device.py
160 14 17
def _StageDataFiles()
in tools/android/emulator/emulated_device.py
159 11 14
protected DexClassData computeNext()
in tools/device_broker/java/com/google/android/apps/common/testing/suite/dex/DexDumpIterator.java
139 25 0
def _WatchdogLoop()
in tools/android/emulator/emulated_device.py
127 27 6
private static Iterator baseTestClasses()
in tools/device_broker/java/com/google/android/apps/common/testing/suite/dex/DumpUtils.java
118 1 0
def _Run()
in tools/android/emulator/unified_launcher.py
114 21 36
def _PrepareQemuArgs()
in tools/android/emulator/emulated_device.py
113 40 6
void runGoogleAndroidTestCase()
in tools/device_broker/java/com/google/android/apps/common/testing/suite/AndroidGoogleTest.java
99 18 0
private List runTest()
in tools/device_broker/java/com/google/android/apps/common/testing/broker/AdbController.java
99 14 9
private synchronized void runEmulatorLaunchScript()
in tools/device_broker/java/com/google/android/apps/common/testing/broker/WrappedEmulatedDeviceBroker.java
98 20 8
public boolean processLine()
in tools/device_broker/java/com/google/android/apps/common/testing/broker/InstrumentationTestRunnerProcessor.java
97 29 1
def _StartEmulator()
in tools/android/emulator/emulated_device.py
90 8 8
public void run()
in tools/device_broker/java/com/google/android/apps/common/testing/suite/dex/DumpUtils.java
89 22 0
def _MakeAvd()
in tools/android/emulator/emulated_device.py
89 9 1
public static TestSuitePb discoverTests()
in tools/device_broker/java/com/google/android/apps/common/testing/suite/dex/DumpUtils.java
83 8 1
def _FirstBootAtBuildTimeOnly()
in tools/android/emulator/unified_launcher.py
79 13 13
def _RestartDevice()
in tools/android/emulator/unified_launcher.py
77 9 15
def StoreAndCompressUserdata()
in tools/android/emulator/emulated_device.py
75 19 3