aws-samples / cdk-deployment-of-locust
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 8 units with 116 lines of code in units (60.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (55 lines of code)
    • 0 medium size units (0 lines of code)
    • 3 small units (40 lines of code)
    • 4 very small units (21 lines of code)
0% | 47% | 0% | 34% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 47% | 0% | 34% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
load_test0% | 48% | 0% | 35% | 16%
locust0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
def create_ec2_cluster()
in load_test/load_test_stack.py
55 6 1
def __init__()
in load_test/load_test_stack.py
17 2 4
def add_peering_route()
in load_test/load_test_stack.py
12 5 5
def get_context()
in load_test/load_test_stack.py
11 3 1
def create_vpc_peering()
in load_test/load_test_stack.py
9 1 2
def prepare_s3_assets()
in load_test/load_test_stack.py
7 1 1
def get_userdata()
in load_test/load_test_stack.py
3 1 2
def test()
in locust/locustfile.py
2 1 1