aws / aws-iot-device-sdk-cpp
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 350 units with 5,194 lines of code in units (56.2% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (707 lines of code)
    • 16 medium complex units (981 lines of code)
    • 33 simple units (1,140 lines of code)
    • 296 very simple units (2,366 lines of code)
0% | 13% | 18% | 21% | 45%
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
cpp0% | 13% | 19% | 22% | 44%
hpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
network/WebSocket0% | 32% | 0% | 22% | 44%
common0% | 93% | 0% | 0% | 6%
src/mqtt0% | 10% | 16% | 14% | 57%
src/discovery0% | 42% | 25% | 13% | 17%
src/shadow0% | 0% | 46% | 20% | 32%
network/MbedTLS0% | 0% | 59% | 22% | 17%
network/OpenSSL0% | 0% | 30% | 50% | 19%
src/util0% | 0% | 22% | 13% | 63%
cli0% | 0% | 16% | 19% | 63%
src/jobs0% | 0% | 11% | 46% | 41%
src0% | 0% | 0% | 40% | 59%
include/mqtt0% | 0% | 0% | 0% | 100%
include0% | 0% | 0% | 0% | 100%
include/util0% | 0% | 0% | 0% | 100%
include/discovery0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
155 34 2
113 32 4
ssize_t wslay_frame_recv()
in network/WebSocket/wslay/wslay_frame.cpp
125 32 2
183 31 1
ssize_t wslay_frame_send()
in network/WebSocket/wslay/wslay_frame.cpp
131 26 2
ResponseCode MbedTLSConnection::ConnectInternal()
in network/MbedTLS/MbedTLSConnection.cpp
157 24 0
70 21 5
90 17 1
78 16 2
33 16 1
ResponseCode DiscoveryResponse::GetParsedResponse()
in src/discovery/DiscoveryResponse.cpp
67 15 3
ResponseCode JsonParser::DiffValues()
in src/util/JsonParser.cpp
61 15 4
30 15 3
68 15 2
ResponseCode JsonParser::MergeValues()
in src/util/JsonParser.cpp
50 13 3
43 13 0
62 13 2
ResponseCode OpenSSLConnection::ConnectInternal()
in network/OpenSSL/OpenSSLConnection.cpp
47 13 0
ResponseCode OpenSSLConnection::ReadInternal()
in network/OpenSSL/OpenSSLConnection.cpp
49 13 4
42 12 0