aws / amazon-sagemaker-operator-for-k8s
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 598 units with 8,069 lines of code in units (28.2% of code).
    • 2 very long units (222 lines of code)
    • 20 long units (1,273 lines of code)
    • 84 medium size units (2,426 lines of code)
    • 120 small units (1,678 lines of code)
    • 372 very small units (2,470 lines of code)
2% | 15% | 30% | 20% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go2% | 15% | 30% | 20% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
api/v14% | 16% | 19% | 20% | 39%
ROOT91% | 0% | 0% | 0% | 8%
smlogs-kubectl-plugin/pkg0% | 69% | 0% | 19% | 10%
controllers/hosting0% | 24% | 35% | 30% | 9%
controllers/hostingautoscalingpolicy0% | 38% | 26% | 21% | 13%
controllers/trainingjob0% | 37% | 24% | 23% | 15%
controllers/processingjob0% | 37% | 16% | 23% | 21%
controllers/hyperparametertuningjob0% | 17% | 47% | 18% | 16%
controllers/model0% | 28% | 21% | 40% | 9%
controllers/endpointconfig0% | 29% | 22% | 32% | 15%
controllers/controllertest0% | 0% | 58% | 4% | 37%
controllers/sdkutil0% | 0% | 26% | 29% | 43%
controllers/batchtransformjob0% | 0% | 54% | 32% | 13%
controllers0% | 0% | 21% | 10% | 68%
smlogs-kubectl-plugin/cmd0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in api/v1/trainingjob/zz_generated.deepcopy.go
114 26 1
func main()
in main.go
108 11 0
func()
in controllers/trainingjob/trainingjob_controller.go
85 29 1
func()
in api/v1/processingjob/zz_generated.deepcopy.go
76 18 1
func()
in controllers/hosting/hostingdeployment_controller.go
76 30 1
func NewCmdSmLogs()
in smlogs-kubectl-plugin/pkg/cmd/smlogs.go
75 7 1
func()
in smlogs-kubectl-plugin/pkg/cmd/smlogs.go
72 19 1
func()
in smlogs-kubectl-plugin/pkg/cmd/smlogs.go
72 19 1
func()
in api/v1/common/zz_generated.deepcopy.go
71 16 1
func()
in api/v1/batchtransformjob/zz_generated.deepcopy.go
71 16 1
func()
in api/v1/hostingautoscalingpolicy/zz_generated.deepcopy.go
64 14 1
func()
in controllers/processingjob/processingjob_controller.go
64 22 1
func()
in controllers/hyperparametertuningjob/hyperparametertuningjob_controller.go
63 22 1
func()
in controllers/hosting/endpointconfig_reconciler.go
57 17 1
func()
in api/v1/hostingdeployment/zz_generated.deepcopy.go
56 14 1
func()
in controllers/hostingautoscalingpolicy/hostingautoscalingpolicy_controller.go
55 20 1
func()
in controllers/model/model_controller.go
54 19 1
func()
in controllers/hosting/model_reconciler.go
54 8 1
func()
in controllers/endpointconfig/endpointconfig_controller.go
54 19 1
func()
in controllers/hostingautoscalingpolicy/hostingautoscalingpolicy_controller.go
52 14 1