awslabs / fhir-works-on-aws-search-es
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 36 units with 877 lines of code in units (25.3% of code).
    • 1 very long units (102 lines of code)
    • 5 long units (302 lines of code)
    • 9 medium size units (311 lines of code)
    • 4 small units (67 lines of code)
    • 17 very small units (95 lines of code)
11% | 34% | 35% | 7% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts11% | 34% | 35% | 7% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src21% | 25% | 34% | 10% | 7%
src/QueryBuilder0% | 49% | 43% | 6% | 0%
src/FHIRSearchParametersRegistry0% | 100% | 0% | 0% | 0%
src/searchMappingsManager0% | 0% | 43% | 0% | 56%
scripts/elasticSearchMappingsGenerator0% | 0% | 0% | 0% | 100%
src/implementationGuides0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async typeSearch()
in src/elasticSearchService.ts
102 10 1
67 7 3
function typeQueryWithConditions()
in src/QueryBuilder/index.ts
67 11 6
export function tokenQuery()
in src/QueryBuilder/typeQueries/tokenQuery.ts
64 10 4
constructor()
in src/FHIRSearchParametersRegistry/index.ts
52 5 2
private async getChainedParametersQuery()
in src/elasticSearchService.ts
52 6 3
export function stringQuery()
in src/QueryBuilder/typeQueries/stringQuery.ts
46 8 3
40 6 2
private async executeQueries()
in src/elasticSearchService.ts
39 6 2
export function referenceQuery()
in src/QueryBuilder/typeQueries/referenceQuery.ts
39 9 7
private async executeQuery()
in src/elasticSearchService.ts
32 6 2
function searchParamQuery()
in src/QueryBuilder/index.ts
32 3 5
async createOrUpdateMappings()
in src/searchMappingsManager/index.ts
31 10 0
private async processSearchInclusions()
in src/elasticSearchService.ts
29 1 3
private hitsToSearchEntries()
in src/elasticSearchService.ts
23 1 4
export function uriQuery()
in src/QueryBuilder/typeQueries/uriQuery.ts
18 4 4
private static buildElasticSearchFilterPart()
in src/elasticSearchService.ts
17 4 1
private static buildElasticSearchFilter()
in src/elasticSearchService.ts
17 3 1
private getFilters()
in src/elasticSearchService.ts
15 2 1
function mergeParserResults()
in src/implementationGuides/index.ts
9 1 2