awslabs / aws-c-mqtt
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 166 units with 4,079 lines of code in units (77.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 16 medium complex units (1,342 lines of code)
    • 27 simple units (1,167 lines of code)
    • 123 very simple units (1,570 lines of code)
0% | 0% | 32% | 28% | 38%
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
c0% | 0% | 32% | 28% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source0% | 0% | 32% | 28% | 38%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
124 23 2
167 22 4
151 20 2
66 20 2
67 17 3
65 17 3
131 16 4
73 16 3
47 16 2
bool aws_mqtt_packet_has_flags()
in source/fixed_header.c
23 15 1
40 14 2
static int s_process_read_message()
in source/client_channel_handler.c
81 13 3
60 13 3
uint16_t mqtt_create_request()
in source/client_channel_handler.c
99 12 6
76 11 4
72 11 4
static int s_packet_handler_connack()
in source/client_channel_handler.c
80 9 2
static int s_packet_handler_publish()
in source/client_channel_handler.c
57 9 2
41 9 1
77 9 8