awslabs / fhir-works-on-aws-routing
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 79 units with 1,939 lines of code in units (60.9% of code).
    • 2 very long units (374 lines of code)
    • 6 long units (455 lines of code)
    • 24 medium size units (680 lines of code)
    • 17 small units (252 lines of code)
    • 30 very small units (178 lines of code)
19% | 23% | 35% | 12% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts19% | 23% | 35% | 12% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/router/routes43% | 27% | 12% | 9% | 7%
src86% | 0% | 0% | 9% | 4%
src/router/bundle0% | 46% | 39% | 10% | 3%
src/router/metadata0% | 27% | 58% | 10% | 3%
src/router/handlers0% | 0% | 55% | 11% | 33%
src/implementationGuides0% | 0% | 62% | 20% | 16%
src/router/middlewares0% | 0% | 65% | 34% | 0%
src/router/validation0% | 0% | 34% | 44% | 20%
src/router0% | 0% | 57% | 42% | 0%
src/registry0% | 0% | 100% | 0% | 0%
src/operationDefinitions0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private init()
in src/router/routes/genericResourceRoute.ts
231 32 0
143 15 3
async processTransaction()
in src/router/bundle/bundleHandler.ts
89 14 5
private static async checkReferences()
in src/router/bundle/bundleParser.ts
86 14 6
init()
in src/router/routes/rootRoute.ts
80 8 0
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 getReferences()
in src/router/bundle/bundleParser.ts
63 9 1
41 4 3
static generateTransactionBundle()
in src/router/bundle/bundleGenerator.ts
41 5 2
export default function makeRest()
in src/router/metadata/cap.rest.template.ts
41 3 4
static buildInitiateExportRequest()
in src/router/routes/exportRouteHelper.ts
40 15 5
async compile()
in src/implementationGuides/index.ts
37 5 1
async typeSearch()
in src/router/handlers/resourceHandler.ts
34 1 6
async instanceHistory()
in src/router/handlers/resourceHandler.ts
34 1 7
function makeResourceObject()
in src/router/metadata/cap.rest.resource.template.ts
31 5 7
static generateBundle()
in src/router/bundle/bundleGenerator.ts
30 5 6
export default function makeStatement()
in src/router/metadata/cap.template.ts
29 2 4
static createLinkWithQuery()
in src/router/bundle/bundleGenerator.ts
27 4 6
export function makeGenericResources()
in src/router/metadata/cap.rest.resource.template.ts
26 1 6