aws-samples / amazon-qldb-streaming-amazon-opensearch-service-sample-python
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 26 units with 192 lines of code in units (23.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (28 lines of code)
    • 1 simple units (12 lines of code)
    • 24 very simple units (152 lines of code)
0% | 0% | 14% | 6% | 79%
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% | 14% | 6% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/qldb_streaming_to_es_sample0% | 0% | 73% | 0% | 26%
src/qldb_streaming_to_es_sample/helpers0% | 0% | 0% | 46% | 53%
sample_scenarios0% | 0% | 0% | 0% | 100%
src/qldb_streaming_to_es_sample/clients0% | 0% | 0% | 0% | 100%
setup0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in src/qldb_streaming_to_es_sample/app.py
28 16 2
def filtered_records_generator()
in src/qldb_streaming_to_es_sample/helpers/filtered_records_generator.py
12 7 2
def get_data_metdata_from_revision_record()
in src/qldb_streaming_to_es_sample/helpers/filtered_records_generator.py
11 5 1
def create()
in setup/provisioning_lambda.py
11 4 2
def get_table_info_from_revision_record()
in src/qldb_streaming_to_es_sample/helpers/filtered_records_generator.py
3 3 1
def __fields_are_present()
in src/qldb_streaming_to_es_sample/app.py
5 3 2
def update_documents()
in sample_scenarios/multiple_updates_to_a_document.py
10 3 1
def __create_document()
in src/qldb_streaming_to_es_sample/app.py
5 2 2
def index()
in src/qldb_streaming_to_es_sample/clients/elasticsearch.py
14 2 5
def delete()
in src/qldb_streaming_to_es_sample/clients/elasticsearch.py
10 2 4
def print_result()
in sample_scenarios/sample_data.py
6 2 1
def update_person_id()
in sample_scenarios/insert_documents.py
9 2 1
def delete_documents()
in sample_scenarios/delete_document.py
9 2 1
def update_documents()
in sample_scenarios/single_update_to_document.py
7 2 1
def __init__()
in src/qldb_streaming_to_es_sample/clients/elasticsearch.py
10 1 3
def create_qldb_session()
in sample_scenarios/helpers.py
4 1 0
def create_qldb_driver()
in sample_scenarios/helpers.py
4 1 4
def convert_object_to_ion()
in sample_scenarios/sample_data.py
3 1 1
def to_ion_struct()
in sample_scenarios/sample_data.py
4 1 2
def get_document_ids()
in sample_scenarios/sample_data.py
5 1 4