aws-samples / aws-service-catalog-preventive-control
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 65 units with 1,744 lines of code in units (28.2% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (121 lines of code)
    • 12 medium complex units (355 lines of code)
    • 9 simple units (222 lines of code)
    • 42 very simple units (1,046 lines of code)
0% | 6% | 20% | 12% | 59%
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% | 20% | 12% | 59%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
control-tower-account-factory/src0% | 8% | 33% | 11% | 45%
resource-selector-lambda0% | 12% | 25% | 29% | 33%
ROOT0% | 0% | 0% | 0% | 100%
resource-compliance-lambda0% | 0% | 0% | 0% | 100%
deployment-lambda0% | 0% | 0% | 0% | 100%
product-selector-lambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in resource-selector-lambda/handler.py
58 47 2
def __process_configuration()
in control-tower-account-factory/src/handler.py
63 34 1
def __baseline_products()
in control-tower-account-factory/src/handler.py
54 25 3
def lambda_handler()
in control-tower-account-factory/src/handler.py
34 21 2
def getSecurityGroup()
in resource-selector-lambda/handler.py
25 19 3
def getRoles()
in resource-selector-lambda/handler.py
20 19 2
def getImage()
in resource-selector-lambda/handler.py
26 19 2
def getKMS()
in resource-selector-lambda/handler.py
16 18 1
def _update_product_constraint()
in control-tower-account-factory/src/common.py
48 16 5
def __get_products_to_provision()
in control-tower-account-factory/src/handler.py
16 15 3
def getACM()
in resource-selector-lambda/handler.py
20 15 2
def _get_product_id()
in control-tower-account-factory/src/common.py
49 13 4
def __add_lambda_to_portfolio_principal()
in control-tower-account-factory/src/common.py
35 13 2
def getPolicy()
in resource-selector-lambda/handler.py
12 11 1
def getSubnets()
in resource-selector-lambda/handler.py
21 10 3
def getSpotPrice()
in resource-selector-lambda/handler.py
90 10 1
def __get_account_list()
in control-tower-account-factory/src/handler.py
24 9 3
def searchObject()
in resource-selector-lambda/handler.py
11 9 3
def __init__()
in control-tower-account-factory/src/handler.py
23 6 11
def __process_paramters()
in control-tower-account-factory/src/handler.py
11 6 2