android / ndk-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 2,903 units with 31,002 lines of code in units (34.3% of code).
    • 15 very long units (2,189 lines of code)
    • 46 long units (2,844 lines of code)
    • 247 medium size units (7,593 lines of code)
    • 446 small units (6,319 lines of code)
    • 2,149 very small units (12,057 lines of code)
7% | 9% | 24% | 20% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp6% | 16% | 40% | 18% | 17%
inl11% | 5% | 17% | 18% | 46%
java12% | 6% | 29% | 23% | 27%
c22% | 24% | 25% | 13% | 14%
h0% | 0% | 5% | 24% | 69%
kt0% | 0% | 27% | 17% | 55%
hpp0% | 0% | 0% | 4% | 95%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
endless-tunnel7% | 7% | 24% | 18% | 41%
nn-samples53% | 27% | 11% | 2% | 5%
teapots6% | 9% | 43% | 22% | 17%
gles3jni46% | 0% | 33% | 8% | 11%
native-audio68% | 0% | 0% | 14% | 16%
native-media25% | 26% | 26% | 4% | 18%
native-codec18% | 25% | 25% | 11% | 19%
display-p30% | 20% | 36% | 24% | 18%
camera0% | 11% | 42% | 15% | 30%
san-angeles0% | 29% | 33% | 16% | 20%
native-activity0% | 61% | 19% | 8% | 9%
hello-gl20% | 27% | 26% | 17% | 28%
audio-echo0% | 9% | 37% | 29% | 24%
webp0% | 26% | 53% | 12% | 7%
native-plasma0% | 26% | 28% | 22% | 22%
bitmap-plasma0% | 34% | 16% | 11% | 37%
prefab0% | 34% | 15% | 37% | 12%
hello-neon0% | 0% | 5% | 25% | 69%
native-midi0% | 0% | 24% | 19% | 56%
sensor-graph0% | 0% | 24% | 49% | 25%
hello-jniCallback0% | 0% | 28% | 37% | 34%
hello-oboe0% | 0% | 0% | 38% | 61%
hello-libs0% | 0% | 0% | 42% | 57%
other-builds0% | 0% | 0% | 34% | 65%
hello-jni0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
GLboolean gl3stubInit()
in gles3jni/app/src/main/cpp/gl3stub.c
216 105 0
protected void onCreate()
in native-audio/app/src/main/java/com/example/nativeaudio/NativeAudio.java
205 17 1
bool SimpleModel::CreateCompiledModel()
in nn-samples/basic/src/main/cpp/simple_model.cpp
196 21 0
public void onCreate()
in native-media/app/src/main/java/com/example/nativemedia/NativeMedia.java
180 28 1
bool SimpleSequenceModel::CreateModel()
in nn-samples/sequence/src/main/cpp/sequence_model.cpp
165 14 0
GLboolean gl3stubInit()
in teapots/common/ndk_helper/gl3stub.c
149 105 0
GLboolean gl3stubInit()
in teapots/common/ndk_helper/gl3stub.cpp
149 105 0
inl
GLM_FUNC_QUALIFIER T perlin()
in endless-tunnel/app/src/main/cpp/glm/gtc/noise.inl
121 1 1
inl
GLM_FUNC_QUALIFIER T perlin()
in endless-tunnel/app/src/main/cpp/glm/gtc/noise.inl
119 1 2
inl
GLM_FUNC_QUALIFIER void sse_inverse_ps()
in endless-tunnel/app/src/main/cpp/glm/detail/intrinsic_matrix.inl
118 1 2
inl
GLM_FUNC_QUALIFIER void sse_inverse_fast_ps()
in endless-tunnel/app/src/main/cpp/glm/detail/intrinsic_matrix.inl
118 1 2
public void onCreate()
in native-codec/app/src/main/java/com/example/nativecodec/NativeCodec.java
118 16 1
void MoreTeapotsRenderer::Init()
in teapots/more-teapots/src/main/cpp/MoreTeapotsRenderer.cpp
117 12 3
inl
GLM_FUNC_QUALIFIER __m128 sse_slow_det_ps()
in endless-tunnel/app/src/main/cpp/glm/detail/intrinsic_matrix.inl
114 1 1
bool SimpleSequenceModel::CreateOpaqueMemories()
in nn-samples/sequence/src/main/cpp/sequence_model.cpp
104 13 0
bool AssetTexture::CreateGLTextures()
in display-p3/image-view/src/main/cpp/AssetTexture.cpp
96 6 1
static bool DispatchSingleStep()
in nn-samples/sequence/src/main/cpp/sequence_model.cpp
90 8 11
private void printConfig()
in hello-gl2/app/src/main/java/com/android/gl2jni/GL2JNIView.java
83 4 3
bool SimpleModel::Compute()
in nn-samples/basic/src/main/cpp/simple_model.cpp
79 12 3
void PlayScene::DoFrame()
in endless-tunnel/app/src/main/cpp/play_scene.cpp
78 22 0