awslabs / amazon-documentdb-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 175 units with 2,649 lines of code in units (68.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (94 lines of code)
    • 7 medium complex units (395 lines of code)
    • 17 simple units (419 lines of code)
    • 150 very simple units (1,741 lines of code)
0% | 3% | 14% | 15% | 65%
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% | 3% | 14% | 15% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
index-tool/migrationtools0% | 20% | 41% | 10% | 27%
compat-tool/compat0% | 0% | 35% | 8% | 55%
global-clusters-automation0% | 0% | 8% | 34% | 57%
cosmos-db-migration-utility/src/migrator-app/migrators0% | 0% | 13% | 19% | 67%
cosmos-db-migration-utility/src/configure0% | 0% | 24% | 0% | 75%
cosmos-db-migration-utility/src/lambda/batch-request-reader0% | 0% | 0% | 12% | 87%
cosmos-db-migration-utility/src/migrator-app/helpers0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/lambda/gap-watch-request-reader0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/lambda/app-request-reader0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/migrator-app/common0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/migrator-app0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/configure/common0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def find_compatibility_issues()
in index-tool/migrationtools/documentdb_index_tool.py
94 26 2
def process_log_file()
in compat-tool/compat/compat.py
74 19 5
def run()
in index-tool/migrationtools/documentdb_index_tool.py
60 17 1
def main()
in index-tool/migrationtools/documentdb_index_tool.py
95 15 0
def watch()
in cosmos-db-migration-utility/src/migrator-app/migrators/CollectionMigrator.py
33 14 3
def _restore_indexes()
in index-tool/migrationtools/documentdb_index_tool.py
39 14 3
def __validate_arguments()
in cosmos-db-migration-utility/src/configure/commandline_parser.py
26 13 1
def lambda_handler()
in global-clusters-automation/failover_and_convert_lambda_function.py
68 11 2
def failover()
in global-clusters-automation/failover_and_delete_global_cluster.py
57 10 5
def convert_regional_to_global()
in global-clusters-automation/add_secondarycluster.py
40 9 3
def is_request_processed()
in global-clusters-automation/convert_to_global_lambda_function.py
20 8 1
def _get_metadata_from_file()
in index-tool/migrationtools/documentdb_index_tool.py
31 8 2
def process_line()
in compat-tool/compat/compat.py
17 8 5
def wait_for_promotion_to_complete()
in global-clusters-automation/failover_and_delete_global_cluster.py
14 7 2
def validate_input()
in global-clusters-automation/failover_and_delete_lambda_function.py
25 7 1
def watch()
in cosmos-db-migration-utility/src/migrator-app/migrators/DatabaseMigrator.py
27 7 3
def _get_compatible_metadata()
in index-tool/migrationtools/documentdb_index_tool.py
20 7 3
def get_secondary_clusters()
in global-clusters-automation/failover_and_delete_global_cluster.py
20 6 1
def delete_global_cluster()
in global-clusters-automation/failover_and_delete_global_cluster.py
20 6 4
def validate_input()
in global-clusters-automation/failover_and_convert_lambda_function.py
21 6 1