bottlerocket-os / bottlerocket-sdk
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 15 units with 382 lines of code in units (36.9% of code).
    • 1 very long units (119 lines of code)
    • 1 long units (78 lines of code)
    • 2 medium size units (61 lines of code)
    • 6 small units (92 lines of code)
    • 5 very small units (32 lines of code)
31% | 20% | 15% | 24% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs31% | 20% | 15% | 24% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
license-scan/src38% | 25% | 19% | 11% | 5%
license-tool/src0% | 0% | 0% | 78% | 21%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
fn write_attribution()
in license-scan/src/main.rs
119 19 6
fn main()
in license-scan/src/main.rs
78 10 0
fn scan_go_vendor_repos()
in license-scan/src/main.rs
34 4 1
fn get()
in license-scan/src/main.rs
27 3 3
fn print_paths()
in license-tool/src/main.rs
19 1 3
fn expression_from_str()
in license-scan/src/main.rs
19 2 1
fn copy_files()
in license-scan/src/main.rs
17 4 3
fn get_license_destinations()
in license-tool/src/main.rs
14 2 2
fn print_spdx_id()
in license-tool/src/main.rs
12 1 2
fn test_use_path()
in license-tool/src/main.rs
11 1 0
fn parse_licenses_file()
in license-tool/src/main.rs
9 1 1
fn hash()
in license-scan/src/main.rs
8 1 1
fn test_parse_toml_file()
in license-tool/src/main.rs
6 1 0
fn non_license()
in license-scan/src/main.rs
6 2 1
fn unslash()
in license-scan/src/main.rs
3 1 1