aws-samples / amazon-elasticache-samples
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 189 lines of code in units (46.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (31 lines of code)
    • 2 small units (31 lines of code)
    • 23 very small units (127 lines of code)
0% | 0% | 16% | 16% | 67%
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% | 16% | 16% | 67%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda-feature-store/movie_recommendations0% | 0% | 52% | 33% | 13%
database-caching0% | 0% | 0% | 36% | 63%
session-store0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def handler()
in lambda-feature-store/movie_recommendations/get_movie_recommendations.py
31 6 2
def handler()
in lambda-feature-store/movie_recommendations/put_movie_recommendations.py
20 4 2
def planet()
in database-caching/example.py
11 3 1
def index()
in session-store/example-3.py
10 2 0
def login()
in session-store/example-3.py
10 2 0
def index()
in session-store/example-4.py
10 2 0
def login()
in session-store/example-4.py
10 2 0
def login()
in session-store/example-1.py
10 2 0
def login()
in session-store/example-2.py
10 2 0
def index()
in session-store/example-2.py
9 2 0
def fetch()
in database-caching/example.py
7 2 1
def __init__()
in session-store/example-4.py
4 1 4
def index()
in session-store/example-1.py
4 2 0
def __init__()
in database-caching/example.py
4 1 2
def query()
in database-caching/example.py
4 1 2
def record()
in database-caching/example.py
4 1 3
def connect()
in lambda-feature-store/movie_recommendations/get_movie_recommendations.py
4 1 1
def connect()
in lambda-feature-store/movie_recommendations/put_movie_recommendations.py
4 1 1
def logout()
in session-store/example-3.py
3 1 0
def set()
in session-store/example-4.py
3 1 3