aws-quickstart / quickstart-taskcat-ci
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 871 units with 15,400 lines of code in units (65.8% of code).
    • 78 very long units (8,046 lines of code)
    • 8 long units (578 lines of code)
    • 77 medium size units (2,437 lines of code)
    • 126 small units (1,829 lines of code)
    • 582 very small units (2,510 lines of code)
52% | 3% | 15% | 11% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py52% | 3% | 15% | 11% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
functions/source/idna94% | <1% | 3% | <1% | <1%
functions/source/urllib38% | 0% | 27% | 27% | 37%
functions/source/requests0% | 13% | 27% | 25% | 33%
functions/source/urllib3/contrib0% | 12% | 39% | 22% | 25%
functions/source/chardet0% | 6% | 22% | 27% | 42%
functions/source/urllib3/util0% | 0% | 34% | 30% | 34%
functions/source/urllib3/packages0% | 0% | 36% | 16% | 47%
functions/source0% | 0% | 72% | 13% | 13%
functions/source/chardet/cli0% | 0% | 0% | 100% | 0%
functions/source/certifi0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def urlopen()
in functions/source/urllib3/connectionpool.py
115 21 14
def _seg_0()
in functions/source/idna/uts46data.py
103 1 0
def _seg_1()
in functions/source/idna/uts46data.py
103 1 0
def _seg_2()
in functions/source/idna/uts46data.py
103 1 0
def _seg_3()
in functions/source/idna/uts46data.py
103 1 0
def _seg_4()
in functions/source/idna/uts46data.py
103 1 0
def _seg_5()
in functions/source/idna/uts46data.py
103 1 0
def _seg_6()
in functions/source/idna/uts46data.py
103 1 0
def _seg_7()
in functions/source/idna/uts46data.py
103 1 0
def _seg_8()
in functions/source/idna/uts46data.py
103 1 0
def _seg_9()
in functions/source/idna/uts46data.py
103 1 0
def _seg_10()
in functions/source/idna/uts46data.py
103 1 0
def _seg_11()
in functions/source/idna/uts46data.py
103 1 0
def _seg_12()
in functions/source/idna/uts46data.py
103 1 0
def _seg_13()
in functions/source/idna/uts46data.py
103 1 0
def _seg_14()
in functions/source/idna/uts46data.py
103 1 0
def _seg_15()
in functions/source/idna/uts46data.py
103 1 0
def _seg_16()
in functions/source/idna/uts46data.py
103 1 0
def _seg_17()
in functions/source/idna/uts46data.py
103 1 0
def _seg_18()
in functions/source/idna/uts46data.py
103 1 0