aws-samples / amazon-transcribe-post-call-analytics
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 262 units with 4,552 lines of code in units (35.4% of code).
    • 3 very long units (454 lines of code)
    • 17 long units (1,104 lines of code)
    • 51 medium size units (1,529 lines of code)
    • 54 small units (843 lines of code)
    • 137 very small units (622 lines of code)
9% | 24% | 33% | 18% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 20% | 36% | 18% | 15%
js19% | 36% | 25% | 10% | 7%
tsx0% | 32% | 45% | 8% | 13%
ts0% | 0% | 0% | 87% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pca-server/src/pca13% | 19% | 33% | 17% | 15%
pca-ui/src/www44% | 12% | 25% | 3% | 13%
pca-ui/src/lambda0% | 50% | 27% | 18% | 3%
aws-kendra-transcribe-media-search/lambda/indexer0% | 26% | 36% | 18% | 17%
aws-kendra-transcribe-media-search/src/search0% | 28% | 26% | 30% | 14%
pca-server/src/trigger0% | 100% | 0% | 0% | 0%
aws-kendra-transcribe-media-search/src0% | 0% | 79% | 11% | 8%
pca-server/src/copy-samples0% | 0% | 100% | 0% | 0%
aws-kendra-transcribe-media-search/lambda/token-enabler0% | 0% | 51% | 28% | 20%
aws-kendra-transcribe-media-search/lambda/build-trigger0% | 0% | 64% | 35% | 0%
aws-kendra-transcribe-media-search/src/services0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function Search()
in pca-ui/src/www/src/routes/Search.js
177 20 1
def create_turn_by_turn_segments()
in pca-server/src/pca/pca-aws-sf-process-turn-by-turn.py
174 48 2
def put_kendra_document()
in pca-server/src/pca/pcakendrasearch.py
103 3 4
async function createRecord()
in pca-ui/src/lambda/index.js
89 5 1
def submitTranscribeJob()
in pca-server/src/pca/pca-aws-sf-start-transcribe-job.py
88 15 3
def create_combined_tca_graphic()
in pca-server/src/pca/pca-aws-sf-process-turn-by-turn.py
87 23 1
async function handler()
in pca-ui/src/lambda/list.js
70 9 2
render()
in aws-kendra-transcribe-media-search/src/search/facets/components/Facet.tsx
70 11 0
def process_s3_media_object()
in aws-kendra-transcribe-media-search/lambda/indexer/crawler.py
69 12 8
def create_output_conversation_analytics()
in pca-server/src/pca/pca-aws-sf-process-turn-by-turn.py
66 13 1
def list_s3_objects()
in aws-kendra-transcribe-media-search/lambda/indexer/crawler.py
60 23 4
exports.handler = function()
in pca-ui/src/lambda/bucket.js
59 2 2
def lambda_handler()
in pca-server/src/pca/pca-transcribe-eventbridge.py
59 15 2
render()
in aws-kendra-transcribe-media-search/src/search/resultsPanel/components/ResultFooter.tsx
58 7 0
def submitTranscribeJob()
in pca-server/src/pca/pcacommon.py
57 10 4
def lambda_handler()
in aws-kendra-transcribe-media-search/lambda/indexer/jobcomplete.py
57 7 2
exports.handler = function()
in pca-server/src/trigger/index.js
55 2 2
render()
in aws-kendra-transcribe-media-search/src/search/resultsPanel/TopResults.tsx
55 7 0
def generate_speaker_sentiment_trend()
in pca-server/src/pca/pca-aws-sf-process-turn-by-turn.py
53 6 3
function Home()
in pca-ui/src/www/src/routes/Home.js
52 17 1