aws-samples / amazon-cognito-example-for-external-idp
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 52 units with 876 lines of code in units (53.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (312 lines of code)
    • 4 simple units (118 lines of code)
    • 46 very simple units (446 lines of code)
0% | 0% | 35% | 13% | 50%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
ts0% | 0% | 41% | 6% | 52%
tsx0% | 0% | 0% | 56% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cdk/src0% | 0% | 65% | 0% | 34%
lambda/api/src0% | 0% | 57% | 0% | 42%
ui-react/src/components0% | 0% | 0% | 56% | 43%
ui-react/src0% | 0% | 0% | 37% | 62%
ui-angular/src/app0% | 0% | 0% | 14% | 85%
ui-react/src/service0% | 0% | 0% | 0% | 100%
ui-react/src/model0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
constructor()
in lambda/api/src/app.ts
104 17 2
constructor()
in cdk/src/cdk.ts
208 12 3
async componentDidMount()
in ui-react/src/components/App.tsx
36 8 0
function registerValidSW()
in ui-react/src/serviceWorker.ts
33 8 2
private async onLoad()
in ui-angular/src/app/app.component.ts
18 6 0
render()
in ui-react/src/components/App.tsx
31 6 0
private subscribeToAuthChanges()
in ui-angular/src/app/app.component.ts
18 5 0
export function register()
in ui-react/src/serviceWorker.ts
25 5 1
public async isForcedSignOut()
in lambda/api/src/services/dynamoDBForcedSignoutHandler.ts
20 5 1
async deletePet()
in ui-angular/src/app/app.component.ts
16 4 0
function checkValidServiceWorker()
in ui-react/src/serviceWorker.ts
23 4 2
public async getPet()
in lambda/api/src/services/dynamoDBStorageService.ts
16 4 1
public async getAllPets()
in lambda/api/src/services/dynamoDBStorageService.ts
18 4 0
async savePet()
in ui-angular/src/app/app.component.ts
13 3 0
async generateConfig()
in cdk/src/generateConfig.ts
34 3 3
static getEnv()
in cdk/src/utils.ts
10 3 2
async componentDidUpdate()
in ui-react/src/components/App.tsx
5 3 2
async savePet()
in ui-react/src/components/App.tsx
15 3 1
async ngOnInit()
in ui-angular/src/app/app.component.ts
9 2 0
async signIn()
in ui-angular/src/app/app.component.ts
3 2 1