awslabs / scale-out-computing-on-aws
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 279 units with 8,632 lines of code in units (26.1% of code).
    • 3 very complex units (612 lines of code)
    • 7 complex units (905 lines of code)
    • 48 medium complex units (3,003 lines of code)
    • 57 simple units (1,830 lines of code)
    • 164 very simple units (2,282 lines of code)
7% | 10% | 34% | 21% | 26%
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
py7% | 10% | 34% | 21% | 26%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
installer/resources/src21% | 10% | 37% | 18% | 12%
source/soca/cluster_manager19% | 0% | 49% | 9% | 21%
source/soca/cluster_web_ui/api0% | 23% | 33% | 22% | 20%
source/soca/cluster_web_ui/views0% | 5% | 21% | 30% | 42%
source/soca/cluster_web_ui/scheduled_tasks0% | 0% | 85% | 8% | 5%
source/soca/cluster_web_ui0% | 0% | 12% | 32% | 54%
source/soca/cluster_analytics0% | 0% | 19% | 49% | 31%
source/soca/cluster_hooks/queuejob0% | 0% | 42% | 0% | 57%
installer/resources/functions/CreateELBSSLCertificate0% | 0% | 0% | 59% | 40%
source/soca/cluster_manager/utilities0% | 0% | 0% | 60% | 40%
installer/resources/functions/ResetDSPassword0% | 0% | 0% | 100% | 0%
installer/resources/functions/SolutionMetricsLambda0% | 0% | 0% | 0% | 100%
installer/resources/functions/GetESPrivateIPLambda0% | 0% | 0% | 0% | 100%
installer/resources/functions/TagEC2ResourceLambda0% | 0% | 0% | 0% | 100%
source/soca/cluster_hooks0% | 0% | 0% | 0% | 100%
installer/resources/functions/EFSThroughputLambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def check_config()
in source/soca/cluster_manager/add_nodes.py
266 114 1
def validate_sg_rules()
in installer/resources/src/find_existing_resources.py
150 62 3
def get_install_parameters()
in installer/resources/src/install_soca.py
196 57 0
def post()
in source/soca/cluster_web_ui/api/v1/dcv/create_windows_desktop.py
206 47 2
def get()
in source/soca/cluster_web_ui/api/v1/dcv/list_desktops.py
137 31 1
def storage()
in installer/resources/src/cdk_construct.py
103 30 1
def user_has_permission()
in source/soca/cluster_web_ui/views/my_files.py
87 29 3
def post()
in source/soca/cluster_web_ui/api/v1/dcv/create_linux_desktop.py
190 27 2
def iam_roles()
in installer/resources/src/cdk_construct.py
64 27 1
def post()
in source/soca/cluster_web_ui/api/v1/ldap/activedirectory/user.py
118 26 1
def windows_auto_stop_instance()
in source/soca/cluster_web_ui/scheduled_tasks/manage_dcv_instances_lifecycle.py
104 25 1
def linux_auto_stop_instance()
in source/soca/cluster_web_ui/scheduled_tasks/manage_dcv_instances_lifecycle.py
98 25 1
def main()
in source/soca/cluster_manager/add_nodes.py
285 25 1
def validate_soca_config()
in installer/resources/src/install_soca.py
41 24 2
def get_rules_for_security_group()
in installer/resources/src/find_existing_resources.py
58 24 2
def index()
in source/soca/cluster_web_ui/views/my_files.py
81 22 0
def post()
in source/soca/cluster_web_ui/api/v1/ldap/openldap/user.py
105 22 1
def get_all_compute_instances()
in source/soca/cluster_manager/nodes_manager.py
86 22 1
def verify_vcpus_limit()
in source/soca/cluster_manager/add_nodes.py
61 21 3
def put()
in source/soca/cluster_web_ui/api/v1/dcv/stop_desktop.py
72 20 3