bazelbuild / sandboxfs
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 342 units with 3,523 lines of code in units (73.9% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (228 lines of code)
    • 34 medium size units (966 lines of code)
    • 71 small units (1,035 lines of code)
    • 234 very small units (1,294 lines of code)
0% | 6% | 27% | 29% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 5% | 25% | 29% | 39%
go0% | 10% | 32% | 28% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 5% | 25% | 31% | 36%
integration/utils0% | 14% | 23% | 26% | 35%
src/nodes0% | 5% | 26% | 25% | 42%
admin/lint0% | 0% | 55% | 33% | 10%
ROOT0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn safe_main()
in src/main.rs
89 10 2
func mountSetupFull()
in integration/utils/exec.go
80 16 5
fn readdirall()
in src/nodes/dir.rs
59 9 3
func()
in integration/utils/exec.go
47 11 1
func main()
in admin/lint/lint.go
45 11 0
fn register()
in src/reconfig.rs
39 8 2
fn run_loop_aux()
in src/reconfig.rs
39 4 4
func checkAll()
in admin/lint/checks.go
35 9 2
fn mknod()
in src/nodes/dir.rs
35 3 8
33 5 1
fn setattr_times()
in src/nodes/mod.rs
32 9 4
31 1 0
30 1 0
fn do_run_loop_raw_test()
in src/reconfig.rs
30 4 3
30 1 0
29 1 0
func startBackground()
in integration/utils/exec.go
28 5 5
fn map()
in src/nodes/dir.rs
28 5 6
func SetConfigFromFlags()
in integration/utils/config.go
27 6 4
func toUnixUser()
in integration/utils/user.go
27 6 1