aws-samples / serverless-rust-demo
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 23 units with 312 lines of code in units (21.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (77 lines of code)
    • 3 medium size units (78 lines of code)
    • 5 small units (74 lines of code)
    • 14 very small units (83 lines of code)
0% | 24% | 25% | 23% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 24% | 25% | 23% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/entrypoints/lambda/dynamodb0% | 42% | 42% | 9% | 4%
src/event_bus/eventbridge0% | 0% | 0% | 91% | 8%
src/store/dynamodb0% | 0% | 0% | 30% | 69%
src/store0% | 0% | 0% | 0% | 100%
src/entrypoints/lambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn get_ddb_event()
in src/entrypoints/lambda/dynamodb/model.rs
77 1 0
fn test_dynamodb_into_event()
in src/entrypoints/lambda/dynamodb/model.rs
33 1 0
fn test_deserialize()
in src/entrypoints/lambda/dynamodb/model.rs
24 1 0
fn try_from()
in src/entrypoints/lambda/dynamodb/model.rs
21 1 1
fn try_from()
in src/entrypoints/lambda/dynamodb/model.rs
18 1 1
fn test_to_eventbridge()
in src/event_bus/eventbridge/ext.rs
18 1 0
fn try_from()
in src/store/dynamodb/mod.rs
13 1 1
fn to_eventbridge()
in src/event_bus/eventbridge/ext.rs
13 1 2
fn product_to_dynamodb()
in src/store/dynamodb/mod.rs
12 1 0
fn from()
in src/store/dynamodb/mod.rs
10 1 1
fn product_from_dynamodb()
in src/store/dynamodb/mod.rs
10 1 0
fn test_dynamodb_into_product()
in src/entrypoints/lambda/dynamodb/model.rs
9 1 0
fn into()
in src/store/memory.rs
7 1 1
fn get_request_builder()
in src/store/dynamodb/mod.rs
7 1 0
fn response()
in src/entrypoints/lambda/apigateway.rs
7 1 2
fn attributevalue_get_s()
in src/store/dynamodb/ext.rs
5 1 0
fn attributevalue_get_s_missing()
in src/store/dynamodb/ext.rs
5 1 0
fn attributevalue_get_n()
in src/store/dynamodb/ext.rs
5 1 0
fn attributevalue_get_n_missing()
in src/store/dynamodb/ext.rs
5 1 0
fn get_s()
in src/store/dynamodb/ext.rs
4 2 2