aws-samples / aws-iot-twinmaker-samples
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 201 units with 3,000 lines of code in units (82.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (148 lines of code)
    • 6 medium complex units (261 lines of code)
    • 17 simple units (484 lines of code)
    • 177 very simple units (2,107 lines of code)
0% | 4% | 8% | 16% | 70%
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% | 5% | 10% | 18% | 65%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
modules/insights0% | 30% | 0% | 5% | 64%
libs/deploy_utils0% | 0% | 13% | 21% | 64%
libs/udq_helper_utils0% | 0% | 45% | 0% | 54%
workspaces/cookiefactory0% | 0% | 51% | 0% | 48%
modules/timestream_telemetry0% | 0% | 7% | 19% | 73%
modules/sitewise0% | 0% | 0% | 30% | 69%
modules/grafana0% | 0% | 0% | 40% | 60%
modules/s30% | 0% | 0% | 5% | 94%
modules/snowflake0% | 0% | 0% | 0% | 100%
libs/connector_utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in src/modules/insights/install_insights_module.py
148 26 0
def process_query()
in src/libs/udq_helper_utils/udq_utils/udq_models.py
49 15 2
def __init__()
in src/libs/udq_helper_utils/udq_utils/udq_models.py
38 14 2
def upload_video()
in src/libs/deploy_utils/VideoUtils.py
70 14 4
def main()
in src/workspaces/cookiefactory/setup_content/__main__.py
70 14 0
def _run_timestream_query()
in src/modules/timestream_telemetry/lambda_function/udq_data_reader.py
17 14 4
def delete_all_component_types()
in src/libs/deploy_utils/WorkspaceUtils.py
17 11 1
def recursive_delete_child_entites()
in src/libs/deploy_utils/WorkspaceUtils.py
20 9 2
def create_update_entity()
in src/modules/sitewise/sync-connector-lambda/importer.py
39 9 3
def delete_workspace_role_and_bucket()
in src/libs/deploy_utils/WorkspaceUtils.py
48 8 1
def update_entity()
in src/libs/deploy_utils/WorkspaceUtils.py
27 8 3
def create_iottwinmaker_entities()
in src/modules/sitewise/sync-connector-lambda/importer.py
22 8 2
def is_sitewise_asset_model_exist()
in src/libs/deploy_utils/VideoUtils.py
18 7 2
def get_iottwinmaker_reference()
in src/modules/timestream_telemetry/lambda_function/udq_data_reader.py
9 7 1
def create_asset_model()
in src/modules/sitewise/lib/util/SiteWiseTelemetryUtils.py
21 7 2
def create_asset()
in src/modules/sitewise/lib/util/SiteWiseTelemetryUtils.py
22 7 3
def create_asset_model_property()
in src/modules/sitewise/lib/util/SiteWiseTelemetryUtils.py
30 7 4
def import_csv_to_sitewise()
in src/modules/sitewise/lib/util/SiteWiseTelemetryUtils.py
33 7 2
def check_or_create_asset_model_hierarchy_id()
in src/libs/deploy_utils/VideoUtils.py
29 6 1
def main()
in src/modules/grafana/cleanup_grafana_dashboard_role.py
36 6 0