aws-samples / aws-iot-alexa-connected-home-demo
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 4,328 units with 72,857 lines of code in units (52.9% of code).
    • 1 very complex units (280 lines of code)
    • 11 complex units (1,937 lines of code)
    • 139 medium complex units (12,065 lines of code)
    • 334 simple units (15,159 lines of code)
    • 3,843 very simple units (43,416 lines of code)
<1% | 2% | 16% | 20% | 59%
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
c<1% | 3% | 20% | 24% | 51%
py0% | 0% | 6% | 16% | 77%
h0% | 0% | 0% | <1% | 99%
js0% | 0% | 0% | 0% | 100%
go0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
amazon-freertos/lib/FreeRTOS-Plus-TCP1% | 8% | 32% | 22% | 35%
amazon-freertos/lib/ota0% | 11% | 24% | 32% | 32%
amazon-freertos/lib/secure_sockets0% | 4% | 43% | 25% | 26%
amazon-freertos/lib/wifi0% | 2% | 17% | 29% | 50%
amazon-freertos/lib/FreeRTOS0% | 0% | 4% | 13% | 82%
amazon-freertos/lib/pkcs110% | 0% | 31% | 37% | 31%
amazon-freertos/lib/mqtt0% | 0% | 20% | 36% | 43%
amazon-freertos/lib/greengrass0% | 0% | 48% | 29% | 22%
amazon-freertos/lib/tls0% | 0% | 50% | 23% | 26%
amazon-freertos/lib/shadow0% | 0% | 21% | 19% | 58%
amazon-freertos/lib/FreeRTOS-Plus-POSIX0% | 0% | 12% | 46% | 40%
amazon-freertos/tools/ota_e2e_tests0% | 0% | 8% | 12% | 78%
amazon-freertos/tools/cbmc0% | 0% | 16% | 13% | 70%
amazon-freertos/tools/checks0% | 0% | 11% | 41% | 47%
amazon-freertos/lib/crypto0% | 0% | 0% | 34% | 65%
amazon-freertos/tools/git0% | 0% | 0% | 15% | 84%
amazon-freertos/lib/cbor0% | 0% | 0% | 3% | 96%
amazon-freertos/lib/defender0% | 0% | 0% | 0% | 100%
amazon-freertos/tools/aws_config_quick_start0% | 0% | 0% | 0% | 100%
amazon-freertos/tools/certificate_configuration0% | 0% | 0% | 0% | 100%
amazon-freertos/tools/echo_server0% | 0% | 0% | 0% | 100%
amazon-freertos/lib/bufferpool0% | 0% | 0% | 0% | 100%
amazon-freertos/lib/utils0% | 0% | 0% | 0% | 100%
function0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
BaseType_t FreeRTOS_setsockopt()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_Sockets.c
280 56 5
static DocParseErr_t prvParseJSONbyModel()
in amazon-freertos/lib/ota/aws_ota_agent.c
253 32 3
WIFIReturnCode_t WIFI_ConnectAP()
in amazon-freertos/lib/wifi/portable/nxp/lpc54018iotmodule/aws_wifi.c
128 32 1
int32_t SOCKETS_SetSockOpt()
in amazon-freertos/lib/secure_sockets/portable/lwip/aws_secure_sockets.c
165 32 5
static void prvOTAUpdateTask()
in amazon-freertos/lib/ota/aws_ota_agent.c
171 31 1
static BaseType_t prvProcessDHCPReplies()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DHCP.c
144 30 1
void vSocketSelect()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_Sockets.c
123 30 1
static void ksz8851snl_update()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/ksz8851snl/NetworkInterface.c
216 29 0
void vDHCPProcess()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DHCP.c
195 28 1
static void prvTCPReturnPacket()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_IP.c
190 27 4
uint16_t usGenerateProtocolChecksum()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_IP.c
151 26 3
static uint32_t prvParseDNSReply()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c
201 26 3
static int prvInitializeClientCredential()
in amazon-freertos/lib/tls/aws_tls.c
153 24 1
static void prvCheckOptions()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_IP.c
129 24 2
static int32_t prvTCPPrepareSend()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_IP.c
137 24 3
void vTCPStateChange()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_IP.c
134 23 2
static BaseType_t prvTCPHandleState()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_IP.c
89 23 2
BaseType_t xQueueGenericSend()
in amazon-freertos/lib/FreeRTOS/queue.c
138 23 4
static bool _mtk_wifi_apply_setting()
in amazon-freertos/lib/wifi/portable/mediatek/mt7697hx-dev-kit/aws_wifi.c
75 23 2
int32_t SOCKETS_SetSockOpt()
in amazon-freertos/lib/secure_sockets/portable/infineon/xmc4800_iotkit/aws_secure_sockets.c
142 23 5