aws-samples / aws-health-aware
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 37 units with 1,285 lines of code in units (45.4% of code).
    • 3 very long units (314 lines of code)
    • 8 long units (516 lines of code)
    • 8 medium size units (276 lines of code)
    • 11 small units (148 lines of code)
    • 7 very small units (31 lines of code)
24% | 40% | 21% | 11% | 2%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py24% | 40% | 21% | 11% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT24% | 40% | 21% | 11% | 2%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_message_for_slack()
in messagegenerator.py
106 12 5
def get_secrets()
in handler.py
105 16 0
def get_org_message_for_slack()
in messagegenerator.py
103 10 5
72 21 4
68 17 1
def get_message_for_teams()
in messagegenerator.py
68 6 4
def get_org_message_for_teams()
in messagegenerator.py
66 5 4
65 12 6
def update_ddb()
in handler.py
65 12 6
def send_alert()
in handler.py
61 21 4
51 11 1
def get_message_for_eventbridge()
in messagegenerator.py
49 6 4
48 5 4
def get_message_for_chime()
in messagegenerator.py
41 6 4
def get_org_message_for_chime()
in messagegenerator.py
38 5 4
def get_sts_token()
in handler.py
30 2 1
def send_email()
in handler.py
24 1 4
24 1 4
22 4 4
18 3 3