awslabs / amazon-apigateway-ingress-controller
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 76 units with 1,228 lines of code in units (67.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (174 lines of code)
    • 17 medium size units (567 lines of code)
    • 13 small units (182 lines of code)
    • 44 very small units (305 lines of code)
0% | 14% | 46% | 14% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 14% | 46% | 14% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/controller0% | 22% | 50% | 9% | 17%
pkg/cloudformation0% | 0% | 29% | 31% | 39%
pkg/network0% | 0% | 88% | 0% | 11%
cmd/manager0% | 0% | 100% | 0% | 0%
pkg/nginx0% | 0% | 0% | 100% | 0%
pkg/finalizers0% | 0% | 0% | 0% | 100%
pkg/webhook0% | 0% | 0% | 0% | 100%
pkg/logging0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/controller/ingress/ingress_controller.go
87 22 1
func()
in pkg/controller/ingress/ingress_controller.go
87 1 1
46 12 3
func()
in pkg/controller/ingress/mocks.go
44 2 1
func newMockIngress()
in pkg/controller/ingress/mocks.go
44 3 3
func()
in pkg/controller/ingress/ingress_controller.go
43 5 1
func()
in pkg/controller/ingress/ingress_controller.go
41 5 1
func BuildApiGatewayTemplateFromIngressRule()
in pkg/cloudformation/cloudformation.go
38 6 1
func()
in pkg/controller/ingress/ingress_controller.go
38 8 1
func()
in pkg/controller/ingress/ingress_controller.go
37 7 1
func main()
in cmd/manager/main.go
36 6 0
func()
in pkg/controller/ingress/ingress_controller.go
29 8 1
func()
in pkg/controller/ingress/ingress_controller.go
28 6 1
func()
in pkg/controller/ingress/ingress_controller.go
28 6 1
func buildAWSApiGatewayMethod()
in pkg/cloudformation/cloudformation.go
26 1 2
func buildAWSElasticLoadBalancingV2TargetGroup()
in pkg/cloudformation/cloudformation.go
25 2 4
func()
in pkg/controller/ingress/mocks.go
22 3 1
func getAWSSession()
in pkg/controller/ingress/ingress_controller.go
21 4 1
func buildNginxConfig()
in pkg/controller/ingress/nginx.go
21 3 1
func mapApiGatewayMethodsAndResourcesFromPaths()
in pkg/cloudformation/cloudformation.go
20 5 1