microsoft / windows-container-networking
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 70 units with 1,280 lines of code in units (75.9% of code).
    • 1 very long units (108 lines of code)
    • 5 long units (310 lines of code)
    • 14 medium size units (449 lines of code)
    • 17 small units (226 lines of code)
    • 33 very small units (187 lines of code)
8% | 24% | 35% | 17% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go8% | 24% | 35% | 17% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common/core30% | 32% | 19% | 13% | 3%
network0% | 26% | 33% | 25% | 14%
cni0% | 20% | 56% | 4% | 19%
common0% | 0% | 37% | 32% | 30%
plugins/nat0% | 0% | 0% | 0% | 100%
plugins/sdnbridge0% | 0% | 0% | 0% | 100%
plugins/sdnoverlay0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in common/core/network.go
108 21 1
73 16 2
func allocateIpam()
in common/core/network.go
65 13 5
func()
in cni/cni.go
63 15 1
func()
in network/endpoint.go
56 6 1
func()
in common/core/network.go
53 11 1
49 3 4
func()
in cni/cni.go
44 7 1
func ParseArgs()
in common/args.go
42 12 2
func addEndpointGatewaysFromConfig()
in common/core/network.go
38 12 2
func()
in network/manager.go
35 10 1
func()
in network/network.go
35 4 1
func Core()
in common/core/core.go
32 6 0
func getInACLRule()
in cni/cni.go
30 4 2
func GetPortEnumValue()
in network/policy.go
28 7 1
func CallPlugin()
in cni/cni.go
27 4 4
func GetPortMappingPolicy()
in network/policy.go
23 2 5
22 2 1
22 3 1
func()
in network/network.go
22 4 1