aws-samples / amazon-qldb-streaming-amazon-opensearch-service-sample-python
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 26 units with 192 lines of code in units (23.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (28 lines of code)
    • 4 small units (48 lines of code)
    • 21 very small units (116 lines of code)
0% | 0% | 14% | 25% | 60%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 14% | 25% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/qldb_streaming_to_es_sample0% | 0% | 73% | 0% | 26%
src/qldb_streaming_to_es_sample/helpers0% | 0% | 0% | 88% | 11%
src/qldb_streaming_to_es_sample/clients0% | 0% | 0% | 41% | 58%
setup0% | 0% | 0% | 64% | 35%
sample_scenarios0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in src/qldb_streaming_to_es_sample/app.py
28 16 2
def index()
in src/qldb_streaming_to_es_sample/clients/elasticsearch.py
14 2 5
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 __init__()
in src/qldb_streaming_to_es_sample/clients/elasticsearch.py
10 1 3
def delete()
in src/qldb_streaming_to_es_sample/clients/elasticsearch.py
10 2 4
def update_documents()
in sample_scenarios/multiple_updates_to_a_document.py
10 3 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_and_insert_documents()
in sample_scenarios/insert_documents.py
7 1 1
def update_documents()
in sample_scenarios/single_update_to_document.py
7 2 1
def print_result()
in sample_scenarios/sample_data.py
6 2 1
def insert_documents()
in sample_scenarios/insert_documents.py
6 1 3
def __create_document()
in src/qldb_streaming_to_es_sample/app.py
5 2 2
def __fields_are_present()
in src/qldb_streaming_to_es_sample/app.py
5 3 2
def get_document_ids()
in sample_scenarios/sample_data.py
5 1 4
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 to_ion_struct()
in sample_scenarios/sample_data.py
4 1 2