aws / aws-app-mesh-examples
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 811 units with 5,502 lines of code in units (11.8% of code).
    • 3 very long units (311 lines of code)
    • 12 long units (772 lines of code)
    • 31 medium size units (879 lines of code)
    • 60 small units (947 lines of code)
    • 705 very small units (2,593 lines of code)
5% | 14% | 15% | 17% | 47%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go5% | 11% | 10% | 16% | 56%
py9% | 28% | 23% | 18% | 19%
rb0% | 0% | 53% | 27% | 19%
js0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
blogs/ecs-canary-deployments-pipeline16% | 49% | 4% | 20% | 9%
walkthroughs/howto-k8s-grpc11% | 0% | 2% | 17% | 68%
walkthroughs/howto-grpc11% | 0% | 2% | 17% | 68%
walkthroughs/howto-k8s-http20% | 100% | 0% | 0% | 0%
walkthroughs/howto-http20% | 100% | 0% | 0% | 0%
walkthroughs/howto-circuit-breakers0% | 68% | 29% | 0% | 2%
walkthroughs/howto-match-and-rewrite-at-ingress0% | 100% | 0% | 0% | 0%
walkthroughs/howto-k8s-connection-pools0% | 100% | 0% | 0% | 0%
blogs/ecs-service-connectivity0% | 0% | 39% | 40% | 20%
walkthroughs/eks-getting-started0% | 0% | 79% | 0% | 20%
walkthroughs/howto-timeout-policy0% | 0% | 39% | 23% | 37%
walkthroughs/howto-metrics-extension-ecs0% | 0% | 70% | 0% | 29%
walkthroughs/howto-k8s-grpc-ingress-v20% | 0% | 28% | 30% | 41%
walkthroughs/howto-outlier-detection0% | 0% | 29% | 19% | 50%
walkthroughs/howto-k8s-outlier-detection0% | 0% | 29% | 19% | 50%
blogs/eks-bulkhead-pattern-circuit-breaker0% | 0% | 100% | 0% | 0%
blogs/eks-canary-deployments-pipeline0% | 0% | 58% | 0% | 41%
walkthroughs/howto-grpc-ingress-gateway0% | 0% | 5% | 18% | 75%
walkthroughs/howto-k8s-fargate0% | 0% | 15% | 28% | 56%
walkthroughs/howto-ecs-basics0% | 0% | 15% | 28% | 56%
walkthroughs/howto-k8s-alb0% | 0% | 73% | 0% | 26%
walkthroughs/howto-http-headers0% | 0% | 73% | 0% | 26%
walkthroughs/howto-k8s-tls-acm0% | 0% | 73% | 0% | 26%
walkthroughs/howto-k8s-http-headers0% | 0% | 73% | 0% | 26%
walkthroughs/howto-k8s-tls-file-based0% | 0% | 73% | 0% | 26%
walkthroughs/howto-k8s-mtls-sds-based0% | 0% | 73% | 0% | 26%
walkthroughs/howto-k8s-mtls-file-based0% | 0% | 73% | 0% | 26%
walkthroughs/howto-k8s-egress0% | 0% | 73% | 0% | 26%
walkthroughs/howto-http-retries0% | 0% | 0% | 100% | 0%
walkthroughs/howto-k8s-retry-policy0% | 0% | 0% | 100% | 0%
walkthroughs/howto-multiple-listeners0% | 0% | 0% | 0% | 100%
walkthroughs/tls-with-acm0% | 0% | 0% | 0% | 100%
walkthroughs/howto-ingress-gateway0% | 0% | 0% | 0% | 100%
walkthroughs/howto-tls-file-provided0% | 0% | 0% | 0% | 100%
walkthroughs/howto-mutual-tls-file-provided-by-acm0% | 0% | 0% | 0% | 100%
walkthroughs/howto-mutual-tls-file-provided0% | 0% | 0% | 0% | 100%
walkthroughs/howto-k8s-timeout-policy0% | 0% | 0% | 0% | 100%
walkthroughs/howto-k8s-cloudmap0% | 0% | 0% | 0% | 100%
walkthroughs/howto-k8s-cross-cluster0% | 0% | 0% | 0% | 100%
walkthroughs/howto-alb0% | 0% | 0% | 0% | 100%
walkthroughs/howto-k8s-ingress-gateway0% | 0% | 0% | 0% | 100%
walkthroughs/howto-k8s-http-ingress-v20% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in blogs/ecs-canary-deployments-pipeline/shared_stack/lambda_functions/start_canary/main.py
107 11 2
func main()
in walkthroughs/howto-k8s-grpc/color_client/main.go
102 14 0
func main()
in walkthroughs/howto-grpc/color_client/main.go
102 14 0
func main()
in walkthroughs/howto-circuit-breakers/src/colorteller/main.go
68 9 0
func main()
in walkthroughs/howto-match-and-rewrite-at-ingress/src/colorteller/main.go
68 9 0
func main()
in walkthroughs/howto-k8s-connection-pools/colorapp/main.go
68 9 0
def _perform_canary()
in blogs/ecs-canary-deployments-pipeline/shared_stack/lambda_functions/start_canary/main.py
68 3 5
func main()
in walkthroughs/howto-k8s-http2/color_server/main.go
66 9 0
func main()
in walkthroughs/howto-http2/color_server/main.go
66 9 0
def _delete_entries_mesh()
in blogs/ecs-canary-deployments-pipeline/shared_stack/lambda_functions/remove_previous_canary_components/main.py
66 4 1
def _update_routes()
in blogs/ecs-canary-deployments-pipeline/shared_stack/lambda_functions/rollbackto_previous_canary/main.py
65 4 2
def main()
in blogs/ecs-canary-deployments-pipeline/setup/scripts/delete_blog_contents.py
65 23 0
func main()
in walkthroughs/howto-k8s-http2/color_client/main.go
60 8 0
func main()
in walkthroughs/howto-http2/color_client/main.go
60 8 0
def get_healthcheck_status()
in blogs/ecs-canary-deployments-pipeline/shared_stack/lambda_functions/gather_healthcheck_status/main.py
52 3 5
func file_input_input_proto_init()
in walkthroughs/howto-k8s-grpc-ingress-v2/greeter/input/input.pb.go
49 9 0
func updateStats()
in walkthroughs/howto-outlier-detection/src/frontend-app/main.go
48 6 2
func updateStats()
in walkthroughs/howto-k8s-outlier-detection/feapp/main.go
48 6 2
func main()
in walkthroughs/howto-metrics-extension-ecs/src/djapp/djapp.go
40 8 0
restaurantsdbupdate
in walkthroughs/eks-getting-started/yelb-appserver-v2/modules/restaurantsdbupdate.rb
33 3 1