aws-samples / aws-kendra-transcribe-media-search
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 93 units with 1,535 lines of code in units (19.8% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (311 lines of code)
    • 20 medium size units (602 lines of code)
    • 25 small units (383 lines of code)
    • 43 very small units (239 lines of code)
0% | 20% | 39% | 24% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 23% | 38% | 20% | 17%
tsx0% | 22% | 54% | 8% | 14%
ts0% | 0% | 0% | 87% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/indexer0% | 26% | 36% | 18% | 17%
src/search/facets0% | 23% | 9% | 52% | 15%
src/search/resultsPanel0% | 28% | 59% | 0% | 12%
src/search0% | 0% | 72% | 16% | 11%
src0% | 0% | 79% | 11% | 8%
lambda/token-enabler0% | 0% | 51% | 28% | 20%
lambda/build-trigger0% | 0% | 64% | 35% | 0%
src/search/sorting0% | 0% | 0% | 74% | 25%
src/services/helpers0% | 0% | 0% | 100% | 0%
src/search/searchBar0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in src/search/facets/components/Facet.tsx
70 11 0
def process_s3_media_object()
in lambda/indexer/crawler.py
69 12 8
def list_s3_objects()
in lambda/indexer/crawler.py
60 23 4
def lambda_handler()
in lambda/indexer/jobcomplete.py
57 7 2
render()
in src/search/resultsPanel/TopResults.tsx
55 7 0
render()
in src/search/resultsPanel/components/ResultFooter.tsx
48 6 0
render()
in src/App.tsx
45 19 0
def get_document()
in lambda/indexer/jobcomplete.py
44 6 5
def lambda_handler()
in lambda/indexer/crawler.py
38 15 2
render()
in src/search/resultsPanel/components/TextWithHighlight.tsx
36 5 0
setInfra()
in src/App.tsx
35 2 3
render()
in src/search/resultsPanel/ResultPanel.tsx
30 2 0
async componentDidMount()
in src/search/Search.tsx
30 3 0
def stop_kendra_sync_job_when_all_done()
in lambda/indexer/common.py
29 6 2
28 5 1
render()
in src/search/facets/components/FacetCheckbox.tsx
28 4 0
def send()
in lambda/build-trigger/cfnresponse.py
25 4 7
def send()
in lambda/token-enabler/cfnresponse.py
25 4 7
def send()
in lambda/indexer/cfnresponse.py
25 4 7
def delete_kendra_docs()
in lambda/indexer/common.py
24 6 4