aws-quickstart / quickstart-swift-digital-connectivity
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 45 units with 844 lines of code in units (83.1% of code).
    • 1 very long units (101 lines of code)
    • 4 long units (300 lines of code)
    • 7 medium size units (217 lines of code)
    • 6 small units (93 lines of code)
    • 27 very small units (133 lines of code)
11% | 35% | 25% | 11% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 35% | 25% | 11% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
security35% | 21% | 24% | 4% | 14%
network0% | 46% | 10% | 11% | 31%
swift_main_stack0% | 100% | 0% | 0% | 0%
base_host_group0% | 74% | 0% | 21% | 4%
swift_iam_role0% | 0% | 91% | 0% | 8%
swift_mq0% | 0% | 94% | 0% | 5%
swift_database0% | 0% | 91% | 0% | 8%
swift_sagsnl0% | 0% | 0% | 100% | 0%
swift_amh0% | 0% | 0% | 100% | 0%
cmk0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def enforce_security_groups_rules()
in security/swift_security.py
101 1 1
def __init__()
in network/swift_vpc_endpoints.py
93 3 10
def __init__()
in swift_main_stack/main.py
78 14 4
def __init__()
in base_host_group/host_group.py
67 7 12
def create_instance_role()
in security/generic_security.py
62 1 2
def create_swift_infrastructure_role()
in swift_iam_role/swift_iam_role.py
37 3 4
def add_security_group_rule()
in security/generic_security.py
36 6 9
def create_swift_instance_operator_role()
in swift_iam_role/swift_iam_role.py
35 3 2
def create_nacls()
in security/swift_security.py
33 1 1
def __init__()
in swift_mq/swift_mq.py
33 1 7
def generate()
in network/generic_network.py
22 4 1
def __init__()
in swift_database/swift_database.py
21 2 7
def __init__()
in swift_sagsnl/swift_sagsnl.py
20 1 11
def get_user_data()
in base_host_group/host_group.py
19 1 2
def __init__()
in swift_amh/swift_amh.py
18 1 10
def create_security_group()
in security/generic_security.py
13 3 4
def create_interface_endpoint()
in network/swift_vpc_endpoints.py
12 2 5
def __init__()
in network/generic_network.py
11 1 5
def __init__()
in security/swift_security.py
10 1 8
def __init__()
in cmk/generic_cmk.py
10 1 4