aws-samples / amazon-cognito-example-for-external-idp
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 52 units with 876 lines of code in units (53.3% of code).
    • 2 very long units (312 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (215 lines of code)
    • 11 small units (178 lines of code)
    • 32 very small units (171 lines of code)
35% | 0% | 24% | 20% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts41% | 0% | 19% | 21% | 17%
tsx0% | 0% | 56% | 12% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/src65% | 0% | 21% | 5% | 7%
lambda/api/src57% | 0% | 0% | 36% | 6%
ui-react/src0% | 0% | 92% | 0% | 7%
ui-react/src/components0% | 0% | 56% | 12% | 31%
ui-angular/src/app0% | 0% | 0% | 64% | 35%
ui-react/src/service0% | 0% | 0% | 0% | 100%
ui-react/src/model0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdk/src/cdk.ts
208 12 3
constructor()
in lambda/api/src/app.ts
104 17 2
async componentDidMount()
in ui-react/src/components/App.tsx
36 8 0
async generateConfig()
in cdk/src/generateConfig.ts
34 3 3
static addCorsOptions()
in cdk/src/utils.ts
33 1 4
function registerValidSW()
in ui-react/src/serviceWorker.ts
33 8 2
render()
in ui-react/src/components/App.tsx
31 6 0
export function register()
in ui-react/src/serviceWorker.ts
25 5 1
function checkValidServiceWorker()
in ui-react/src/serviceWorker.ts
23 4 2
public async isForcedSignOut()
in lambda/api/src/services/dynamoDBForcedSignoutHandler.ts
20 5 1
private async onLoad()
in ui-angular/src/app/app.component.ts
18 6 0
private subscribeToAuthChanges()
in ui-angular/src/app/app.component.ts
18 5 0
public async getAllPets()
in lambda/api/src/services/dynamoDBStorageService.ts
18 4 0
17 2 1
async deletePet()
in ui-angular/src/app/app.component.ts
16 4 0
private registerLoadingIndicator()
in ui-angular/src/app/app.component.ts
16 1 0
public async getPet()
in lambda/api/src/services/dynamoDBStorageService.ts
16 4 1
async savePet()
in ui-react/src/components/App.tsx
15 3 1
async savePet()
in ui-angular/src/app/app.component.ts
13 3 0
public async savePet()
in lambda/api/src/services/dynamoDBStorageService.ts
11 2 1