aws-samples / aws-serverless-for-machine-learning-inference
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 15 units with 565 lines of code in units (83.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 1 simple units (14 lines of code)
    • 14 very simple units (551 lines of code)
0% | 0% | 0% | 2% | 97%
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% | 0% | 0% | 8% | 91%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
container_images/batch_image0% | 0% | 0% | 19% | 80%
lib0% | 0% | 0% | 0% | 100%
lambda_fn/ecr_cleanup0% | 0% | 0% | 0% | 100%
lambda_fn/batch_jobs_submitter0% | 0% | 0% | 0% | 100%
lambda_fn/realtime_inf/realtime_fn0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 15 most complex units
Unit# linesMcCabe index# params
def logMessage()
in container_images/batch_image/inference.py
14 7 3
def resnet_pipeline()
in container_images/batch_image/inference.py
22 5 2
def get_inference()
in container_images/batch_image/inference.py
26 4 3
def handler()
in lambda_fn/batch_jobs_submitter/index.py
30 4 2
def on_event()
in lambda_fn/ecr_cleanup/index.py
10 4 2
def on_delete()
in lambda_fn/ecr_cleanup/index.py
17 4 1
def lambda_handler()
in lambda_fn/realtime_inf/realtime_fn/index.py
25 4 2
def constructMessageFormat()
in container_images/batch_image/inference.py
5 2 4
def main()
in container_images/batch_image/inference.py
6 1 0
constructor()
in lib/ml_serverless-stack.ts
90 1 3
constructor()
in lib/base-resources.ts
16 1 3
constructor()
in lib/lambda-resources.ts
116 1 3
constructor()
in lib/batch-resources.ts
181 1 3
def on_create()
in lambda_fn/ecr_cleanup/index.py
3 1 1
def on_update()
in lambda_fn/ecr_cleanup/index.py
4 1 1