aws-samples / aws-iot-greengrass-v2-using-aws-cdk
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 76 units with 1,197 lines of code in units (81.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (33 lines of code)
    • 1 simple units (24 lines of code)
    • 74 very simple units (1,140 lines of code)
0% | 0% | 2% | 2% | 95%
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% | 3% | 2% | 94%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/template/pattern0% | 0% | 50% | 0% | 49%
lib/template0% | 0% | 0% | 29% | 70%
infra/stack/iot0% | 0% | 0% | 0% | 100%
infra/stack/data0% | 0% | 0% | 0% | 100%
infra/stack/greengrass0% | 0% | 0% | 0% | 100%
infra/stack/ops0% | 0% | 0% | 0% | 100%
codes/component/logger_sample0% | 0% | 0% | 0% | 100%
codes/lambda/custom_iot_event_msg0% | 0% | 0% | 0% | 100%
codes/lambda/custom_gg_comp_deploy0% | 0% | 0% | 0% | 100%
codes/lambda/custom_iot_role_alias0% | 0% | 0% | 0% | 100%
codes/lambda/custom_iot_thing_group0% | 0% | 0% | 0% | 100%
lib/template/construct0% | 0% | 0% | 0% | 100%
lib/template/stack0% | 0% | 0% | 0% | 100%
script/thing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private createLambda()
in lib/template/pattern/lambda-construct.ts
33 11 4
private updateContextArgs()
in lib/template/app-context.ts
24 7 3
def handle()
in codes/lambda/custom_iot_thing_group/src/handler.py
15 5 2
def handle()
in codes/lambda/custom_gg_comp_deploy/src/handler.py
14 5 2
def handle()
in codes/lambda/custom_iot_role_alias/src/handler.py
15 5 2
def handle()
in codes/lambda/custom_iot_event_msg/src/handler.py
14 5 2
private loadConfig()
in lib/template/app-context.ts
20 5 3
private loadLayers()
in lib/template/pattern/lambda-construct.ts
10 4 2
constructor()
in infra/stack/ops/cicd-pipeline-stack.ts
29 4 2
private createElasticsearch()
in infra/stack/data/data-pipeline-stack.ts
92 4 0
def delete_iot_thing_group()
in codes/lambda/custom_iot_thing_group/src/handler.py
12 3 1
def cancel_components()
in codes/lambda/custom_gg_comp_deploy/src/handler.py
12 3 1
def update_thing_event()
in codes/lambda/custom_iot_event_msg/src/handler.py
18 3 1
private createRole()
in lib/template/pattern/lambda-construct.ts
15 3 2
private addPrefixIntoStackName()
in lib/template/app-context.ts
7 3 1
def run()
in codes/component/logger_sample/src/handler.py
13 2 0
def create_iot_thing_group()
in codes/lambda/custom_iot_thing_group/src/handler.py
12 2 1
def deploy_components()
in codes/lambda/custom_gg_comp_deploy/src/handler.py
17 2 1
def createRoleAlias()
in codes/lambda/custom_iot_role_alias/src/handler.py
16 2 1
def deleteRoleAlias()
in codes/lambda/custom_iot_role_alias/src/handler.py
12 2 1