aws-samples / amazon-qldb-dmv-sample-nodejs
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 94 units with 1,165 lines of code in units (52.5% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (103 lines of code)
    • 6 medium size units (204 lines of code)
    • 38 small units (547 lines of code)
    • 48 very small units (311 lines of code)
0% | 8% | 17% | 46% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 8% | 17% | 46% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 11% | 18% | 48% | 20%
src/qldb0% | 0% | 14% | 42% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
52 6 3
51 4 4
async function createExportRole()
in src/ExportJournal.ts
46 3 4
export async function readExport()
in src/qldb/JournalS3ExportReader.ts
44 2 2
async function createExport()
in src/ExportJournal.ts
34 3 8
33 4 6
25 3 3
22 4 3
20 4 2
20 6 3
19 2 4
19 2 4
18 4 2
async function listJournalExports()
in src/ListJournalExports.ts
18 3 1
async function createJournalExport()
in src/ValidateQldbHashchain.ts
17 1 1
export async function findPrimaryOwnerForVehicle()
in src/TransferVehicleOwnership.ts
17 4 2
17 3 4
export function fromIon()
in src/qldb/JournalBlock.ts
16 5 1
async function getRevision()
in src/GetRevision.ts
16 1 5
16 3 2