aws-samples / genetic-algorithm-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 18 units with 201 lines of code in units (66.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 2 simple units (29 lines of code)
    • 16 very simple units (172 lines of code)
0% | 0% | 0% | 14% | 85%
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% | 0% | 14% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 0% | 14% | 85%
Most Complex Units
Top 18 most complex units
Unit# linesMcCabe index# params
21 9 2
def mutate_candidate_maybe()
in src/genetic_algorithm.py
8 6 1
def find_best_path()
in src/genetic_algorithm.py
56 5 0
def load_delivery_stops()
in src/genetic_algorithm.py
13 4 0
def tourney_select()
in src/genetic_algorithm.py
4 4 1
def select_parents()
in src/genetic_algorithm.py
7 4 1
def build_list_of_stops()
in src/create_delivery_stops.py
21 4 0
def calc_score_for_candidate()
in src/genetic_algorithm.py
7 2 1
def dist()
in src/genetic_algorithm.py
4 2 2
def create_random_initial_population()
in src/genetic_algorithm.py
6 2 0
def displacement_mutation()
in src/genetic_algorithm.py
9 2 1
def write_per_generation_scores()
in src/genetic_algorithm.py
9 2 2
def __init__()
in src/genetic_algorithm.py
5 1 1
def __repr__()
in src/genetic_algorithm.py
2 1 1
def swap_mutation()
in src/genetic_algorithm.py
4 1 1
def check_candidate_validity()
in src/genetic_algorithm.py
4 1 1
def write_best_solution_to_dynamodb()
in src/genetic_algorithm.py
15 1 1
def write_delivery_stops()
in src/create_delivery_stops.py
6 1 2