awslabs / aws-c-http
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 601 units with 14,623 lines of code in units (67.9% of code).
    • 11 very long units (3,062 lines of code)
    • 53 long units (3,423 lines of code)
    • 141 medium size units (4,479 lines of code)
    • 158 small units (2,321 lines of code)
    • 238 very small units (1,338 lines of code)
20% | 23% | 30% | 15% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c20% | 23% | 30% | 15% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source20% | 23% | 30% | 15% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static uint8_t decode_symbol()
in source/hpack_huffman_static.c
1794 257 3
157 23 1
static int s_linestate_header()
in source/h1_decoder.c
153 37 2
143 1 3
int aws_hpack_decode()
in source/hpack.c
140 31 3
129 21 3
static void s_process_statistics()
in source/connection_monitor.c
112 18 4
110 16 2
110 27 5
109 19 4
105 12 4
98 23 2
int aws_h2_encode_data_frame()
in source/h2_frames.c
95 16 10
94 18 4
82 16 2
78 11 2
static void s_write_outgoing_frames()
in source/h2_connection.c
76 17 2
76 12 3
74 11 1
74 8 2