kubernetes / dns
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 200 units with 2,902 lines of code in units (80.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (193 lines of code)
    • 45 medium size units (1,401 lines of code)
    • 48 small units (681 lines of code)
    • 104 very small units (627 lines of code)
0% | 6% | 48% | 23% | 21%
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% | 47% | 23% | 21%
py0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/sidecar-e2e0% | 22% | 46% | 16% | 14%
pkg/dnsmasq0% | 27% | 52% | 12% | 7%
cmd/node-cache0% | 13% | 49% | 15% | 21%
pkg/dns0% | 0% | 51% | 22% | 26%
pkg/sidecar0% | 0% | 36% | 48% | 14%
cmd/sidecar0% | 0% | 81% | 12% | 6%
cmd/kube-dns0% | 0% | 30% | 52% | 17%
ROOT0% | 0% | 100% | 0% | 0%
cmd/dnsmasq-nanny0% | 0% | 80% | 0% | 19%
pkg/netif0% | 0% | 46% | 0% | 53%
pkg/version0% | 0% | 0% | 27% | 72%
pkg/util0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in cmd/sidecar-e2e/main.go
85 21 1
func()
in pkg/dnsmasq/nanny.go
55 15 1
func parseAndValidateFlags()
in cmd/node-cache/main.go
53 10 0
func defineDnsmasqMetrics()
in pkg/sidecar/metrics.go
49 2 1
func()
in pkg/dns/treecache/treecache.go
48 15 1
func()
in cmd/sidecar/main.go
46 13 1
func()
in pkg/dns/dns.go
46 14 1
func()
in pkg/dns/config/sync_dir.go
43 10 1
func()
in cmd/node-cache/app/configmap.go
42 8 1
func()
in pkg/dnsmasq/nanny.go
40 8 1
func()
in pkg/dns/dns.go
40 9 1
func()
in pkg/dns/config/sync.go
40 9 1
func()
in cmd/kube-dns/app/options/options.go
39 1 1
func()
in pkg/dns/dns.go
39 14 1
func()
in pkg/dns/dns.go
38 9 1
func()
in cmd/node-cache/app/configmap.go
37 6 1
func()
in cmd/sidecar-e2e/main.go
36 8 1
func()
in pkg/dns/dns.go
36 8 1
func()
in pkg/sidecar/dnsprobe.go
34 4 1
func()
in pkg/dns/dns.go
34 7 1