awslabs / shuttle
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 139 units with 1,512 lines of code in units (35.3% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (297 lines of code)
    • 15 medium size units (427 lines of code)
    • 23 small units (337 lines of code)
    • 97 very small units (451 lines of code)
0% | 19% | 28% | 22% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 19% | 28% | 22% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/sync0% | 42% | 27% | 15% | 14%
src/runtime0% | 31% | 26% | 32% | 9%
src/scheduler0% | 0% | 23% | 31% | 45%
src/runtime/task0% | 0% | 63% | 0% | 36%
src0% | 0% | 43% | 19% | 37%
src/runtime/thread0% | 0% | 40% | 13% | 46%
src/sync/atomic0% | 0% | 20% | 15% | 63%
benches0% | 0% | 0% | 100% | 0%
src/scheduler/data0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn send()
in src/sync/mpsc.rs
86 18 2
fn step()
in src/runtime/execution.rs
74 8 2
fn recv()
in src/sync/mpsc.rs
69 17 1
fn lock()
in src/sync/rwlock.rs
68 4 2
fn call_once_inner()
in src/sync/once.rs
42 5 3
fn schedule()
in src/runtime/execution.rs
41 9 1
fn vector_clock()
in src/runtime/task/clock.rs
37 3 0
fn spawn_named()
in src/thread.rs
35 5 3
fn reusable_continuation_drop()
in src/runtime/thread/continuation.rs
32 3 0
fn drop()
in src/sync/rwlock.rs
30 3 1
fn drop()
in src/sync/mutex.rs
25 3 1
fn maybe_warn_about_ordering()
in src/sync/atomic/mod.rs
25 7 1
fn next_task()
in src/scheduler/dfs.rs
25 3 4
fn drop()
in src/sync/rwlock.rs
24 2 1
fn next_task()
in src/scheduler/replay.rs
24 3 4
fn new()
in src/sync/mpsc.rs
22 3 1
fn persist_failure_to_file()
in src/runtime/failure.rs
22 4 2
fn new()
in src/runtime/task/mod.rs
22 1 5
fn next_task()
in src/scheduler/pct.rs
21 6 4
fn unblock_waiters()
in src/sync/rwlock.rs
20 5 3