awslabs / or-rl-benchmarks
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 500 units with 5,249 lines of code in units (87.7% of code).
    • 1 very complex units (160 lines of code)
    • 0 complex units (0 lines of code)
    • 13 medium complex units (445 lines of code)
    • 40 simple units (873 lines of code)
    • 446 very simple units (3,771 lines of code)
3% | 0% | 8% | 16% | 71%
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
py3% | 0% | 8% | 16% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Vehicle Routing Problem/src22% | 0% | 13% | 35% | 29%
Bin Packing/src0% | 0% | 17% | 22% | 60%
Bin Packing/common0% | 0% | 18% | 0% | 81%
common0% | 0% | 18% | 0% | 81%
Vehicle Routing Problem/common0% | 0% | 18% | 0% | 81%
News Vendor/common0% | 0% | 18% | 0% | 81%
Bin Packing/common/sagemaker_rl0% | 0% | 4% | 16% | 79%
common/sagemaker_rl0% | 0% | 4% | 16% | 79%
Vehicle Routing Problem/common/sagemaker_rl0% | 0% | 4% | 16% | 79%
News Vendor/common/sagemaker_rl0% | 0% | 4% | 16% | 79%
News Vendor/src0% | 0% | 0% | 23% | 76%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_or_solution()
in Vehicle Routing Problem/src/baseline_model.py
160 79 2
def __update_driver_parameters()
in Vehicle Routing Problem/src/vrp_environment.py
29 20 4
def __update_environment_parameters()
in Vehicle Routing Problem/src/vrp_environment.py
31 18 1
def __update_bin_type_distribution_map()
in Bin Packing/src/bin_packing_environment.py
34 15 2
def execute_plan()
in Vehicle Routing Problem/src/baseline_model.py
34 15 2
def get_action()
in Bin Packing/src/baseline_sum_of_squares.py
25 12 1
def wait_for_s3_object()
in Bin Packing/common/misc.py
42 12 10
def wait_for_s3_object()
in common/misc.py
42 12 10
def wait_for_s3_object()
in Vehicle Routing Problem/common/misc.py
42 12 10
def wait_for_s3_object()
in News Vendor/common/misc.py
42 12 10
def get_config_args()
in Bin Packing/common/sagemaker_rl/coach_launcher.py
31 11 2
def get_config_args()
in common/sagemaker_rl/coach_launcher.py
31 11 2
def get_config_args()
in Vehicle Routing Problem/common/sagemaker_rl/coach_launcher.py
31 11 2
def get_config_args()
in News Vendor/common/sagemaker_rl/coach_launcher.py
31 11 2
def whether_get_opt_sln()
in Vehicle Routing Problem/src/baseline_model.py
17 10 4
def copy_checkpoints_to_model_output()
in Bin Packing/common/sagemaker_rl/ray_launcher.py
17 9 1
def copy_checkpoints_to_model_output()
in common/sagemaker_rl/ray_launcher.py
17 9 1
def copy_checkpoints_to_model_output()
in Vehicle Routing Problem/common/sagemaker_rl/ray_launcher.py
17 9 1
def copy_checkpoints_to_model_output()
in News Vendor/common/sagemaker_rl/ray_launcher.py
17 9 1
def get_graph_manager_from_args()
in Bin Packing/common/sagemaker_rl/coach_launcher.py
11 8 2