aws-samples / amazon-cognito-identity-management-workshop
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 76 units with 680 lines of code in units (14.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (59 lines of code)
    • 4 medium size units (114 lines of code)
    • 17 small units (234 lines of code)
    • 54 very small units (273 lines of code)
0% | 8% | 16% | 34% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 8% | 16% | 34% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
website/src/components0% | 30% | 14% | 33% | 21%
website/src/pages0% | 0% | 58% | 20% | 21%
website/public/js0% | 0% | 10% | 21% | 67%
website/src/auth0% | 0% | 0% | 49% | 50%
website/server0% | 0% | 0% | 100% | 0%
website/src0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async componentDidMount()
in website/src/components/ESRIMap.js
59 4 0
render()
in website/src/pages/MainApp.js
33 2 0
async onClick()
in website/src/pages/MainApp.js
31 3 0
async loadEsriModules()
in website/src/components/ESRIMap.js
28 1 0
function handleRegister()
in website/public/js/cognito-auth.js
22 3 1
constructor()
in website/src/components/BaseMap.js
19 1 1
constructor()
in website/src/components/ESRIMap.js
19 1 1
function()
in website/server/requestUnicorn.js
18 2 2
function requestUnicorn()
in website/public/js/ride.js
17 1 1
render()
in website/src/index.js
16 1 0
function animateArrival()
in website/public/js/ride.js
15 3 1
componentDidMount()
in website/src/components/BaseMap.js
14 1 0
renderSignUp()
in website/src/auth/SignUp.js
13 2 0
$()
in website/public/js/ride.js
13 3 1
constructor()
in website/src/auth/SignUp.js
12 1 1
updateExtent()
in website/src/components/ESRIMap.js
12 2 1
renderSignIn()
in website/src/auth/SignIn.js
11 1 0
renderConfirm()
in website/src/auth/SignIn.js
11 1 0
async onSubmitVerification()
in website/src/auth/SignUp.js
11 1 1
renderConfirm()
in website/src/auth/SignUp.js
11 1 0