aws-samples / hostname-as-target-for-elastic-load-balancer
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 702 units with 7,105 lines of code in units (70.9% of code).
    • 4 very long units (439 lines of code)
    • 11 long units (773 lines of code)
    • 65 medium size units (1,951 lines of code)
    • 115 small units (1,635 lines of code)
    • 507 very small units (2,307 lines of code)
6% | 10% | 27% | 23% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py6% | 10% | 27% | 23% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/dns8% | 12% | 29% | 18% | 30%
source/dns/rdtypes/ANY0% | 7% | 27% | 30% | 34%
source0% | 30% | 11% | 44% | 13%
source/dns/rdtypes/IN0% | 0% | 29% | 30% | 40%
source/dns/rdtypes0% | 0% | 0% | 40% | 59%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def query()
in source/dns/resolver.py
129 39 8
def _validate_rrsig()
in source/dns/dnssec.py
105 15 5
def xfr()
in source/dns/query.py
103 29 16
def get()
in source/dns/tokenizer.py
102 39 3
def from_text()
in source/dns/rdtypes/ANY/LOC.py
95 32 6
def _getaddrinfo()
in source/dns/resolver.py
93 40 6
def _get_section()
in source/dns/message.py
91 24 3
def _generate_line()
in source/dns/zone.py
88 23 1
def read()
in source/dns/zone.py
72 20 1
def _rr_line()
in source/dns/zone.py
62 17 1
def lambda_handler()
in source/elb_hostname_as_target.py
57 18 2
def from_text()
in source/dns/name.py
56 22 3
def from_unicode()
in source/dns/name.py
55 22 3
def __init__()
in source/dns/resolver.py
53 22 6
def inet_ntoa()
in source/dns/ipv6.py
51 3 1
def from_text()
in source/dns/rdtypes/ANY/NSEC3.py
48 11 6
def sign()
in source/dns/tsig.py
44 8 13
def validate()
in source/dns/tsig.py
44 11 11
def inet_aton()
in source/dns/ipv6.py
44 18 1
def _rr_line()
in source/dns/message.py
44 13 2