aws-samples / cloudfront-app-with-cognito-auth-at-edge
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 74 units with 685 lines of code in units (72.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 3 medium size units (71 lines of code)
    • 21 small units (309 lines of code)
    • 49 very small units (251 lines of code)
0% | 7% | 10% | 45% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 7% | 10% | 45% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 10% | 9% | 49% | 30%
src0% | 0% | 15% | 23% | 61%
example/src0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
54 21 3
validate()
in lib/token.js
25 11 1
set()
in lib/token.js
24 8 1
22 7 1
function formatDate()
in lib/util.js
20 9 2
function formatDate()
in lib/util.js
20 9 2
value: prefixUrl()
in lib/index.js
20 6 1
init()
in lib/index.js
19 3 0
make()
in src/index.js
19 4 2
get()
in lib/credentials.js
16 4 2
15 4 2
parseCredentials()
in lib/credentials.js
15 7 1
constructor()
in lib/index.js
15 5 3
get dataCookie()
in lib/index.js
15 7 0
15 9 2
function getCookie()
in example/src/App.js
15 4 1
14 4 1
refresh()
in lib/credentials.js
13 3 2
getRedirectParams()
in lib/token.js
12 1 0
11 3 1