awslabs / aws-c-http
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 601 units with 14,623 lines of code in units (67.9% of code).
    • 1 very complex units (1,794 lines of code)
    • 4 complex units (455 lines of code)
    • 33 medium complex units (2,495 lines of code)
    • 88 simple units (3,635 lines of code)
    • 475 very simple units (6,244 lines of code)
12% | 3% | 17% | 24% | 42%
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
c12% | 3% | 17% | 24% | 42%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source12% | 3% | 17% | 24% | 42%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static uint8_t decode_symbol()
in source/hpack_huffman_static.c
1794 257 3
static int s_linestate_header()
in source/h1_decoder.c
153 37 2
52 32 2
int aws_hpack_decode()
in source/hpack.c
140 31 3
110 27 5
157 23 1
98 23 2
129 21 3
109 19 4
static void s_process_statistics()
in source/connection_monitor.c
112 18 4
94 18 4
static void s_write_outgoing_frames()
in source/h2_connection.c
76 17 2
72 17 1
int aws_h2_encode_data_frame()
in source/h2_frames.c
95 16 10
110 16 2
82 16 2
67 14 4
static int s_send_frame()
in source/websocket.c
62 14 3
static void s_write_outgoing_stream()
in source/h1_connection.c
69 14 2
53 13 3