aws / amazon-vpc-cni-plugins
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 186 units with 4,450 lines of code in units (80.2% of code).
    • 5 very long units (616 lines of code)
    • 19 long units (1,365 lines of code)
    • 42 medium size units (1,431 lines of code)
    • 39 small units (568 lines of code)
    • 81 very small units (470 lines of code)
13% | 30% | 32% | 12% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go13% | 30% | 32% | 12% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
plugins/vpc-shared-eni33% | 34% | 21% | 6% | 3%
plugins/vpc-branch-eni23% | 56% | 14% | 3% | 2%
plugins/vpc-tunnel23% | 45% | 26% | 3% | 2%
plugins/vpc-branch-pat-eni0% | 51% | 35% | 7% | 5%
plugins/vpc-eni0% | 29% | 36% | 25% | 8%
tools/netnsexec0% | 100% | 0% | 0% | 0%
plugins/aws-appmesh0% | 0% | 66% | 28% | 5%
network/eni0% | 0% | 40% | 40% | 19%
network/netns0% | 0% | 70% | 0% | 29%
network/iptables0% | 0% | 65% | 19% | 16%
cni0% | 0% | 55% | 16% | 28%
network/imds0% | 0% | 62% | 24% | 12%
network/ebtables0% | 0% | 28% | 13% | 58%
version0% | 0% | 0% | 100% | 0%
network/vpc0% | 0% | 0% | 17% | 82%
logger0% | 0% | 0% | 0% | 100%
network/ipcfg0% | 0% | 0% | 0% | 100%
capabilities0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in plugins/vpc-shared-eni/network/bridge_linux.go
202 30 1
func()
in plugins/vpc-branch-eni/plugin/commands.go
105 23 1
func()
in plugins/vpc-shared-eni/network/bridge_windows.go
104 18 1
func New()
in plugins/vpc-tunnel/config/netconfig.go
103 29 1
func()
in plugins/vpc-shared-eni/network/bridge_linux.go
102 18 1
func New()
in plugins/vpc-branch-eni/config/netconfig.go
99 29 1
func()
in plugins/vpc-tunnel/plugin/commands.go
90 14 1
func()
in plugins/vpc-branch-eni/plugin/commands.go
89 14 1
func()
in plugins/vpc-branch-pat-eni/plugin/commands.go
87 11 1
func()
in plugins/vpc-branch-pat-eni/plugin/commands.go
84 11 1
func()
in plugins/vpc-shared-eni/plugin/commands.go
84 11 1
func New()
in plugins/vpc-shared-eni/config/netconfig.go
84 26 2
func()
in plugins/vpc-shared-eni/network/bridge_linux.go
76 13 1
func()
in plugins/vpc-branch-pat-eni/plugin/commands.go
71 8 1
func()
in plugins/vpc-eni/plugin/commands.go
67 7 1
func()
in plugins/vpc-eni/network/network_windows.go
67 15 1
func()
in plugins/vpc-shared-eni/network/bridge_linux.go
64 9 1
func()
in plugins/vpc-branch-eni/plugin/commands.go
62 12 1
func()
in plugins/vpc-shared-eni/network/bridge_linux.go
61 10 1
func New()
in plugins/vpc-branch-pat-eni/config/netconfig.go
58 18 2