aws-samples / deep-learning-web-app
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 39 units with 1,076 lines of code in units (11.0% of code).
    • 1 very long units (429 lines of code)
    • 2 long units (166 lines of code)
    • 9 medium size units (287 lines of code)
    • 4 small units (52 lines of code)
    • 23 very small units (142 lines of code)
39% | 15% | 26% | 4% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js53% | 11% | 22% | 2% | 9%
py0% | 27% | 37% | 10% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
frontend/webapp/src/containers67% | 13% | 11% | 0% | 7%
backend/training-pipeline/functions/api0% | 48% | 28% | 7% | 15%
frontend/webapp/src0% | 0% | 72% | 14% | 12%
backend/training-pipeline/functions/step_functions0% | 0% | 82% | 0% | 17%
machine-learning/container/scripts0% | 0% | 0% | 36% | 63%
frontend/webapp/src/components0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in frontend/webapp/src/containers/TrainModelPage/TrainModelPage.js
429 1 1
render()
in frontend/webapp/src/containers/InferencePage.js
88 4 0
def post()
in backend/training-pipeline/functions/api/start_job.py
78 8 2
def post()
in backend/training-pipeline/functions/api/infer.py
46 5 2
constructor()
in frontend/webapp/src/containers/InferencePage.js
43 3 1
def lambda_handler()
in backend/training-pipeline/functions/step_functions/delete_oldest_endpoint.py
39 2 2
function registerValidSW()
in frontend/webapp/src/serviceWorker.js
33 8 2
render()
in frontend/webapp/src/App.js
31 3 0
render()
in frontend/webapp/src/containers/TrainModelPage/TrainModelPage.js
27 2 0
function checkValidServiceWorker()
in frontend/webapp/src/serviceWorker.js
25 4 2
export function register()
in frontend/webapp/src/serviceWorker.js
22 5 1
def update_endpoint_arn()
in backend/training-pipeline/functions/step_functions/delete_oldest_endpoint.py
21 2 2
def transformation()
in machine-learning/container/scripts/predictor.py
17 2 0
async componentDidMount()
in frontend/webapp/src/App.js
12 4 0
def get()
in backend/training-pipeline/functions/api/model.py
12 1 2
export default function Routes()
in frontend/webapp/src/Routes.js
11 1 1
async confirmNewPassword()
in frontend/webapp/src/containers/Login.js
10 1 2
render()
in frontend/webapp/src/containers/Login.js
10 1 0
def get()
in backend/training-pipeline/functions/api/hpo.py
10 1 2
def lambda_handler()
in backend/training-pipeline/functions/step_functions/check_deployment_status.py
10 1 2