aws-samples / aws-iot-sitewise-tools
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 17 units with 231 lines of code in units (47.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (33 lines of code)
    • 3 simple units (48 lines of code)
    • 13 very simple units (150 lines of code)
0% | 0% | 14% | 20% | 64%
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% | 0% | 14% | 20% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sitewise_export_tools0% | 0% | 47% | 24% | 27%
sitewise_monitor_dashboard_replicator0% | 0% | 0% | 19% | 80%
Most Complex Units
Top 17 most complex units
Unit# linesMcCabe index# params
def case_handler_1st_pass()
in sitewise_export_tools/asset_model_exporter.py
33 20 2
def case_handler_2nd_pass()
in sitewise_export_tools/asset_model_exporter.py
10 7 2
def dashboard_sync()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
31 6 1
def walk_dict_filter()
in sitewise_export_tools/asset_model_exporter.py
7 6 3
def list_projects()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_copy.py
9 5 1
def list_projects()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
9 5 1
def walk_dict()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
7 5 3
def get_source_dashboard()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
40 5 1
def walk_dict()
in sitewise_export_tools/asset_model_exporter.py
7 5 3
def list_portals()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_copy.py
9 4 0
def list_dashboards()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_copy.py
9 4 1
def list_portals()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
9 4 0
def list_dashboards()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
9 4 1
def update_definition()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
10 4 3
def list_assets()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
8 3 1
def source_asset_id_check()
in sitewise_monitor_dashboard_replicator/sitewise_dashboard_replicator.py
12 3 1
def get_models()
in sitewise_export_tools/asset_model_exporter.py
12 2 0