aws-samples / aws-cloudfront-samples
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 8 units with 120 lines of code in units (59.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (54 lines of code)
    • 2 small units (29 lines of code)
    • 4 very small units (37 lines of code)
0% | 0% | 45% | 24% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 45% | 24% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
update_security_groups_lambda0% | 0% | 45% | 24% | 30%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
def update_security_group()
in update_security_groups_lambda/update_security_groups.py
30 11 4
def update_security_groups()
in update_security_groups_lambda/update_security_groups.py
24 7 2
def lambda_handler()
in update_security_groups_lambda/update_security_groups.py
18 6 2
def get_security_groups_for_update()
in update_security_groups_lambda/update_security_groups.py
11 2 2
def get_ip_groups_json()
in update_security_groups_lambda/update_security_groups.py
10 2 2
def revoke_permissions()
in update_security_groups_lambda/update_security_groups.py
10 2 4
def add_permissions()
in update_security_groups_lambda/update_security_groups.py
10 2 4
def get_ranges_for_service()
in update_security_groups_lambda/update_security_groups.py
7 7 3