aws-samples / s3-to-lambda-patterns
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 34 units with 162 lines of code in units (3.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 8 small units (92 lines of code)
    • 26 very small units (70 lines of code)
0% | 0% | 0% | 56% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 0% | 56% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
videos-samples/1-translation0% | 0% | 0% | 75% | 24%
videos-samples/3-dynamodb0% | 0% | 0% | 100% | 0%
videos-samples/2-transcribe0% | 0% | 0% | 100% | 0%
translation/v20% | 0% | 0% | 0% | 100%
translation/v10% | 0% | 0% | 0% | 100%
ddbImporter/v20% | 0% | 0% | 0% | 100%
resize-video/resizeFunction0% | 0% | 0% | 0% | 100%
decoupled-docrepo/loaders0% | 0% | 0% | 0% | 100%
ddbImporter/v10% | 0% | 0% | 0% | 100%
docrepository/processDOCX0% | 0% | 0% | 0% | 100%
docrepository/addToQueueFunction0% | 0% | 0% | 0% | 100%
docrepository/batchingFunction0% | 0% | 0% | 0% | 100%
docrepository/processPDF0% | 0% | 0% | 0% | 100%
docrepository/processJPG0% | 0% | 0% | 0% | 100%
docrepository/addToESindex0% | 0% | 0% | 0% | 100%
workflow/StartExecutionFunction0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function putS3object()
in videos-samples/3-dynamodb/importFunction/s3.js
12 2 1
async function putS3object()
in videos-samples/1-translation/translatorFunction/s3.js
12 2 1
async function putS3object()
in videos-samples/1-translation/batchingFunction/s3.js
12 2 1
async function putS3object()
in videos-samples/2-transcribe/sentimentFunction/s3.js
12 2 1
async function getS3object()
in videos-samples/3-dynamodb/importFunction/s3.js
11 2 1
async function getS3object()
in videos-samples/1-translation/translatorFunction/s3.js
11 2 1
async function getS3object()
in videos-samples/1-translation/batchingFunction/s3.js
11 2 1
async function getS3object()
in videos-samples/2-transcribe/sentimentFunction/s3.js
11 2 1
await saveToDDB()
in ddbImporter/v2/loaderFunction/app.js
6 1 1
await putS3object()
in videos-samples/1-translation/translatorFunction/app.js
6 1 4
function arrayContainsArray()
in translation/v1/translatorFunction/app.js
5 1 2
function arrayContainsArray()
in translation/v2/addToQueueFunction/array.js
5 1 2
function arrayContainsArray()
in videos-samples/1-translation/translatorFunction/app.js
5 1 2
await doTranslation()
in translation/v2/translatorFunction/app.js
3 2 1
await saveToDDB()
in translation/v2/addToQueueFunction/app.js
3 1 1
await resizeVideo()
in resize-video/resizeFunction/app.js
2 2 1
await indexDocument()
in decoupled-docrepo/loaders/loadToES/app.js
2 2 1
await ddbLoader()
in ddbImporter/v1/importFunction/app.js
2 2 1
await addToSQS()
in ddbImporter/v2/addToQueueFunction/app.js
2 2 1
await doTranslation()
in translation/v1/translatorFunction/app.js
2 2 2