android / ndk-samples
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 2,903 units with 31,002 lines of code in units (34.3% of code).
    • 3 very complex units (514 lines of code)
    • 1 complex units (180 lines of code)
    • 27 medium complex units (2,036 lines of code)
    • 133 simple units (4,703 lines of code)
    • 2,739 very simple units (23,569 lines of code)
1% | <1% | 6% | 15% | 76%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
c22% | 0% | 4% | 19% | 53%
cpp1% | 0% | 13% | 32% | 52%
java0% | 4% | 8% | 13% | 73%
inl0% | 0% | 1% | 4% | 93%
h0% | 0% | 0% | 0% | 100%
hpp0% | 0% | 0% | 0% | 100%
kt0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
teapots4% | 0% | 4% | 26% | 64%
gles3jni46% | 0% | 0% | 27% | 26%
native-media0% | 25% | 10% | 20% | 44%
nn-samples0% | 0% | 62% | 24% | 13%
endless-tunnel0% | 0% | 6% | 12% | 81%
native-audio0% | 0% | 68% | 0% | 31%
native-codec0% | 0% | 27% | 24% | 47%
native-activity0% | 0% | 61% | 19% | 18%
camera0% | 0% | 6% | 25% | 68%
display-p30% | 0% | 4% | 35% | 59%
audio-echo0% | 0% | 0% | 25% | 74%
webp0% | 0% | 0% | 66% | 33%
native-plasma0% | 0% | 0% | 42% | 57%
san-angeles0% | 0% | 0% | 15% | 84%
bitmap-plasma0% | 0% | 0% | 34% | 65%
hello-gl20% | 0% | 0% | 18% | 81%
prefab0% | 0% | 0% | 34% | 65%
hello-neon0% | 0% | 0% | 0% | 100%
native-midi0% | 0% | 0% | 0% | 100%
sensor-graph0% | 0% | 0% | 0% | 100%
hello-jniCallback0% | 0% | 0% | 0% | 100%
hello-oboe0% | 0% | 0% | 0% | 100%
other-builds0% | 0% | 0% | 0% | 100%
hello-libs0% | 0% | 0% | 0% | 100%
hello-jni0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
GLboolean gl3stubInit()
in gles3jni/app/src/main/cpp/gl3stub.c
216 105 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
public void onCreate()
in native-media/app/src/main/java/com/example/nativemedia/NativeMedia.java
180 28 1
inl
GLM_FUNC_QUALIFIER double nextafter()
in endless-tunnel/app/src/main/cpp/glm/gtc/ulp.inl
47 23 2
void PlayScene::DoFrame()
in endless-tunnel/app/src/main/cpp/play_scene.cpp
78 22 0
bool SimpleModel::CreateCompiledModel()
in nn-samples/basic/src/main/cpp/simple_model.cpp
196 21 0
void NativeEngine::HandleCommand()
in endless-tunnel/app/src/main/cpp/native_engine.cpp
74 18 1
void PlayScene::DetectCollisions()
in endless-tunnel/app/src/main/cpp/play_scene.cpp
64 17 1
protected void onCreate()
in native-audio/app/src/main/java/com/example/nativeaudio/NativeAudio.java
205 17 1
bool NDKCamera::MatchCaptureSizeRequest()
in camera/texture-view/src/main/cpp/camera_manager.cpp
56 17 4
void doCodecWork()
in native-codec/app/src/main/cpp/native-codec-jni.cpp
57 16 1
public void onCreate()
in native-codec/app/src/main/java/com/example/nativecodec/NativeCodec.java
118 16 1
void Obstacle::PutRandomBonus()
in endless-tunnel/app/src/main/cpp/obstacle.cpp
37 15 0
float Interpolator::GetFormula()
in teapots/common/ndk_helper/interpolator.cpp
51 15 5
static int engine_init_display()
in native-activity/app/src/main/cpp/main.cpp
66 14 1
void UiWidget::Render()
in endless-tunnel/app/src/main/cpp/ui_scene.cpp
33 14 5
bool SimpleSequenceModel::CreateModel()
in nn-samples/sequence/src/main/cpp/sequence_model.cpp
165 14 0
bool NDKCamera::MatchCaptureSizeRequest()
in camera/basic/src/main/cpp/camera_manager.cpp
53 14 3
inl
GLM_FUNC_QUALIFIER float nextafterf()
in endless-tunnel/app/src/main/cpp/glm/gtc/ulp.inl
42 13 2