aws-samples / amazon-dynamodb-labs
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 18 units with 366 lines of code in units (26.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (66 lines of code)
    • 7 medium size units (204 lines of code)
    • 6 small units (85 lines of code)
    • 4 very small units (11 lines of code)
0% | 18% | 55% | 23% | 3%
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% | 55% | 23% | 3%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
design-patterns0% | 18% | 55% | 23% | 3%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
def import_csv()
in design-patterns/load_employees.py
66 4 2
def import_csv()
in design-patterns/load_invoice.py
44 3 2
def import_csv()
in design-patterns/load_logfile_parallel.py
38 5 3
def parallel_scan()
in design-patterns/scan_logfile_parallel.py
29 4 3
def scan_table()
in design-patterns/scan_for_managers.py
25 2 2
def scan_table()
in design-patterns/scan_logfile_simple.py
24 4 1
def import_csv()
in design-patterns/load_logfile.py
23 5 4
def scan_table()
in design-patterns/scan_for_managers_gsi.py
21 2 2
def query_gsi()
in design-patterns/query_city_dept.py
16 3 3
def query_InvoiceandBilling()
in design-patterns/query_index_invoiceandbilling.py
15 4 2
def query_gsi()
in design-patterns/query_employees.py
15 3 3
def _lambda_handler()
in design-patterns/ddbreplica_lambda.py
14 5 2
def query_responsecode_shard()
in design-patterns/query_responsecode.py
13 2 4
def query_InvoiceandBilling()
in design-patterns/query_invoiceandbilling.py
12 4 2
def lambda_handler()
in design-patterns/ddbreplica_lambda.py
5 2 2
def _deserialize_n()
in design-patterns/ddbreplica_lambda.py
2 1 2
def _deserialize_b()
in design-patterns/ddbreplica_lambda.py
2 1 2
def get_table_name_from_arn()
in design-patterns/ddbreplica_lambda.py
2 1 1