awslabs / aws-lambda-rust-runtime
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 125 units with 1,430 lines of code in units (48.1% of code).
    • 1 very long units (176 lines of code)
    • 0 long units (0 lines of code)
    • 12 medium size units (323 lines of code)
    • 32 small units (465 lines of code)
    • 80 very small units (466 lines of code)
12% | 0% | 22% | 32% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs12% | 0% | 22% | 32% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda-http/src16% | 0% | 21% | 28% | 32%
lambda-runtime/src0% | 0% | 23% | 37% | 39%
lambda-runtime-api-client/src0% | 0% | 42% | 57% | 0%
lambda-extension/src0% | 0% | 0% | 67% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn from()
in lambda-http/src/request.rs
176 17 1
fn try_from()
in lambda-runtime/src/types.rs
40 3 1
fn deserialize_multi_value_headers()
in lambda-http/src/request.rs
34 7 1
fn context_with_client_context_resolves()
in lambda-runtime/src/types.rs
30 1 0
fn deserialize_headers()
in lambda-http/src/request.rs
29 3 1
fn deserializes_apigw_v2_request_events()
in lambda-http/src/request.rs
28 2 0
fn deserializes_apigw_request_events()
in lambda-http/src/request.rs
25 1 0
fn deserializes_alb_request_events()
in lambda-http/src/request.rs
25 1 0
fn test_set_origin_with_base_path()
in lambda-runtime-api-client/src/lib.rs
24 1 0
fn payload()
in lambda-http/src/ext.rs
23 4 1
fn next()
in lambda-http/src/strmap.rs
22 5 1
22 1 0
fn query_string_parameters()
in lambda-http/src/ext.rs
21 2 1
fn set_origin()
in lambda-runtime-api-client/src/lib.rs
19 1 2
fn deserialize_method()
in lambda-http/src/request.rs
19 2 1
19 1 0
19 1 0
19 1 0
19 1 0
fn error_request()
in lambda-extension/src/requests.rs
19 1 4