aws-samples / amplify-video-community
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 188 units with 2,067 lines of code in units (18.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (57 lines of code)
    • 35 medium size units (1,019 lines of code)
    • 22 small units (309 lines of code)
    • 130 very small units (682 lines of code)
0% | 2% | 49% | 14% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 11% | 65% | 9% | 13%
ts0% | 0% | 47% | 16% | 36%
tsx0% | 0% | 0% | 24% | 75%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
apps/community-website/amplify/backend/function0% | 11% | 65% | 9% | 13%
apps/community-website/src/graphql0% | 0% | 63% | 15% | 21%
apps/community-website/src/shared/api0% | 0% | 22% | 16% | 61%
apps/community-website/src/shared/components0% | 0% | 0% | 35% | 64%
apps/community-website/src/shared/hooks0% | 0% | 0% | 48% | 52%
apps/community-website/src/shared/admin0% | 0% | 0% | 0% | 100%
apps/community-website/src/shared/home0% | 0% | 0% | 0% | 100%
apps/community-website/src/pages0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
listSectionsAndMedias: async()
in apps/community-website/amplify/backend/function/resourcesManager/src/SectionManager.js
57 13 0
query ListVideoOnDemands()
in apps/community-website/src/shared/api/vod-fetch.ts
43 1 1
query ListMediasSections()
in apps/community-website/amplify/backend/function/resourcesManager/src/gql.js
38 1 1
deleteMediasSections()
in apps/community-website/amplify/backend/function/resourcesManager/src/gql.js
38 1 2
getMediasSections()
in apps/community-website/src/graphql/queries.ts
38 1 1
createMediasSections()
in apps/community-website/src/graphql/mutations.ts
38 1 2
updateMediasSections()
in apps/community-website/src/graphql/mutations.ts
38 1 2
deleteMediasSections()
in apps/community-website/src/graphql/mutations.ts
38 1 2
getVideoOnDemand()
in apps/community-website/src/shared/api/vod-fetch.ts
35 1 1
updateMedia: async()
in apps/community-website/amplify/backend/function/resourcesManager/src/MediaManager.js
30 9 1
getMedia: async()
in apps/community-website/amplify/backend/function/resourcesManager/src/MediaManager.js
28 8 1
createMedia()
in apps/community-website/amplify/backend/function/resourcesManager/src/gql.js
28 1 2
getMedia()
in apps/community-website/amplify/backend/function/resourcesManager/src/gql.js
28 1 1
deleteMedia()
in apps/community-website/amplify/backend/function/resourcesManager/src/gql.js
28 1 2
updateMedia()
in apps/community-website/amplify/backend/function/resourcesManager/src/gql.js
28 1 2
getMedia()
in apps/community-website/src/graphql/queries.ts
28 1 1
listMediasSections()
in apps/community-website/src/graphql/queries.ts
28 1 3
getLivestream()
in apps/community-website/src/graphql/queries.ts
28 1 1
createMedia()
in apps/community-website/src/graphql/mutations.ts
28 1 2
updateMedia()
in apps/community-website/src/graphql/mutations.ts
28 1 2