aws-samples / aws-dog-no-dog
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 13 units with 144 lines of code in units (19.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (24 lines of code)
    • 6 small units (81 lines of code)
    • 6 very small units (39 lines of code)
0% | 0% | 16% | 56% | 27%
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% | 21% | 50% | 28%
js0% | 0% | 0% | 77% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend_complete/src0% | 0% | 28% | 48% | 23%
src/backend0% | 0% | 0% | 77% | 22%
backend/src0% | 0% | 0% | 57% | 42%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
def feedback_handler()
in backend_complete/src/main.py
24 12 2
def metric()
in backend_complete/src/helpers.py
16 2 5
def metric()
in backend/src/helpers.py
16 2 5
def has_dog_handler()
in backend_complete/src/main.py
14 7 2
export function sendPhoto()
in src/backend/api.js
13 1 1
export function feedbackPhoto()
in src/backend/api.js
11 1 2
def has_dog()
in backend_complete/src/main.py
11 3 1
def response()
in backend_complete/src/helpers.py
10 1 2
def save_feedback()
in backend_complete/src/main.py
10 1 3
def response()
in backend/src/helpers.py
10 1 2
photo: btoa()
in src/backend/api.js
4 1 1
photo: btoa()
in src/backend/api.js
3 1 1
def has_dog_handler()
in backend/src/main.py
2 1 2