aws-samples / amazon-cloudfront-functions
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 13 units with 143 lines of code in units (96.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (29 lines of code)
    • 4 small units (61 lines of code)
    • 8 very small units (53 lines of code)
0% | 0% | 20% | 42% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 20% | 42% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
verify-jwt0% | 0% | 40% | 26% | 33%
redirect-based-on-country0% | 0% | 0% | 100% | 0%
url-rewrite-single-page-apps0% | 0% | 0% | 100% | 0%
add-security-headers0% | 0% | 0% | 100% | 0%
add-cors-header0% | 0% | 0% | 0% | 100%
add-origin-header0% | 0% | 0% | 0% | 100%
add-true-client-ip-header0% | 0% | 0% | 0% | 100%
add-cache-control-header0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
function jwt_decode()
in verify-jwt/index.js
29 9 4
function handler()
in redirect-based-on-country/index.js
20 3 1
function handler()
in verify-jwt/index.js
19 3 1
function handler()
in url-rewrite-single-page-apps/index.js
11 3 1
function handler()
in add-security-headers/index.js
11 1 1
function _constantTimeEquals()
in verify-jwt/index.js
10 3 2
function handler()
in add-cors-header/index.js
9 3 1
function handler()
in add-origin-header/index.js
8 2 1
function _verify()
in verify-jwt/index.js
8 2 5
function handler()
in add-true-client-ip-header/index.js
6 1 1
function handler()
in add-cache-control-header/index.js
6 1 1
function _sign()
in verify-jwt/index.js
3 1 3
function _base64urlDecode()
in verify-jwt/index.js
3 1 1