firecracker-microvm / versionize_derive
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 25 units with 191 lines of code in units (31.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (28 lines of code)
    • 6 small units (91 lines of code)
    • 18 very small units (72 lines of code)
0% | 0% | 14% | 47% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 0% | 14% | 47% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/descriptors0% | 0% | 25% | 54% | 19%
src0% | 0% | 0% | 36% | 63%
src/fields0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn generate_deserializer()
in src/descriptors/struct_desc.rs
28 3 1
fn generate_serializer()
in src/descriptors/struct_desc.rs
18 3 1
fn generate_serializer()
in src/descriptors/enum_desc.rs
17 3 1
fn generate_array_deserializer()
in src/fields/struct_field.rs
16 2 3
fn test_exists_at()
in src/common.rs
16 2 0
fn generate_deserializer()
in src/descriptors/enum_desc.rs
13 2 1
fn parse_struct_fields()
in src/descriptors/struct_desc.rs
11 2 2
fn parse_enum_variants()
in src/descriptors/enum_desc.rs
9 2 2
fn default_fn_serializer()
in src/fields/enum_variant.rs
8 1 2
fn generate_serializer()
in src/common.rs
6 1 1
fn exists_at()
in src/common.rs
4 4 2
fn start_version()
in src/common.rs
4 1 1
fn ty()
in src/common.rs
4 1 1
fn serialize()
in src/lib.rs
4 1 4
fn start_version()
in src/fields/struct_field.rs
3 1 1
fn end_version()
in src/fields/struct_field.rs
3 1 1
fn ty()
in src/fields/struct_field.rs
3 1 1
fn start_version()
in src/fields/enum_variant.rs
3 1 1
fn end_version()
in src/fields/enum_variant.rs
3 1 1
fn deserialize()
in src/lib.rs
3 1 3