awslabs / aws-crt-python
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 333 units with 3,495 lines of code in units (42.8% of code).
    • 1 very long units (129 lines of code)
    • 7 long units (413 lines of code)
    • 40 medium size units (1,244 lines of code)
    • 43 small units (665 lines of code)
    • 242 very small units (1,044 lines of code)
3% | 11% | 35% | 19% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c6% | 15% | 45% | 17% | 14%
py0% | 7% | 24% | 20% | 48%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source6% | 15% | 45% | 17% | 14%
awscrt0% | 10% | 25% | 20% | 42%
ROOT0% | 0% | 41% | 10% | 47%
awscrt/eventstream0% | 0% | 7% | 23% | 69%
continuous-delivery0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static bool s_add_native_header()
in source/event_stream_headers.c
129 34 2
static void s_ws_handshake_transform()
in source/mqtt_client_connection.c
69 11 4
def __init__()
in awscrt/mqtt.py
62 14 21
61 12 2
static void s_s3_request_on_finish()
in source/s3_meta_request.c
59 11 3
static int s_s3_request_on_body()
in source/s3_meta_request.c
58 11 4
53 9 3
def __init__()
in awscrt/auth.py
51 8 14
def new()
in awscrt/http.py
49 10 7
47 6 1
static void s_suback_multi_callback()
in source/mqtt_client_connection.c
44 8 5
def __init__()
in awscrt/s3.py
43 9 9
42 9 2
def __init__()
in awscrt/s3.py
41 4 13
40 8 3
39 3 2
39 5 3
39 8 2
bool s_set_will()
in source/mqtt_client_connection.c
35 7 2
static void s_on_continuation_message()
in source/event_stream_rpc_client_continuation.c
35 4 3