firecracker-microvm / micro-http
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 93 units with 2,233 lines of code in units (62.5% of code).
    • 2 very long units (426 lines of code)
    • 5 long units (331 lines of code)
    • 31 medium size units (942 lines of code)
    • 22 small units (334 lines of code)
    • 33 very small units (200 lines of code)
19% | 14% | 42% | 14% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs19% | 14% | 42% | 14% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src19% | 13% | 44% | 14% | 7%
src/common17% | 17% | 35% | 15% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
321 2 0
fn test_parse_header_line()
in src/common/headers.rs
105 1 0
fn test_into_request()
in src/request.rs
92 1 0
fn parse_headers()
in src/connection.rs
78 8 3
57 1 0
fn test_display_header_error()
in src/common/mod.rs
53 1 0
fn test_try_from_headers()
in src/common/headers.rs
51 1 0
fn test_parse_headers()
in src/connection.rs
47 1 0
fn parse_body()
in src/connection.rs
46 5 3
46 1 0
41 2 0
fn read()
in src/server.rs
40 4 1
fn test_parse_header_whitespace()
in src/common/headers.rs
39 1 0
38 1 0
fn parse_request_line()
in src/connection.rs
36 5 3
fn test_write_response()
in src/response.rs
36 1 0
34 1 0
fn test_parse_body()
in src/connection.rs
32 1 0
31 2 0
30 2 0