android / performance-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 56 units with 395 lines of code in units (30.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 0 simple units (0 lines of code)
    • 56 very simple units (395 lines of code)
0% | 0% | 0% | 0% | 100%
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
kt0% | 0% | 0% | 0% | 100%
cpp0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
JankStatsSample/app/src/main0% | 0% | 0% | 0% | 100%
BenchmarkNdkSample/benchmark/cpp/googlebenchmarkrunner0% | 0% | 0% | 0% | 100%
ConstraintLayoutPerformance/app/src/main0% | 0% | 0% | 0% | 100%
MacrobenchmarkSample/macrobenchmark/src/main0% | 0% | 0% | 0% | 100%
BenchmarkSample/ui/src/main0% | 0% | 0% | 0% | 100%
BenchmarkNdkSample/benchmark/cpp/benchmark0% | 0% | 0% | 0% | 100%
MacrobenchmarkSample/functions/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fun bubbleSort()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/ui/SortingAlgorithms.kt
9 4 1
fun simulateJank()
in JankStatsSample/app/src/main/java/com/example/jankstats/tools/simulateJank.kt
17 4 2
export function log()
in MacrobenchmarkSample/functions/src/logger.ts
10 4 2
override fun doInBackground()
in ConstraintLayoutPerformance/app/src/main/java/com/example/android/perf/MainActivity.kt
10 3 1
void ReportRuns()
in BenchmarkNdkSample/benchmark/cpp/googlebenchmarkrunner/googlebenchmarkrunner.cpp
22 3 1
override fun onSupportNavigateUp()
in JankStatsSample/app/src/main/java/com/example/jankstats/JankLoggingActivity.kt
3 2 0
override fun onSupportNavigateUp()
in JankStatsSample/app/src/main/java/com/example/jankstats/JankAggregatorActivity.kt
3 2 0
void getBenchmarks()
in BenchmarkNdkSample/benchmark/cpp/googlebenchmarkrunner/googlebenchmarkrunner.cpp
14 2 1
void notifyTestStarted()
in BenchmarkNdkSample/benchmark/cpp/googlebenchmarkrunner/googlebenchmarkrunner.cpp
8 2 0
static void BM_Atomic()
in BenchmarkNdkSample/benchmark/cpp/benchmark/SampleBenchmarks.cpp
7 2 1
static void BM_Empty()
in BenchmarkNdkSample/benchmark/cpp/benchmark/SampleBenchmarks.cpp
4 2 1
static void BM_Skip()
in BenchmarkNdkSample/benchmark/cpp/benchmark/SampleBenchmarks.cpp
4 2 1
static void BM_memcpy()
in BenchmarkNdkSample/benchmark/cpp/benchmark/SampleBenchmarks.cpp
13 2 1
fun bind()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/ui/Holder.kt
3 1 1
fun create()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/ui/Holder.kt
4 1 1
override fun onCreate()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/ui/MainActivity.kt
6 1 1
override fun onCreateViewHolder()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/ui/SampleAdapter.kt
3 1 2
override fun onBindViewHolder()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/ui/SampleAdapter.kt
3 1 2
fun doSomeWork()
in BenchmarkSample/ui/src/main/java/com/example/benchmark/data/SomeWork.kt
3 1 0
override fun onCreate()
in ConstraintLayoutPerformance/app/src/main/java/com/example/android/perf/MainActivity.kt
31 1 1