aws-samples / aws-dev-hour-frontend
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 22 units with 491 lines of code in units (28.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (122 lines of code)
    • 7 medium size units (233 lines of code)
    • 7 small units (98 lines of code)
    • 6 very small units (38 lines of code)
0% | 24% | 47% | 19% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 24% | 47% | 19% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/components/auth0% | 69% | 0% | 14% | 16%
src/lib0% | 100% | 0% | 0% | 0%
src/components0% | 0% | 56% | 38% | 4%
src0% | 0% | 88% | 0% | 11%
src/components/home0% | 0% | 78% | 21% | 0%
src/components/photos0% | 0% | 58% | 30% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in src/components/auth/ForgotPasswordVerification.js
67 1 0
function validateForm()
in src/lib/formValidation.js
55 27 2
render()
in src/components/Navbar.js
47 5 0
export default function HomeContent()
in src/components/home/HomeContent.js
41 7 0
function FormErrors()
in src/components/FormErrors.js
35 9 1
function registerValidSW()
in src/serviceWorker.js
33 8 2
function addImagesToList()
in src/components/photos/Photos.js
32 4 1
function checkValidServiceWorker()
in src/serviceWorker.js
23 4 2
export function register()
in src/serviceWorker.js
22 5 1
render()
in src/components/PhotosAdmin.js
20 1 0
async function getPhotoLabels()
in src/components/photos/Photos.js
17 1 1
export default function Welcome()
in src/components/auth/Welcome.js
14 1 0
export default function Home()
in src/components/Home.js
13 1 0
function getImageDetails()
in src/components/PhotosAdmin.js
12 1 1
export default function Hero()
in src/components/home/Hero.js
11 1 0
componentDidMount()
in src/components/ProfileAdmin.js
11 1 0
render()
in src/components/auth/ChangePasswordConfirm.js
10 1 0
export function unregister()
in src/serviceWorker.js
7 2 0
async function getPresignedURLS()
in src/components/photos/Photos.js
6 1 2
function bytesToSize()
in src/components/PhotosAdmin.js
6 2 1