aws-amplify / amplify-ui
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 230 units with 3,102 lines of code in units (5.0% of code).
    • 5 very long units (1,007 lines of code)
    • 8 long units (535 lines of code)
    • 13 medium size units (385 lines of code)
    • 26 small units (377 lines of code)
    • 178 very small units (798 lines of code)
32% | 17% | 12% | 12% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts28% | 10% | 12% | 14% | 33%
tsx46% | 37% | 8% | 5% | 2%
js0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/ui42% | 9% | 12% | 19% | 16%
packages/react37% | 41% | 13% | 4% | 3%
packages/vue0% | 0% | 75% | 0% | 24%
packages/angular0% | 0% | 4% | 7% | 87%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function signInActor()
in packages/ui/src/machines/authenticator/actors/signIn.ts
351 2 1
export function FormFields()
in packages/react/src/components/Authenticator/SignUp/FormFields.tsx
192 21 0
export function createSignUpMachine()
in packages/ui/src/machines/authenticator/signUp.ts
172 2 1
export function FormFields()
in packages/react/src/components/Authenticator/ForceNewPassword/FormFields.tsx
153 20 0
export function resetPasswordActor()
in packages/ui/src/machines/authenticator/actors/resetPassword.ts
139 2 1
export function createAuthenticatorMachine()
in packages/ui/src/machines/authenticator/index.ts
91 2 0
export function ConfirmSignUp()
in packages/react/src/components/Authenticator/ConfirmSignUp/ConfirmSignUp.tsx
82 7 0
export function SignIn()
in packages/react/src/components/Authenticator/SignIn/SignIn.tsx
70 5 0
export function SignUp()
in packages/react/src/components/Authenticator/SignUp/SignUp.tsx
65 6 0
export function FederatedSignIn()
in packages/react/src/components/Authenticator/FederatedSignIn/FederatedSignIn.tsx
64 7 0
export function createTheme()
in packages/ui/src/theme/createTheme.ts
58 6 2
rowFromSpanValue: convertGridSpan()
in packages/react/src/primitives/shared/styleUtils.ts
53 11 1
columnFromSpanValue: convertGridSpan()
in packages/react/src/primitives/shared/styleUtils.ts
52 11 1
export function useControllable()
in packages/react/src/hooks/useControllable.ts
45 10 7
export default defineConfig()
in packages/vue/vite.config.ts
43 1 1
config()
in packages/ui/src/machines/authenticator/index.ts
40 2 2
export function UserNameAlias()
in packages/react/src/components/Authenticator/shared/UserNameAlias.tsx
36 2 1
async signUp()
in packages/ui/src/machines/authenticator/signUp.ts
34 18 2
public startMachine()
in packages/angular/projects/ui-angular/src/lib/services/authenticator.service.ts
27 1 6
export function AmplifyProvider()
in packages/react/src/components/AmplifyProvider/index.tsx
25 1 4