awslabs / aws-c-mqtt
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 166 units with 4,079 lines of code in units (77.1% of code).
    • 4 very long units (573 lines of code)
    • 17 long units (1,207 lines of code)
    • 39 medium size units (1,263 lines of code)
    • 45 small units (664 lines of code)
    • 61 very small units (372 lines of code)
14% | 29% | 30% | 16% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c14% | 29% | 30% | 16% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source14% | 29% | 30% | 16% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
167 22 4
151 20 2
131 16 4
124 23 2
uint16_t mqtt_create_request()
in source/client_channel_handler.c
99 12 6
static int s_process_read_message()
in source/client_channel_handler.c
81 13 3
static int s_packet_handler_connack()
in source/client_channel_handler.c
80 9 2
static void s_request_outgoing_task()
in source/client_channel_handler.c
77 8 3
77 9 8
76 11 4
76 8 7
74 9 7
73 16 3
72 11 4
67 17 3
66 20 2
65 17 3
60 13 3
static int s_packet_handler_publish()
in source/client_channel_handler.c
57 9 2
55 6 7