kubernetes / klog
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 138 units with 1,348 lines of code in units (86.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (88 lines of code)
    • 12 medium size units (347 lines of code)
    • 31 small units (453 lines of code)
    • 94 very small units (460 lines of code)
0% | 6% | 25% | 33% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 6% | 25% | 33% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 8% | 20% | 31% | 40%
klogr0% | 0% | 50% | 28% | 21%
hack/tools/logcheck0% | 0% | 47% | 50% | 2%
integration_tests/internal0% | 0% | 0% | 61% | 38%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in klog.go
88 29 1
func()
in klog.go
37 4 1
func isKeysValid()
in hack/tools/logcheck/main.go
36 7 4
func()
in klog.go
32 6 1
func checkForFunctionExpr()
in hack/tools/logcheck/main.go
31 11 3
30 8 2
func()
in klog.go
29 6 1
func flatten()
in klogr/klogr.go
28 6 1
func()
in klog.go
28 9 1
func create()
in klog_file.go
27 6 3
27 5 3
func trimDuplicates()
in klogr/klogr.go
21 5 1
func()
in klogr/klogr.go
21 5 1
20 2 1
func()
in klog.go
20 5 1
func V()
in klog.go
19 5 1
func()
in klog.go
18 5 1
func()
in klog.go
18 5 1
func hasFormatSpecifier()
in hack/tools/logcheck/main.go
17 5 1
func()
in klogr/klogr.go
16 4 1