aws-samples / cognito-at-edge-federated-ui-sample
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 20 units with 251 lines of code in units (19.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (145 lines of code)
    • 4 small units (55 lines of code)
    • 11 very small units (51 lines of code)
0% | 0% | 57% | 21% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 0% | 56% | 27% | 15%
tsx0% | 0% | 60% | 11% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
web/src/components0% | 0% | 49% | 20% | 30%
web/src/hooks0% | 0% | 66% | 22% | 10%
infrastructure/lib/constructs0% | 0% | 59% | 40% | 0%
infrastructure/lib/helpers0% | 0% | 100% | 0% | 0%
web/src/services0% | 0% | 0% | 0% | 100%
web/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function useAuthenticator()
in web/src/hooks/authenticator.ts
38 8 0
function renderContent()
in web/src/components/pages/sample/sample.tsx
35 1 0
constructor()
in infrastructure/lib/constructs/identity-pool.ts
28 1 3
public static async handleAsync()
in infrastructure/lib/helpers/async-handler.ts
23 2 6
function renderTools()
in web/src/components/pages/sample/sample.tsx
21 1 0
constructor()
in infrastructure/lib/constructs/user-pool-identity-provider-oidc.ts
19 1 3
function getUser()
in web/src/hooks/authenticator.ts
13 1 0
function showErrorNotification()
in web/src/components/layout/notifications/notifications.logic.ts
12 1 2
function getItems()
in web/src/components/pages/sample/sample.tsx
11 1 0
function useNotifications()
in web/src/components/layout/notifications/notifications.logic.ts
8 1 0
function renderAuthPendingNotification()
in web/src/components/pages/home/home.tsx
8 1 0
resourcePath: async()
in web/src/services/API/my-app-api.ts
8 1 0
function getBreadcrumbItems()
in web/src/components/pages/sample/sample.tsx
6 1 0
3 1 0
function handleItemClick()
in web/src/components/layout/page-header/user-selector.tsx
3 1 0
function removeNotification()
in web/src/components/layout/notifications/notifications.logic.ts
3 1 1
function buildItems()
in web/src/components/layout/breadcrumb/breadcrumb.tsx
3 1 0
function renderBreadcrumb()
in web/src/components/pages/sample/sample.tsx
3 1 0
function inititateAuth()
in web/src/hooks/authenticator.ts
3 1 0
function initiateSignOut()
in web/src/hooks/authenticator.ts
3 1 0