aws-samples / aws-deeplens-recipes
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 57 units with 853 lines of code in units (10.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (116 lines of code)
    • 6 simple units (273 lines of code)
    • 48 very simple units (464 lines of code)
0% | 0% | 13% | 32% | 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% | 0% | 13% | 32% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
static/code/worker-safety0% | 0% | 22% | 10% | 67%
static/code/trash-sorter0% | 0% | 13% | 14% | 71%
static/code/coffee-counter0% | 0% | 0% | 80% | 19%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def greengrass_infinite_infer_run()
in static/code/worker-safety/deeplens-lambda/lambda_function.py
58 24 0
def invoke()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/Lambda.py
29 13 2
def invoke()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/Lambda.py
29 13 2
def infinite_infer_run()
in static/code/trash-sorter/deeplens-trash-lambda/lambda_function.py
31 10 0
def matchPersonsAndHats()
in static/code/worker-safety/cloud-lambda.py
30 9 2
def getPersonsAndHardhats()
in static/code/worker-safety/cloud-lambda.py
11 9 3
def detect_faces()
in static/code/coffee-counter/face_function.py
75 9 3
def greengrass_infinite_infer_run()
in static/code/coffee-counter/deeplens_inference_function.py
82 9 0
def main()
in static/code/coffee-counter/app/application.py
44 7 0
def lambda_handler()
in static/code/coffee-counter/face_function.py
33 5 2
def _shadow_op()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/IoTDataPlane.py
22 4 4
def _invoke_internal()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/Lambda.py
19 4 5
def mock()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/utils/testing.py
21 4 1
def run()
in static/code/worker-safety/deeplens-lambda/lambda_function.py
10 4 1
def _shadow_op()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/IoTDataPlane.py
22 4 4
def _invoke_internal()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/Lambda.py
19 4 5
def mock()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/utils/testing.py
21 4 1
def run()
in static/code/trash-sorter/deeplens-trash-lambda/utils.py
10 4 1
def client()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/client.py
8 3 2
def client()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/client.py
8 3 2