awslabs / fhir-works-on-aws-search-es
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 36 units with 877 lines of code in units (25.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (67 lines of code)
    • 10 simple units (512 lines of code)
    • 25 very simple units (298 lines of code)
0% | 0% | 7% | 58% | 33%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
ts0% | 0% | 7% | 58% | 33%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/QueryBuilder0% | 0% | 25% | 56% | 18%
src0% | 0% | 0% | 71% | 28%
src/searchMappingsManager0% | 0% | 0% | 43% | 56%
src/FHIRSearchParametersRegistry0% | 0% | 0% | 0% | 100%
scripts/elasticSearchMappingsGenerator0% | 0% | 0% | 0% | 100%
src/implementationGuides0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function typeQueryWithConditions()
in src/QueryBuilder/index.ts
67 11 6
async typeSearch()
in src/elasticSearchService.ts
102 10 1
export function tokenQuery()
in src/QueryBuilder/typeQueries/tokenQuery.ts
64 10 4
async createOrUpdateMappings()
in src/searchMappingsManager/index.ts
31 10 0
export function referenceQuery()
in src/QueryBuilder/typeQueries/referenceQuery.ts
39 9 7
export function stringQuery()
in src/QueryBuilder/typeQueries/stringQuery.ts
46 8 3
67 7 3
private async getChainedParametersQuery()
in src/elasticSearchService.ts
52 6 3
private async executeQuery()
in src/elasticSearchService.ts
32 6 2
private async executeQueries()
in src/elasticSearchService.ts
39 6 2
40 6 2
constructor()
in src/FHIRSearchParametersRegistry/index.ts
52 5 2
private assertValidTenancyMode()
in src/elasticSearchService.ts
8 5 1
private static buildElasticSearchFilterPart()
in src/elasticSearchService.ts
17 4 1
export function uriQuery()
in src/QueryBuilder/typeQueries/uriQuery.ts
18 4 4
private static buildElasticSearchFilter()
in src/elasticSearchService.ts
17 3 1
function searchParamQuery()
in src/QueryBuilder/index.ts
32 3 5
3 2 1
private getFilters()
in src/elasticSearchService.ts
15 2 1
index: getAliasName()
in src/elasticSearchService.ts
2 2 2