aws-solutions / machine-downtime-monitor-on-aws
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 144 units with 3,372 lines of code in units (63.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (442 lines of code)
    • 18 simple units (722 lines of code)
    • 121 very simple units (2,208 lines of code)
0% | 0% | 13% | 21% | 65%
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% | 19% | 16% | 63%
tsx0% | 0% | 2% | 31% | 66%
py0% | 0% | 0% | 21% | 78%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cdk-infrastructure/lib0% | 0% | 32% | 0% | 67%
lambda/filter-kinesis-stream0% | 0% | 15% | 36% | 48%
web-ui/src0% | 0% | 2% | 31% | 66%
lambda/util0% | 0% | 13% | 49% | 37%
lambda/solution-helper0% | 0% | 0% | 31% | 68%
glue-job-scripts0% | 0% | 0% | 21% | 78%
lambda/data-sources0% | 0% | 0% | 38% | 61%
lambda/update-filter-function0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async componentDidMount()
in source/web-ui/src/App.tsx
24 12 0
export function validatePayload()
in source/lambda/util/metrics.ts
9 12 1
private getMatchingMessageFormatConfigItem()
in source/lambda/filter-kinesis-stream/machine-data-parser.ts
33 12 1
async function checkInitialization()
in source/lambda/filter-kinesis-stream/index.ts
27 11 0
constructor()
in source/cdk-infrastructure/lib/bi-reporting/etl/etl-construct.ts
349 11 3
async onClickConfigModalSaveBtn()
in source/web-ui/src/views/machines/MachineStatusCard.tsx
45 10 1
function validateRequest()
in source/lambda/data-sources/machine-detail.ts
20 10 1
private validateConfigItem()
in source/lambda/filter-kinesis-stream/machine-data-parser.ts
42 10 1
handleChange()
in source/web-ui/src/views/machines/MachineStatusCard.tsx
26 9 1
handleUpdatedReferenceData()
in source/web-ui/src/views/overview/Overview.tsx
30 9 1
showMachines()
in source/web-ui/src/views/overview/Overview.tsx
37 9 0
async loadUIReferenceData()
in source/web-ui/src/views/machines/MachineStatusCard.tsx
24 8 0
onChangeUIReferenceMapping()
in source/web-ui/src/views/overview/Overview.tsx
36 8 1
export function objectHasRequiredProperties()
in source/lambda/util/utility-functions.ts
17 8 3
async function updateReferenceData()
in source/lambda/filter-kinesis-stream/index.ts
35 8 1
export function mapUIReferenceDataItemToUpdateMutationInput()
in source/lambda/filter-kinesis-stream/index.ts
27 8 1
async loadMachineConfig()
in source/web-ui/src/views/machines/MachineStatusCard.tsx
32 7 0
async loadMachineData()
in source/web-ui/src/views/machines/MachineDetail.tsx
49 7 2
export function stringToInt()
in source/lambda/util/utility-functions.ts
16 7 2
public parseData()
in source/lambda/filter-kinesis-stream/machine-data-parser.ts
36 7 1