awslabs / tc-redirect-tap
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 43 units with 609 lines of code in units (83.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (108 lines of code)
    • 7 medium size units (226 lines of code)
    • 13 small units (182 lines of code)
    • 21 very small units (93 lines of code)
0% | 17% | 37% | 29% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 17% | 37% | 29% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/tc-redirect-tap0% | 41% | 27% | 24% | 7%
internal0% | 0% | 33% | 38% | 27%
vmconf0% | 0% | 80% | 19% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func newPlugin()
in cmd/tc-redirect-tap/main.go
54 12 1
func()
in cmd/tc-redirect-tap/main.go
54 8 1
func()
in cmd/tc-redirect-tap/main.go
38 8 1
func StaticNetworkConfFrom()
in vmconf/vmconf.go
37 6 2
func()
in internal/netlink.go
36 7 1
func()
in cmd/tc-redirect-tap/main.go
33 8 1
func()
in vmconf/vmconf.go
29 1 1
func VMTapPair()
in internal/cniutil.go
29 5 2
func()
in internal/netlink.go
24 2 1
func getCurrentResult()
in cmd/tc-redirect-tap/main.go
20 5 1
func add()
in cmd/tc-redirect-tap/main.go
17 5 1
func mtuOf()
in vmconf/vmconf.go
16 3 3
func()
in internal/netlink.go
16 5 1
func()
in internal/mocks.go
14 4 1
func extractArgs()
in cmd/tc-redirect-tap/main.go
14 4 1
func()
in internal/netlink.go
13 4 1
func()
in internal/mocks.go
13 4 1
func check()
in cmd/tc-redirect-tap/main.go
13 4 1
func InterfaceIPs()
in internal/cniutil.go
12 5 3
func FilterBySandbox()
in internal/cniutil.go
12 3 2