awslabs / serverless-rules
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 160 units with 1,861 lines of code in units (76.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (386 lines of code)
    • 16 simple units (510 lines of code)
    • 139 very simple units (965 lines of code)
0% | 0% | 20% | 27% | 51%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go0% | 0% | 24% | 24% | 51%
py0% | 0% | 0% | 45% | 55%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tflint-ruleset-aws-serverless/rules0% | 0% | 24% | 24% | 51%
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%
Most Complex Units
Top 20 most complex 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_lambda_permission_multiple_principals.go
65 11 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_iam_role_lambda_no_star.go
28 11 1
def _get_valid_functions()
in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py
13 10 2
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_apigatewayv2_stage_throttling.go
65 8 1
func()
in tflint-ruleset-aws-serverless/rules/aws_lambda_event_source_mapping_failure_destination.go
67 8 1
def _get_principals()
in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py
11 7 2
def _get_actions()
in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py
10 7 2
def _match_rest_api()
in cfn-lint-serverless/cfn_lint_serverless/rules/api_gateway.py
10 7 3
def __init__()
in cfn-lint-serverless/cfn_lint_serverless/utils.py
14 7 3
func()
in tflint-ruleset-aws-serverless/rules/aws_sfn_state_machine_tracing.go
55 7 1
def match()
in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py
8 6 2
def match()
in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py
15 6 2
def match()
in cfn-lint-serverless/cfn_lint_serverless/rules/lambda_.py
17 6 2
def match()
in cfn-lint-serverless/cfn_lint_serverless/rules/api_gateway.py
12 6 2
def _get_from_sub()
in cfn-lint-serverless/cfn_lint_serverless/utils.py
16 6 3