aws / amazon-ecs-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 357 units with 2,749 lines of code in units (49.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (53 lines of code)
    • 24 medium size units (695 lines of code)
    • 31 small units (495 lines of code)
    • 301 very small units (1,506 lines of code)
0% | 1% | 25% | 18% | 54%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 1% | 25% | 18% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
plugins/eni0% | 8% | 33% | 18% | 38%
plugins/ecs-bridge0% | 0% | 40% | 22% | 37%
plugins/ipam0% | 0% | 37% | 34% | 27%
pkg/utils0% | 0% | 30% | 27% | 41%
scripts0% | 0% | 53% | 40% | 6%
pkg/version0% | 0% | 0% | 100% | 0%
pkg/netlinkwrapper0% | 0% | 0% | 0% | 100%
pkg/execwrapper0% | 0% | 0% | 0% | 100%
pkg/ioutilwrapper0% | 0% | 0% | 0% | 100%
pkg/cniipamwrapper0% | 0% | 0% | 0% | 100%
pkg/cninswrapper0% | 0% | 0% | 0% | 100%
pkg/oswrapper0% | 0% | 0% | 0% | 100%
pkg/cniipwrapper0% | 0% | 0% | 0% | 100%
pkg/logger0% | 0% | 0% | 0% | 100%
pkg/ec2metadata0% | 0% | 0% | 0% | 100%
pkg/capabilities0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in plugins/eni/engine/nsclosure.go
53 14 1
func add()
in plugins/eni/commands/commands.go
50 7 2
func add()
in plugins/ecs-bridge/commands/commands.go
47 8 2
func()
in plugins/ecs-bridge/engine/configureveth.go
45 8 1
func LoadIPAMConfig()
in plugins/ipam/config/config.go
39 12 2
func()
in plugins/eni/engine/engine.go
39 7 1
func newSetupNamespaceClosureContext()
in plugins/eni/engine/nsclosure.go
35 5 8
func()
in plugins/ecs-bridge/engine/engine.go
34 8 1
func()
in plugins/eni/engine/engine.go
31 7 1
func NextIP()
in plugins/ipam/ipstore/ipstore.go
27 9 2
func main()
in plugins/ipam/main.go
27 5 0
func main()
in plugins/eni/main.go
27 5 0
func main()
in plugins/ecs-bridge/main.go
27 5 0
func NewConf()
in plugins/eni/types/types.go
25 8 1
func()
in plugins/ipam/ipstore/ipstore.go
24 7 1
func generateMocks()
in scripts/mockgen.go
24 4 3
func Del()
in plugins/ipam/commands/commands.go
23 5 1
func()
in plugins/ecs-bridge/engine/engine.go
23 7 1
func()
in plugins/ecs-bridge/engine/engine.go
22 8 1
func ZeroOrNil()
in pkg/utils/utils.go
21 6 1