awslabs / fhir-works-on-aws-routing
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 79 units with 1,939 lines of code in units (60.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (231 lines of code)
    • 5 medium complex units (379 lines of code)
    • 10 simple units (389 lines of code)
    • 63 very simple units (940 lines of code)
0% | 11% | 19% | 20% | 48%
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% | 11% | 19% | 20% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/router/routes0% | 43% | 7% | 32% | 16%
src/router/bundle0% | 0% | 38% | 20% | 41%
src0% | 0% | 86% | 0% | 13%
src/router/metadata0% | 0% | 0% | 27% | 72%
src/router/middlewares0% | 0% | 0% | 65% | 34%
src/implementationGuides0% | 0% | 0% | 37% | 62%
src/router/handlers0% | 0% | 0% | 0% | 100%
src/router/validation0% | 0% | 0% | 0% | 100%
src/router0% | 0% | 0% | 0% | 100%
src/registry0% | 0% | 0% | 0% | 100%
src/operationDefinitions0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private init()
in src/router/routes/genericResourceRoute.ts
231 32 0
static buildInitiateExportRequest()
in src/router/routes/exportRouteHelper.ts
40 15 5
143 15 3
private static async checkReferences()
in src/router/bundle/bundleParser.ts
86 14 6
async processTransaction()
in src/router/bundle/bundleHandler.ts
89 14 5
private static getResourceType()
in src/router/bundle/bundleParser.ts
21 11 2
export const setTenantIdMiddleware:()
in src/router/middlewares/setTenantId.ts
23 10 1
private static getOperation()
in src/router/bundle/bundleParser.ts
19 10 1
private static getReferences()
in src/router/bundle/bundleParser.ts
63 9 1
private static getResourceId()
in src/router/bundle/bundleParser.ts
21 9 2
init()
in src/router/routes/rootRoute.ts
80 8 0
outputFormat: isString()
in src/router/routes/exportRouteHelper.ts
24 8 1
private static isFhirStructureDefinition()
in src/implementationGuides/index.ts
12 8 1
export default function makeSecurity()
in src/router/metadata/cap.rest.security.template.ts
71 7 2
init()
in src/router/routes/exportRoute.ts
66 6 0
private static isFhirOperationDefinition()
in src/implementationGuides/index.ts
10 6 1
static generateBundle()
in src/router/bundle/bundleGenerator.ts
30 5 6
static generateTransactionBundle()
in src/router/bundle/bundleGenerator.ts
41 5 2
constructor()
in src/router/validation/jsonSchemaValidator.ts
15 5 1
type: isString()
in src/router/routes/exportRouteHelper.ts
19 5 1