android / connectivity-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 745 units with 7,387 lines of code in units (63.7% of code).
    • 1 very complex units (149 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (209 lines of code)
    • 35 simple units (1,173 lines of code)
    • 705 very simple units (5,856 lines of code)
2% | 0% | 2% | 15% | 79%
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
cpp7% | 0% | 2% | 35% | 54%
java0% | 0% | 3% | 10% | 86%
kt0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
NearbyConnectionsCpp5% | 0% | 1% | 27% | 64%
NearbyConnectionsWalkieTalkie0% | 0% | 8% | 3% | 87%
BluetoothChat0% | 0% | 5% | 14% | 80%
BluetoothAdvertisements0% | 0% | 0% | 16% | 83%
BluetoothLeGatt0% | 0% | 0% | 10% | 89%
BeamLargeFiles0% | 0% | 0% | 14% | 85%
NetworkConnect0% | 0% | 0% | 21% | 78%
NearbyConnectionsRockPaperScissors0% | 0% | 0% | 2% | 97%
BluetoothLeChat0% | 0% | 0% | 0% | 100%
WifiRttScan0% | 0% | 0% | 0% | 100%
BluetoothAdvertisementsKotlin0% | 0% | 0% | 0% | 100%
CronetKotlin0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
GLboolean gl3stubInit()
in NearbyConnectionsCpp/app/src/main/cpp/ndk_helper/gl3stub.cpp
149 105 0
private void onStateChanged()
in NearbyConnectionsWalkieTalkie/app/src/manual/java/com/google/location/nearby/apps/walkietalkie/MainActivity.java
69 21 2
void JUIView::RestoreParameters()
in NearbyConnectionsCpp/app/src/main/cpp/jui_helper/JavaUI.cpp
56 20 1
public void handleMessage()
in BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java
43 12 1
private void onStateChanged()
in NearbyConnectionsWalkieTalkie/app/src/automatic/java/com/google/location/nearby/apps/walkietalkie/MainActivity.java
41 11 2
void JUIDialog::RestoreParameters()
in NearbyConnectionsCpp/app/src/main/cpp/jui_helper/JavaUI_Dialog.cpp
42 10 1
void Engine::RemoveConnectionEndpoint()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyConnection.cpp
26 10 2
void Engine::OnMessageReceivedCallback()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyConnection.cpp
54 9 4
void Engine::UpdatePlayerScore()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyConnection.cpp
35 9 3
void Engine::InitUI()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyNativeActivity.cpp
70 9 0
void Engine::HandleCmd()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyNativeActivity_Engine.cpp
38 9 2
void GFKSimple::Init()
in NearbyConnectionsCpp/app/src/main/cpp/GFKSimpleGame.cpp
37 9 1
public void println()
in BeamLargeFiles/Application/src/main/java/com/example/android/common/logger/LogView.java
44 9 4
public void run()
in BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java
34 9 0
public void println()
in BluetoothChat/Application/src/main/java/com/example/android/common/logger/LogView.java
44 9 4
public void start()
in NearbyConnectionsWalkieTalkie/app/src/main/java/com/google/location/nearby/apps/walkietalkie/AudioRecorder.java
50 8 0
void Engine::DebugDumpConnections()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyConnection.cpp
19 8 1
void Engine::EnableUI()
in NearbyConnectionsCpp/app/src/main/cpp/NearbyNativeActivity.cpp
32 8 1
public boolean connect()
in BluetoothLeGatt/Application/src/main/java/com/example/android/bluetoothlegatt/BluetoothLeService.java
26 8 1
public void onActivityResult()
in BluetoothChat/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java
26 8 3