aws-samples / amazon-sagemaker-visual-search
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 24 units with 380 lines of code in units (48.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (91 lines of code)
    • 6 medium size units (172 lines of code)
    • 4 small units (49 lines of code)
    • 13 very small units (68 lines of code)
0% | 23% | 45% | 12% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 32% | 45% | 13% | 9%
py0% | 0% | 44% | 12% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
frontend/src0% | 32% | 45% | 13% | 9%
backend/lambda0% | 0% | 55% | 0% | 44%
src0% | 0% | 0% | 60% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in frontend/src/App.js
91 1 0
def lambda_handler()
in backend/lambda/app.py
43 2 2
function registerValidSW()
in frontend/src/serviceWorker.js
33 8 2
handleURLSubmit()
in frontend/src/App.js
28 3 1
function checkValidServiceWorker()
in frontend/src/serviceWorker.js
25 4 2
export function register()
in frontend/src/serviceWorker.js
22 5 1
getSimilarImages()
in frontend/src/App.js
21 1 1
constructor()
in frontend/src/App.js
14 1 1
def input_handler()
in src/inference.py
12 3 2
onDrop()
in frontend/src/App.js
12 2 2
export function unregister()
in frontend/src/serviceWorker.js
11 2 0
def get_neighbors()
in backend/lambda/app.py
10 2 3
def generate_presigned_urls()
in backend/lambda/app.py
9 2 1
def get_features()
in backend/lambda/app.py
8 1 3
7 1 1
def download_file()
in backend/lambda/app.py
7 2 1
def output_handler()
in src/inference.py
6 2 2
getBase64()
in frontend/src/App.js
4 1 2
backgroundColor: lighten()
in frontend/src/App.js
3 1 2
handleFormChange()
in frontend/src/App.js
3 1 1