awslabs / fhir-works-on-aws-ui
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 42 units with 1,068 lines of code in units (44.8% of code).
    • 1 very long units (163 lines of code)
    • 6 long units (408 lines of code)
    • 7 medium size units (246 lines of code)
    • 10 small units (130 lines of code)
    • 18 very small units (121 lines of code)
15% | 38% | 23% | 12% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx19% | 41% | 21% | 4% | 12%
ts0% | 27% | 27% | 37% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/components/search31% | 15% | 34% | 7% | 10%
src/components/create0% | 93% | 0% | 0% | 6%
src/common/backend0% | 35% | 13% | 49% | 1%
src/components/delete0% | 87% | 0% | 0% | 12%
src/components/read0% | 86% | 0% | 0% | 13%
src/components/update0% | 76% | 0% | 0% | 23%
amplify-infra/lib0% | 0% | 100% | 0% | 0%
src/common/utils0% | 0% | 0% | 0% | 100%
src/components0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function searchResults()
in src/components/search/SearchResults.tsx
163 4 0
function createForm()
in src/components/create/Create.tsx
85 2 0
function searchForm()
in src/components/search/Search.tsx
82 1 0
async search()
in src/common/backend/StubbedBackend.ts
68 1 4
function deleteForm()
in src/components/delete/Delete.tsx
63 2 0
function readForm()
in src/components/read/Read.tsx
59 2 0
function updateForm()
in src/components/update/Update.tsx
51 2 0
function populateVisibleContentPreferenceOptions()
in src/components/search/SearchResults.tsx
49 7 0
function previewPane()
in src/components/search/SearchResults.tsx
45 3 0
constructor()
in amplify-infra/lib/amplify-infra-stack.ts
43 1 3
function populateColumnDefinitions()
in src/components/search/SearchResults.tsx
38 4 0
async delete()
in src/common/backend/StubbedBackend.ts
26 1 2
async function searchResource()
in src/components/search/Search.tsx
24 1 0
function EmptyState()
in src/components/search/SearchResults.tsx
21 1 4
async create()
in src/common/backend/StubbedBackend.ts
17 1 1
async read()
in src/common/backend/StubbedBackend.ts
15 1 2
async update()
in src/common/backend/FWoABackend.ts
14 2 1
async create()
in src/common/backend/FWoABackend.ts
13 2 1
async function deleteResource()
in src/components/search/SearchResults.tsx
13 1 0
async read()
in src/common/backend/FWoABackend.ts
12 2 2