aws-cloudformation / cfn-lint
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 656 units with 10,583 lines of code in units (80.7% of code).
    • 1 very complex units (90 lines of code)
    • 5 complex units (496 lines of code)
    • 67 medium complex units (2,955 lines of code)
    • 142 simple units (3,334 lines of code)
    • 441 very simple units (3,708 lines of code)
<1% | 4% | 27% | 31% | 35%
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
py<1% | 4% | 27% | 31% | 35%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/cfnlint/decode10% | 0% | 50% | 7% | 31%
src/cfnlint0% | 11% | 29% | 32% | 26%
src/cfnlint/rules/resources0% | 3% | 25% | 32% | 38%
src/cfnlint/rules0% | 21% | 18% | 18% | 41%
src/cfnlint/rules/functions0% | 0% | 37% | 29% | 33%
src/cfnlint/rules/parameters0% | 0% | 37% | 21% | 40%
scripts0% | 0% | 34% | 33% | 31%
src/cfnlint/rules/conditions0% | 0% | 23% | 57% | 18%
src/cfnlint/formatters0% | 0% | 0% | 59% | 40%
src/cfnlint/rules/outputs0% | 0% | 0% | 53% | 46%
src/cfnlint/rules/custom0% | 0% | 0% | 44% | 55%
src/cfnlint/rules/mappings0% | 0% | 0% | 60% | 39%
src/cfnlint/rules/metadata0% | 0% | 0% | 100% | 0%
src/cfnlint/rules/templates0% | 0% | 0% | 20% | 79%
src/cfnlint/decorators0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def create_dict_node_class()
in src/cfnlint/decode/node.py
90 57 1
def get_schema_value_types()
in src/cfnlint/maintenance.py
137 49 0
def propertycheck()
in src/cfnlint/rules/resources/properties/Properties.py
138 47 7
def __init__()
in src/cfnlint/graph.py
59 34 2
def get_scenarios()
in src/cfnlint/conditions.py
79 28 2
def resource_property()
in src/cfnlint/rules/__init__.py
83 27 7
def _check_resource()
in src/cfnlint/rules/resources/Configuration.py
97 25 4
def get_values()
in src/cfnlint/template.py
69 24 4
def decode()
in src/cfnlint/decode/__init__.py
72 23 1
def _replace_local_codeuri()
in src/cfnlint/transform.py
37 23 1
32 21 2
def _get_conditions_from_path()
in src/cfnlint/template.py
37 21 5
def match()
in src/cfnlint/rules/functions/GetAtt.py
63 21 2
def _match_string_objs()
in src/cfnlint/rules/functions/Join.py
57 20 4
def _check_list_for_condition()
in src/cfnlint/rules/resources/properties/Properties.py
59 20 7
def set_template_args()
in src/cfnlint/config.py
31 20 2
def get_value_from_scenario()
in src/cfnlint/template.py
43 19 3
def get_location_yaml()
in src/cfnlint/template.py
33 18 3
45 18 3
def _get_sub_resource_properties()
in src/cfnlint/template.py
45 17 4