aws-samples / amazon-rekognition-id-verification-sample-with-amplify
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 120 units with 1,901 lines of code in units (36.1% of code).
    • 1 very long units (125 lines of code)
    • 6 long units (411 lines of code)
    • 24 medium size units (745 lines of code)
    • 21 small units (305 lines of code)
    • 68 very small units (315 lines of code)
6% | 21% | 39% | 16% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js13% | 21% | 41% | 15% | 8%
tsx0% | 48% | 31% | 9% | 10%
ts0% | 0% | 41% | 23% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amplify/backend13% | 21% | 41% | 15% | 8%
components0% | 49% | 31% | 9% | 9%
src/graphql0% | 0% | 35% | 26% | 38%
common0% | 0% | 71% | 13% | 14%
pages/api0% | 0% | 0% | 0% | 100%
infra/lib0% | 0% | 0% | 0% | 100%
pages0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
registerNewUserWithIdCard: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
125 16 3
registerNewUser: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
88 11 1
function reducer()
in components/register-new-user-with-idcard.tsx
74 15 2
async function submitUser()
in components/register-new-user.tsx
66 6 2
async function submitUser()
in components/register-new-user-with-idcard.tsx
63 6 2
deleteUser: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
61 10 1
updateExistingUserPhoto: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
59 10 2
49 8 2
function reducer()
in components/register-new-user.tsx
48 10 2
loginUser: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
46 8 1
async function insertImageWithSigning()
in amplify/backend/function/S3Triggerb6cacc90/src/index.js
44 1 1
query UserInfoByFaceId()
in amplify/backend/function/idvworkflowfn/src/graphqlhelpers.js
32 1 1
query ListUserInfos()
in src/graphql/queries.ts
32 1 1
query UserInfoByFaceId()
in src/graphql/queries.ts
32 1 1
query UserInfoByRegStatus()
in src/graphql/queries.ts
32 1 1
async function updateUserInfo()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
31 5 4
deleteCollection: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
31 6 1
createCollection: async function()
in amplify/backend/function/idvworkflowfn/src/idvfunctions.js
29 3 1
query ListCachedCollectionLists()
in amplify/backend/function/idvworkflowfn/src/graphqlhelpers.js
28 1 1
query ListCachedCollectionLists()
in src/graphql/queries.ts
28 1 1