aws-samples / amazon-cloudwatch-auto-alarms
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 11 units with 295 lines of code in units (28.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (57 lines of code)
    • 6 medium size units (179 lines of code)
    • 3 small units (52 lines of code)
    • 1 very small units (7 lines of code)
0% | 19% | 60% | 17% | 2%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 19% | 60% | 17% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 19% | 60% | 17% | 2%
Alternative Visuals
Longest Units
Top 11 longest units
Unit# linesMcCabe index# params
57 13 6
def check_alarm_tag()
in src/actions.py
35 5 2
def lambda_handler()
in src/cw_auto_alarms.py
33 8 2
def determine_platform()
in src/actions.py
30 11 1
def create_alarm()
in src/actions.py
30 4 9
29 6 6
def delete_alarms()
in src/actions.py
22 5 1
def boto3_client()
in src/actions.py
20 2 2
def process_alarm_tags()
in src/actions.py
18 7 8
14 7 7
def convert_to_seconds()
in src/actions.py
7 2 1