aws-samples / lambda-refarch-webapp
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 422 lines of code in units (37.0% of code).
    • 1 very long units (139 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (99 lines of code)
    • 5 small units (74 lines of code)
    • 16 very small units (110 lines of code)
32% | 0% | 23% | 17% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js32% | 0% | 23% | 17% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
www/src54% | 0% | 30% | 7% | 6%
todo-src/updateTodo0% | 0% | 53% | 28% | 17%
todo-src/addTodo0% | 0% | 0% | 53% | 46%
todo-src/completeTodo0% | 0% | 0% | 46% | 53%
todo-src/getAllTodo0% | 0% | 0% | 65% | 35%
todo-src/getTodo0% | 0% | 0% | 0% | 100%
todo-src/deleteTodo0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function App()
in www/src/App.js
139 25 0
function registerValidSW()
in www/src/serviceWorker.js
33 8 2
function checkValidServiceWorker()
in www/src/serviceWorker.js
23 4 2
export function register()
in www/src/serviceWorker.js
22 5 1
function updateRecord()
in todo-src/updateTodo/app.js
21 1 3
function ToDo()
in www/src/ToDo.js
20 2 4
function addRecord()
in todo-src/addTodo/app.js
17 1 1
function getRecords()
in todo-src/getAllTodo/app.js
13 1 1
function updateRecord()
in todo-src/completeTodo/app.js
13 1 2
function isValidRequest()
in todo-src/updateTodo/app.js
11 7 1
function getRecordById()
in todo-src/getTodo/app.js
10 1 2
function deleteRecordById()
in todo-src/deleteTodo/app.js
10 1 2
function isValidRequest()
in todo-src/completeTodo/app.js
8 4 1
function isValidRequest()
in todo-src/getTodo/app.js
8 4 1
function isValidRequest()
in todo-src/deleteTodo/app.js
8 4 1
function getCognitoUsername()
in todo-src/getAllTodo/app.js
7 2 1
function getCognitoUsername()
in todo-src/completeTodo/app.js
7 2 1
function getCognitoUsername()
in todo-src/getTodo/app.js
7 2 1
function getCognitoUsername()
in todo-src/updateTodo/app.js
7 2 1
function getCognitoUsername()
in todo-src/deleteTodo/app.js
7 2 1