aws-samples / aws-cloudfront-waf-ip-set
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 7 units with 190 lines of code in units (84.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (70 lines of code)
    • 3 medium size units (78 lines of code)
    • 2 small units (34 lines of code)
    • 1 very small units (8 lines of code)
0% | 36% | 41% | 17% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 70% | 30% | 0% | 0%
py0% | 0% | 53% | 37% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 36% | 41% | 17% | 4%
Alternative Visuals
Longest Units
Top 7 longest units
Unit# linesMcCabe index# params
constructor()
in lib/cloudfront-waf-lambda-stack.ts
70 1 3
constructor()
in lib/cloudfront-waf-ipset-seeder.ts
30 1 3
def lambda_handler()
in lib/waf-seed-ip.py
26 3 2
def update_ip_set()
in lib/waf-update.py
22 3 3
def lambda_handler()
in lib/waf-update.py
20 7 2
def get_ip_groups_json()
in lib/waf-update.py
14 3 2
def get_ranges_for_service()
in lib/waf-update.py
8 3 2