kubernetes / cloud-provider
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 275 units with 3,656 lines of code in units (79.0% of code).
    • 2 very long units (246 lines of code)
    • 8 long units (525 lines of code)
    • 31 medium size units (956 lines of code)
    • 67 small units (978 lines of code)
    • 167 very small units (951 lines of code)
6% | 14% | 26% | 26% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go6% | 14% | 26% | 26% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
controllers8% | 16% | 30% | 25% | 18%
app22% | 27% | 27% | 12% | 10%
volume0% | 20% | 16% | 28% | 34%
options0% | 22% | 20% | 25% | 30%
node0% | 0% | 64% | 32% | 3%
config0% | 0% | 11% | 35% | 53%
ROOT0% | 0% | 26% | 34% | 38%
service0% | 0% | 21% | 24% | 54%
fake0% | 0% | 0% | 35% | 64%
sample0% | 0% | 0% | 79% | 20%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in controllers/route/route_controller.go
124 20 1
func StartTestServer()
in app/testing/testserver.go
122 25 2
func Run()
in app/controllermanager.go
90 14 4
func New()
in controllers/service/controller.go
81 15 6
func()
in controllers/node/node_controller.go
69 14 1
func NewCloudControllerManagerCommand()
in app/controllermanager.go
60 9 5
func SelectZonesForVolume()
in volume/helpers/zones.go
59 22 9
func()
in controllers/service/controller.go
57 17 1
func()
in options/options.go
57 13 1
func()
in controllers/node/node_controller.go
52 12 1
func()
in controllers/nodelifecycle/node_lifecycle_controller.go
50 13 1
func()
in controllers/service/controller.go
50 13 1
func RemoveTaintOffNode()
in node/helpers/taints.go
47 12 4
func()
in controllers/route/route_controller.go
41 10 1
func startControllers()
in app/controllermanager.go
41 10 7
func addOrUpdateLabelsOnNode()
in node/helpers/labels.go
39 9 3
func()
in controllers/node/node_controller.go
38 12 1
func()
in controllers/node/node_controller.go
36 10 1
func AddOrUpdateTaintOnNode()
in node/helpers/taints.go
35 8 3
33 9 4