awslabs / serverless-rules
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 160 units with 1,861 lines of code in units (76.1% of code).
    • 1 very long units (166 lines of code)
    • 8 long units (549 lines of code)
    • 15 medium size units (456 lines of code)
    • 11 small units (157 lines of code)
    • 125 very small units (533 lines of code)
8% | 29% | 24% | 8% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go10% | 34% | 28% | 1% | 23%
py0% | 0% | 0% | 45% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tflint-ruleset-aws-serverless/rules10% | 34% | 29% | 1% | 23%
cfn-lint-serverless/cfn_lint_serverless/rules0% | 0% | 0% | 41% | 58%
cfn-lint-serverless/cfn_lint_serverless0% | 0% | 0% | 62% | 37%
tflint-ruleset-aws-serverless0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_event_invoke_config_async_on_failure.go
166 24 1
func()
in tflint-ruleset-aws-serverless/rules/aws_cloudwatch_log_group_lambda_retention.go
96 17 1
func()
in tflint-ruleset-aws-serverless/rules/aws_api_gateway_method_settings_throttling.go
80 10 1
func()
in tflint-ruleset-aws-serverless/rules/aws_iam_role_lambda_no_star.go
69 10 1
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_event_source_mapping_failure_destination.go
67 8 1
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_permission_multiple_principals.go
65 11 1
func()
in tflint-ruleset-aws-serverless/rules/aws_apigatewayv2_stage_throttling.go
65 8 1
func()
in tflint-ruleset-aws-serverless/rules/aws_sfn_state_machine_tracing.go
55 7 1
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_function_tracing.go
52 5 1
func()
in tflint-ruleset-aws-serverless/rules/aws_cloudwatch_event_target_no_dlq.go
48 6 1
func()
in tflint-ruleset-aws-serverless/rules/aws_apigatewayv2_stage_structured_logging.go
39 5 1
func()
in tflint-ruleset-aws-serverless/rules/aws_api_gateway_stage_structured_logging.go
39 5 1
func()
in tflint-ruleset-aws-serverless/rules/aws_api_gateway_stage_tracing.go
33 3 1
func()
in tflint-ruleset-aws-serverless/rules/aws_appsync_graphql_api_tracing.go
33 3 1
func()
in tflint-ruleset-aws-serverless/rules/aws_iam_role_lambda_no_star.go
31 11 1
func()
in tflint-ruleset-aws-serverless/rules/aws_sqs_queue_redrive_policy.go
29 4 1
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_function_default_memory.go
29 4 1
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_function_default_timeout.go
29 4 1
func()
in tflint-ruleset-aws-serverless/rules/aws_sns_topic_subscription_redrive_policy.go
29 4 1
func()
in tflint-ruleset-aws-serverless/rules/aws_iam_role_lambda_no_star.go
28 11 1