aws-samples / aws-serverless-app-with-aurora-and-python-sql-alchemy-example
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 16 units with 119 lines of code in units (24.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (44 lines of code)
    • 1 small units (11 lines of code)
    • 13 very small units (64 lines of code)
0% | 0% | 36% | 9% | 53%
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% | 36% | 9% | 53%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
bookstore/books0% | 0% | 65% | 0% | 34%
db_schema/db_schema_lambda0% | 0% | 0% | 57% | 42%
db_schema/db_schema_lambda_layer/python0% | 0% | 0% | 0% | 100%
bookstore/reviews0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
def get_books()
in bookstore/books/main.py
23 3 0
def put_book()
in bookstore/books/main.py
21 2 1
def create()
in db_schema/db_schema_lambda/main.py
11 4 2
def lambda_handler()
in bookstore/books/main.py
10 3 2
def get_db_session()
in bookstore/books/db_connection.py
9 2 0
def create_db_engine()
in db_schema/db_schema_lambda_layer/python/bookstore_utils.py
8 1 2
def lambda_handler()
in bookstore/reviews/main.py
7 2 2
def create_db_session()
in db_schema/db_schema_lambda_layer/python/bookstore_utils.py
5 2 1
def __init__()
in db_schema/db_schema_lambda_layer/python/bookstore_orm_objects.py
5 1 5
def get_db_secrets()
in db_schema/db_schema_lambda/main.py
4 1 0
def get_db_secrets()
in bookstore/books/db_connection.py
4 1 0
def __repr__()
in db_schema/db_schema_lambda_layer/python/bookstore_orm_objects.py
3 1 1
def __repr__()
in db_schema/db_schema_lambda_layer/python/bookstore_orm_objects.py
3 1 1
def create_db_schema()
in db_schema/db_schema_lambda_layer/python/bookstore_orm_objects.py
2 1 1
def no_op()
in db_schema/db_schema_lambda/main.py
2 1 2
def lambda_handler()
in db_schema/db_schema_lambda/main.py
2 1 2