aws-samples / happy-path
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 16 units with 116 lines of code in units (5.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (25 lines of code)
    • 3 small units (39 lines of code)
    • 12 very small units (52 lines of code)
0% | 0% | 21% | 33% | 44%
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% | 21% | 33% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
frontend/src0% | 0% | 22% | 34% | 43%
workflows/functions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
async created()
in frontend/src/auth/index.js
25 4 0
async handleRedirectCallback()
in frontend/src/auth/index.js
14 2 0
saveAsset()
in frontend/src/store/index.js
13 1 2
async loginWithPopup()
in frontend/src/auth/index.js
12 2 1
savePlace()
in frontend/src/store/index.js
10 1 2
data()
in frontend/src/auth/index.js
10 1 0
setPosition()
in frontend/src/store/index.js
4 1 2
setInitialized()
in frontend/src/store/index.js
4 1 2
setUser()
in frontend/src/store/index.js
3 1 2
loginWithRedirect()
in frontend/src/auth/index.js
3 1 1
getIdTokenClaims()
in frontend/src/auth/index.js
3 1 1
getTokenSilently()
in frontend/src/auth/index.js
3 1 1
getTokenWithPopup()
in frontend/src/auth/index.js
3 1 1
logout()
in frontend/src/auth/index.js
3 1 1
install()
in frontend/src/auth/index.js
3 1 2
await publishItem()
in workflows/functions/publish/app.js
3 1 1