aws-samples / genetic-algorithm-on-aws
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 18 units with 201 lines of code in units (66.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (56 lines of code)
    • 2 medium size units (42 lines of code)
    • 2 small units (28 lines of code)
    • 13 very small units (75 lines of code)
0% | 27% | 20% | 13% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 27% | 20% | 13% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 27% | 20% | 13% | 37%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
def find_best_path()
in src/genetic_algorithm.py
56 5 0
21 9 2
def build_list_of_stops()
in src/create_delivery_stops.py
21 4 0
def write_best_solution_to_dynamodb()
in src/genetic_algorithm.py
15 1 1
def load_delivery_stops()
in src/genetic_algorithm.py
13 4 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 mutate_candidate_maybe()
in src/genetic_algorithm.py
8 6 1
def calc_score_for_candidate()
in src/genetic_algorithm.py
7 2 1
def select_parents()
in src/genetic_algorithm.py
7 4 1
def create_random_initial_population()
in src/genetic_algorithm.py
6 2 0
def write_delivery_stops()
in src/create_delivery_stops.py
6 1 2
def __init__()
in src/genetic_algorithm.py
5 1 1
def dist()
in src/genetic_algorithm.py
4 2 2
def tourney_select()
in src/genetic_algorithm.py
4 4 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 __repr__()
in src/genetic_algorithm.py
2 1 1