awslabs / aws-c-io
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 679 units with 15,764 lines of code in units (65.7% of code).
    • 23 very long units (2,918 lines of code)
    • 60 long units (4,419 lines of code)
    • 141 medium size units (4,420 lines of code)
    • 161 small units (2,345 lines of code)
    • 294 very small units (1,662 lines of code)
18% | 28% | 28% | 14% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c18% | 28% | 28% | 14% | 9%
h0% | 0% | 26% | 16% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/windows22% | 37% | 27% | 9% | 3%
source12% | 26% | 23% | 20% | 16%
source/posix26% | 24% | 36% | 11% | 2%
source/darwin33% | 10% | 36% | 9% | 10%
source/s2n19% | 18% | 27% | 20% | 12%
source/bsd22% | 15% | 33% | 20% | 7%
source/linux0% | 25% | 51% | 11% | 11%
include/aws0% | 0% | 26% | 16% | 57%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int aws_import_key_pair_to_cert_context()
in source/windows/windows_pki_utils.c
183 27 8
static void resolver_thread_fn()
in source/host_resolver.c
157 18 1
int aws_socket_connect()
in source/posix/socket.c
153 18 5
static int s_ipv4_stream_connect()
in source/windows/iocp/socket.c
146 1 5
static int s_do_client_side_negotiation_step_2()
in source/windows/secure_channel_tls_handler.c
145 21 1
static void s_s2n_pkcs11_async_pkey_task()
in source/s2n/s2n_tls_channel_handler.c
144 19 3
static void s_incoming_pipe_connection_event()
in source/windows/iocp/socket.c
138 16 4
static int s_drive_negotiation()
in source/darwin/secure_transport_tls_channel_handler.c
137 21 1
static int s_manually_verify_peer_cert()
in source/windows/secure_channel_tls_handler.c
134 13 1
static int s_do_server_side_negotiation_step_2()
in source/windows/secure_channel_tls_handler.c
132 21 1
int aws_import_public_and_private_keys_to_identity()
in source/darwin/darwin_pki_utils.c
124 21 6
static int s_standard_retry_acquire_token()
in source/standard_retry_strategy.c
123 16 5
119 20 1
int aws_pipe_init()
in source/windows/iocp/pipe.c
117 18 5
static void s_event_thread_main()
in source/bsd/kqueue_event_loop.c
115 16 1
111 14 5
108 13 2
108 13 4
static int s_on_connection_success()
in source/posix/socket.c
107 10 1
static int s_cert_context_import_ecc_private_key()
in source/windows/windows_pki_utils.c
107 12 5