aws-samples / aws-serverless-workshop-greater-china-region
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 884 units with 10,393 lines of code in units (81.6% of code).
    • 0 very complex units (0 lines of code)
    • 7 complex units (601 lines of code)
    • 56 medium complex units (1,983 lines of code)
    • 109 simple units (2,176 lines of code)
    • 712 very simple units (5,633 lines of code)
0% | 5% | 19% | 20% | 54%
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
py0% | 6% | 20% | 21% | 52%
js0% | 0% | 0% | 18% | 81%
ts0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Others_Labs0% | 5% | 19% | 22% | 52%
Unclassified0% | 21% | 33% | 0% | 44%
Lab6-StepFunction0% | 0% | 13% | 13% | 73%
Others_Tools0% | 0% | 57% | 0% | 42%
Lab10-DynamoDB-Stream-EventBridge0% | 0% | 0% | 58% | 41%
Lab13-Dump-DynamoDB-into-CSV-Stored-in-S30% | 0% | 0% | 17% | 82%
Lab12-Lambda_EFS_Inference0% | 0% | 0% | 0% | 100%
Lab4-WildRyde-WebApplication0% | 0% | 0% | 0% | 100%
Lab8A-CICD-CodePipeline0% | 0% | 0% | 0% | 100%
Lab11-Provision-Concurrency0% | 0% | 0% | 0% | 100%
Lab8B-CICD-Jenkins0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def fetch_more_tokens()
in Others_Labs/code/Survey-Survey/yaml/scanner.py
48 32 1
def fetch_more_tokens()
in Others_Labs/code/SurveySubmit/yaml/scanner.py
48 32 1
def analyze_scalar()
in Others_Labs/code/Survey-Survey/yaml/emitter.py
111 30 2
def analyze_scalar()
in Others_Labs/code/SurveySubmit/yaml/emitter.py
111 30 2
def parse_node()
in Others_Labs/code/Survey-Survey/yaml/parser.py
94 29 3
def parse_node()
in Others_Labs/code/SurveySubmit/yaml/parser.py
94 29 3
def lambda_handler()
in Lab2-EC2AutoSnapshot_CloudWatchEvent+Lambda/auto_snapshot_lambda.py
95 28 2
def write_folded()
in Others_Labs/code/Survey-Survey/yaml/emitter.py
53 24 2
def write_folded()
in Others_Labs/code/SurveySubmit/yaml/emitter.py
53 24 2
def add_path_resolver()
in Others_Labs/code/Survey-Survey/yaml/resolver.py
40 23 4
def add_path_resolver()
in Others_Labs/code/SurveySubmit/yaml/resolver.py
40 23 4
def write_plain()
in Others_Labs/code/Survey-Survey/yaml/emitter.py
58 22 3
def write_plain()
in Others_Labs/code/SurveySubmit/yaml/emitter.py
58 22 3
def write_double_quoted()
in Others_Labs/code/Survey-Survey/yaml/emitter.py
53 21 3
def write_double_quoted()
in Others_Labs/code/SurveySubmit/yaml/emitter.py
53 21 3
def indent()
in Others_Labs/code/Survey-Survey/yattag/indentation.py
75 19 5
def choose_scalar_style()
in Others_Labs/code/Survey-Survey/yaml/emitter.py
20 19 1
def indent()
in Others_Labs/code/SurveySubmit/yattag/indentation.py
75 19 5
def choose_scalar_style()
in Others_Labs/code/SurveySubmit/yaml/emitter.py
20 19 1
def construct_object()
in Others_Labs/code/Survey-Survey/yaml/constructor.py
49 17 3