aws-samples / amazon-comprehend-s3-object-lambda-functions
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 61 units with 687 lines of code in units (51.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (27 lines of code)
    • 7 simple units (172 lines of code)
    • 53 very simple units (488 lines of code)
0% | 0% | 3% | 25% | 71%
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% | 3% | 25% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 5% | 28% | 65%
src/clients0% | 0% | 0% | 18% | 81%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _trim_to_max_bytes()
in src/processors.py
27 12 3
def handle_exception()
in src/exception_handlers.py
44 9 4
def _contains_error()
in src/clients/s3_client.py
17 9 2
def download_file_from_presigned_url()
in src/clients/s3_client.py
26 9 3
13 8 2
def redact()
in src/processors.py
27 8 3
23 7 3
def redact()
in src/handler.py
22 6 7
def get_interested_pii()
in src/handler.py
7 5 2
51 5 2
def validate()
in src/validators.py
7 5 1
6 5 3
def _filter_request_headers()
in src/clients/s3_client.py
12 5 3
def publish_metrics()
in src/handler.py
12 4 8
48 4 2
def contains_pii_entities()
in src/clients/comprehend_client.py
15 4 3
def detect_pii_documents()
in src/clients/comprehend_client.py
15 4 3
def _update_doc_with_pii_entities()
in src/clients/comprehend_client.py
14 4 3
def _handle_unsupported_file_exception()
in src/exception_handlers.py
14 3 4
def __init__()
in src/data_object.py
9 3 4