awslabs / fhir-works-on-aws-persistence-ddb
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 86 units with 1,843 lines of code in units (68.2% of code).
    • 2 very long units (255 lines of code)
    • 4 long units (308 lines of code)
    • 22 medium size units (730 lines of code)
    • 20 small units (329 lines of code)
    • 38 very small units (221 lines of code)
13% | 16% | 39% | 17% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts13% | 16% | 39% | 17% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/dataServices21% | 16% | 34% | 19% | 7%
testUtilities0% | 44% | 46% | 7% | 1%
src/objectStorageService0% | 0% | 45% | 25% | 28%
src/ddbToEs0% | 0% | 54% | 10% | 34%
src0% | 0% | 0% | 0% | 100%
src/bulkExport0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private async lockItems()
in src/dataServices/dynamoDbBundleService.ts
131 17 2
static generateStagingRequests()
in src/dataServices/dynamoDbBundleServiceHelper.ts
124 7 3
async transaction()
in src/dataServices/dynamoDbBundleService.ts
98 13 1
private async updatedReferences()
in src/dataServices/dynamoDbBundleService.ts
92 13 3
static getUpdate()
in testUtilities/GenerateStagingRequestsFactory.ts
66 1 0
static getCreate()
in testUtilities/GenerateStagingRequestsFactory.ts
52 1 0
async handleDDBStreamEvent()
in src/ddbToEs/ddbToEsSync.ts
49 10 1
private async unlockItems()
in src/dataServices/dynamoDbBundleService.ts
49 10 3
private async stageItems()
in src/dataServices/dynamoDbBundleService.ts
43 7 3
static buildBundleEntryResponse()
in testUtilities/GenerateRollbackRequestsFactory.ts
42 2 2
static getRead()
in testUtilities/GenerateStagingRequestsFactory.ts
42 1 0
static getDelete()
in testUtilities/GenerateStagingRequestsFactory.ts
41 1 0
async getExportStatus()
in src/dataServices/dynamoDbDataService.ts
40 3 2
static buildUpdateDocumentStatusParam()
in src/dataServices/dynamoDbParamBuilder.ts
39 3 6
async executeEsCmds()
in src/ddbToEs/ddbToEsHelper.ts
37 5 1
static async deleteBasedOnPrefix()
in src/objectStorageService/s3ObjectStorageService.ts
33 4 1
static prepItemForDdbInsert()
in src/dataServices/dynamoDbUtil.ts
33 3 5
private async getMostRecentResources()
in src/dataServices/dynamoDbHelper.ts
31 5 5
async updateResource()
in src/dataServices/dynamoDbDataService.ts
31 4 1
async getMostRecentUserReadableResource()
in src/dataServices/dynamoDbHelper.ts
28 5 3