aws-samples / aws-vpc-cidr-mgmt
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 1,260 units with 18,439 lines of code in units (64.7% of code).
    • 80 very long units (8,246 lines of code)
    • 13 long units (820 lines of code)
    • 98 medium size units (2,932 lines of code)
    • 184 small units (2,688 lines of code)
    • 885 very small units (3,753 lines of code)
44% | 4% | 15% | 14% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py44% | 4% | 15% | 14% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/idna94% | <1% | 3% | <1% | <1%
lambda51% | 0% | 0% | 24% | 23%
lambda/requests0% | 13% | 27% | 25% | 32%
lambda/netaddr/ip0% | 6% | 34% | 24% | 34%
lambda/netaddr0% | 31% | 13% | 29% | 26%
lambda/urllib30% | 5% | 22% | 31% | 40%
lambda/chardet0% | 6% | 22% | 27% | 42%
lambda/urllib3/util0% | 7% | 7% | 44% | 39%
lambda/urllib3/contrib0% | 5% | 39% | 21% | 33%
lambda/urllib3/packages0% | 13% | 18% | 11% | 55%
lambda/netaddr/eui0% | 0% | 39% | 17% | 43%
lambda/requests_aws4auth0% | 0% | 62% | 24% | 12%
lambda/netaddr/strategy0% | 0% | 16% | 22% | 61%
lambda/chardet/cli0% | 0% | 0% | 100% | 0%
lambda/netaddr/contrib0% | 0% | 0% | 68% | 31%
lambda/certifi0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambda/index.py
109 14 2
def _seg_0()
in lambda/idna/uts46data.py
103 1 0
def _seg_1()
in lambda/idna/uts46data.py
103 1 0
def _seg_2()
in lambda/idna/uts46data.py
103 1 0
def _seg_3()
in lambda/idna/uts46data.py
103 1 0
def _seg_4()
in lambda/idna/uts46data.py
103 1 0
def _seg_5()
in lambda/idna/uts46data.py
103 1 0
def _seg_6()
in lambda/idna/uts46data.py
103 1 0
def _seg_7()
in lambda/idna/uts46data.py
103 1 0
def _seg_8()
in lambda/idna/uts46data.py
103 1 0
def _seg_9()
in lambda/idna/uts46data.py
103 1 0
def _seg_10()
in lambda/idna/uts46data.py
103 1 0
def _seg_11()
in lambda/idna/uts46data.py
103 1 0
def _seg_12()
in lambda/idna/uts46data.py
103 1 0
def _seg_13()
in lambda/idna/uts46data.py
103 1 0
def _seg_14()
in lambda/idna/uts46data.py
103 1 0
def _seg_15()
in lambda/idna/uts46data.py
103 1 0
def _seg_16()
in lambda/idna/uts46data.py
103 1 0
def _seg_17()
in lambda/idna/uts46data.py
103 1 0
def _seg_18()
in lambda/idna/uts46data.py
103 1 0