aws / serverless-application-model
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 774 units with 8,026 lines of code in units (49.0% of code).
    • 0 very complex units (0 lines of code)
    • 7 complex units (534 lines of code)
    • 33 medium complex units (1,235 lines of code)
    • 112 simple units (2,239 lines of code)
    • 622 very simple units (4,018 lines of code)
0% | 6% | 15% | 27% | 50%
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
py0% | 6% | 15% | 27% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
samtranslator/model0% | 10% | 18% | 26% | 43%
samtranslator/utils0% | 22% | 17% | 7% | 52%
samtranslator/translator0% | 0% | 40% | 20% | 38%
integration/helpers0% | 0% | 12% | 14% | 73%
samtranslator/plugins0% | 0% | 10% | 43% | 46%
samtranslator/swagger0% | 0% | 12% | 45% | 41%
samtranslator/open_api0% | 0% | 8% | 33% | 58%
samtranslator/intrinsics0% | 0% | 0% | 28% | 71%
samtranslator/sdk0% | 0% | 0% | 42% | 57%
samtranslator/parser0% | 0% | 0% | 62% | 37%
samtranslator/feature_toggle0% | 0% | 0% | 25% | 74%
samtranslator/validator0% | 0% | 0% | 35% | 64%
samtranslator/policy_template_processor0% | 0% | 0% | 22% | 77%
samtranslator0% | 0% | 0% | 40% | 59%
samtranslator/metrics0% | 0% | 0% | 0% | 100%
integration0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _add_swagger_integration()
in samtranslator/model/eventsources/push.py
176 49 4
def _openapi_postprocess()
in samtranslator/model/api/api_generator.py
43 31 2
def _construct_api_domain()
in samtranslator/model/api/api_generator.py
105 30 2
def to_py27_compatible_template()
in samtranslator/utils/py27hash_fix.py
41 30 2
def _add_swagger_integration()
in samtranslator/model/stepfunctions/events.py
81 28 5
def to_cloudformation()
in samtranslator/model/eventsources/pull.py
64 26 2
24 26 1
def _construct_usage_plan()
in samtranslator/model/api/api_generator.py
70 23 2
def _link_policy()
in samtranslator/model/eventsources/pull.py
20 21 3
def _construct_api_domain()
in samtranslator/model/api/http_api_generator.py
70 19 2
def _validate_input_parameters()
in samtranslator/model/apigatewayv2.py
34 19 1
def translate()
in samtranslator/translator/translator.py
82 18 5
def _add_vpc_resource_policy_for_method()
in samtranslator/swagger/swagger.py
50 18 4
def _add_api_to_swagger()
in samtranslator/plugins/api/implicit_api_plugin.py
31 18 4
def _maybe_add_update_replace_policy_to_implicit_api()
in samtranslator/plugins/api/implicit_api_plugin.py
26 17 2
def _construct_code_dict()
in samtranslator/model/sam_resources.py
33 16 1
def _add_auth_to_openapi_integration()
in samtranslator/model/eventsources/push.py
50 16 3
def describe_stack_events()
in integration/helpers/deployer/deployer.py
50 16 4
def _add_cors()
in samtranslator/model/api/http_api_generator.py
39 15 1
def _maybe_add_deletion_policy_to_implicit_api()
in samtranslator/plugins/api/implicit_api_plugin.py
21 14 2