awslabs / dynein
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 73 units with 1,235 lines of code in units (27.7% of code).
    • 2 very long units (244 lines of code)
    • 3 long units (198 lines of code)
    • 11 medium size units (345 lines of code)
    • 18 small units (238 lines of code)
    • 39 very small units (210 lines of code)
19% | 16% | 27% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs19% | 16% | 27% | 19% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src19% | 16% | 27% | 19% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
131 2 5
113 14 2
81 6 4
60 9 1
57 12 4
fn parse()
in src/shell.rs
40 5 1
40 10 3
39 1 0
33 6 1
32 5 4
fn identify_target()
in src/data.rs
29 3 3
29 11 1
27 1 2
27 7 1
26 3 3
23 2 1
20 1 2
fn build_csv_header()
in src/transfer.rs
18 4 3
16 2 1
16 1 2