awslabs / amazon-documentdb-tools
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 175 units with 2,649 lines of code in units (68.7% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (499 lines of code)
    • 28 medium size units (821 lines of code)
    • 54 small units (824 lines of code)
    • 86 very small units (505 lines of code)
0% | 18% | 30% | 31% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 18% | 30% | 31% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
index-tool/migrationtools0% | 64% | 14% | 15% | 5%
global-clusters-automation0% | 15% | 42% | 38% | 3%
compat-tool/compat0% | 35% | 0% | 52% | 11%
cosmos-db-migration-utility/src/lambda/batch-request-reader0% | 0% | 63% | 17% | 19%
cosmos-db-migration-utility/src/migrator-app/migrators0% | 0% | 45% | 29% | 24%
cosmos-db-migration-utility/src/lambda/gap-watch-request-reader0% | 0% | 55% | 15% | 29%
cosmos-db-migration-utility/src/lambda/app-request-reader0% | 0% | 55% | 16% | 27%
cosmos-db-migration-utility/src/configure0% | 0% | 24% | 15% | 59%
cosmos-db-migration-utility/src/migrator-app/helpers0% | 0% | 0% | 61% | 38%
cosmos-db-migration-utility/src/migrator-app/common0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/migrator-app0% | 0% | 0% | 0% | 100%
cosmos-db-migration-utility/src/configure/common0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in index-tool/migrationtools/documentdb_index_tool.py
95 15 0
def find_compatibility_issues()
in index-tool/migrationtools/documentdb_index_tool.py
94 26 2
def process_log_file()
in compat-tool/compat/compat.py
74 19 5
def lambda_handler()
in global-clusters-automation/failover_and_convert_lambda_function.py
68 11 2
def run()
in index-tool/migrationtools/documentdb_index_tool.py
60 17 1
def failover()
in global-clusters-automation/failover_and_delete_global_cluster.py
57 10 5
def _dump_indexes_from_server()
in index-tool/migrationtools/documentdb_index_tool.py
51 5 4
def lambda_handler()
in global-clusters-automation/failover_and_delete_lambda_function.py
48 3 2
def lambda_handler()
in global-clusters-automation/convert_to_global_lambda_function.py
48 4 2
def convert_regional_to_global()
in global-clusters-automation/add_secondarycluster.py
40 9 3
def lambda_handler()
in cosmos-db-migration-utility/src/lambda/app-request-reader/lambda_function.py
39 4 2
def _restore_indexes()
in index-tool/migrationtools/documentdb_index_tool.py
39 14 3
def process_request()
in cosmos-db-migration-utility/src/lambda/batch-request-reader/lambda_function.py
37 5 1
def lambda_handler()
in cosmos-db-migration-utility/src/lambda/batch-request-reader/lambda_function.py
33 5 2
def watch()
in cosmos-db-migration-utility/src/migrator-app/migrators/CollectionMigrator.py
33 14 3
def get_timestamp_gap_data()
in cosmos-db-migration-utility/src/lambda/gap-watch-request-reader/lambda_function.py
32 3 1
def lambda_handler()
in cosmos-db-migration-utility/src/lambda/gap-watch-request-reader/lambda_function.py
31 4 2
def _get_metadata_from_file()
in index-tool/migrationtools/documentdb_index_tool.py
31 8 2
def get_cluster_details()
in global-clusters-automation/failover_and_convert_to_global.py
29 5 1
def delete_cluster()
in global-clusters-automation/failover_and_delete_global_cluster.py
28 3 1