aws / cluster-api-provider-cloudstack
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 115 units with 1,341 lines of code in units (40.2% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (243 lines of code)
    • 16 medium size units (456 lines of code)
    • 14 small units (192 lines of code)
    • 81 very small units (450 lines of code)
0% | 18% | 34% | 14% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 18% | 34% | 14% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
controllers0% | 62% | 27% | 4% | 6%
ROOT0% | 59% | 36% | 0% | 4%
pkg/cloud0% | 0% | 63% | 24% | 12%
api/v1beta10% | 0% | 23% | 18% | 58%
pkg/webhook_utilities0% | 0% | 0% | 35% | 64%
pkg/mocks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in main.go
72 12 0
func()
in controllers/cloudstackmachine_controller.go
63 6 1
func()
in controllers/cloudstackmachine_controller.go
57 14 1
func()
in controllers/cloudstackmachine_controller.go
51 13 1
func()
in pkg/cloud/instance.go
48 12 1
func setFlags()
in main.go
44 1 0
func()
in controllers/cloudstackcluster_controller.go
39 3 1
func()
in controllers/cloudstackcluster_controller.go
35 10 1
func()
in pkg/cloud/cluster.go
31 10 1
func()
in api/v1beta1/zz_generated.deepcopy.go
30 7 1
func()
in pkg/cloud/network.go
27 6 1
func()
in pkg/cloud/instance.go
25 11 1
func()
in api/v1beta1/cloudstackcluster_webhook.go
24 6 1
func()
in pkg/cloud/cluster.go
23 6 1
func()
in pkg/cloud/network.go
22 5 1
func()
in pkg/cloud/network.go
22 5 1
func()
in pkg/cloud/instance.go
22 6 1
func()
in pkg/cloud/instance.go
22 6 1
func()
in api/v1beta1/cloudstackmachine_webhook.go
21 4 1
func()
in api/v1beta1/cloudstackmachinetemplate_webhook.go
21 4 1