aws-samples / data-protection
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 30 units with 1,820 lines of code in units (25.7% of code).
    • 5 very long units (560 lines of code)
    • 13 long units (934 lines of code)
    • 6 medium size units (255 lines of code)
    • 4 small units (60 lines of code)
    • 2 very small units (11 lines of code)
30% | 51% | 14% | 3% | <1%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py30% | 51% | 14% | 3% | <1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
usecase-440% | 40% | 13% | 5% | <1%
usecase-541% | 50% | 0% | 5% | 1%
usecase-148% | 51% | 0% | 0% | 0%
usecase-9/templates0% | 100% | 0% | 0% | 0%
site/usecase-70% | 43% | 56% | 0% | 0%
usecase-9/code0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in usecase-4/usecase-4-step-2.py
131 9 0
def main()
in usecase-5/usecase-5-step-9-cleanup.py
110 21 0
def main()
in usecase-5/usecase-5-step-2.py
110 8 0
def main()
in usecase-1/kms_key_creation-Step-1.py
107 1 0
def main()
in usecase-4/usecase-4-step-6.py
102 9 0
def main()
in usecase-9/templates/smime-sign-cert.py
91 10 0
def main()
in usecase-9/templates/smime-encrypt-cert.py
90 10 0
def main()
in usecase-4/usecase-4-step-10-cleanup.py
89 19 0
def main()
in usecase-5/usecase-5-step-1.py
81 12 0
def main()
in usecase-4/usecase-4-step-3.py
76 5 0
def main()
in usecase-4/usecase-4-step-4.py
72 3 0
def main()
in usecase-9/templates/templates.py
70 10 0
def main()
in site/usecase-7/templates/templates.py
66 9 0
def main()
in usecase-5/usecase-5-step-4.py
66 3 0
def main()
in usecase-5/usecase-5-step-6.py
62 15 0
def main()
in usecase-5/usecase-5-step-3.py
59 5 0
def main()
in usecase-1/usecase-1-cleanup-Step-3.py
59 13 0
def main()
in usecase-1/usecase-1-Step-2.py
53 5 0
def main()
in usecase-4/usecase-4-step-1.py
50 3 0
def main()
in site/usecase-7/code/revoke-certs.py
47 7 0