awslabs / aws-ec2rescue-linux
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 4,541 units with 47,426 lines of code in units (64.1% of code).
    • 83 very long units (9,014 lines of code)
    • 48 long units (3,121 lines of code)
    • 332 medium size units (9,942 lines of code)
    • 735 small units (10,599 lines of code)
    • 3,343 very small units (14,750 lines of code)
19% | 6% | 20% | 22% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py19% | 6% | 20% | 22% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib19% | 5% | 20% | 22% | 31%
ec2rlcore4% | 26% | 33% | 17% | 18%
tools0% | 0% | 91% | 0% | 8%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _parse()
in lib/dateutil/parser.py
274 38 6
def _iter()
in lib/dateutil/rrule.py
224 97 1
def __init__()
in lib/dateutil/rrule.py
199 18 18
def parse()
in lib/dateutil/parser.py
125 13 2
def setup()
in ec2rlcore/menu.py
116 57 2
def _parse_rfc()
in lib/dateutil/rrule.py
111 45 9
def _parse_rfc()
in lib/dateutil/tz/tz.py
111 37 2
def analyze_scalar()
in lib/python2/yaml/emitter.py
111 30 2
def analyze_scalar()
in lib/python3/yaml/emitter.py
111 30 2
def urlopen()
in lib/requests/packages/urllib3/connectionpool.py
110 18 14
def rebuild()
in lib/dateutil/rrule.py
106 34 3
def _seg_0()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_1()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_2()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_3()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_4()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_5()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_6()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_7()
in lib/requests/packages/idna/uts46data.py
103 1 0
def _seg_8()
in lib/requests/packages/idna/uts46data.py
103 1 0