aws-solutions / aws-centralized-logging
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 23 units with 1,512 lines of code in units (72.6% of code).
    • 2 very long units (1,009 lines of code)
    • 2 long units (173 lines of code)
    • 9 medium size units (254 lines of code)
    • 1 small units (11 lines of code)
    • 9 very small units (65 lines of code)
66% | 11% | 16% | <1% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts66% | 11% | 16% | <1% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/lib85% | 8% | 4% | 0% | 1%
services/helper0% | 44% | 49% | 6% | 0%
services/transformer0% | 0% | 87% | 0% | 12%
services/@aws-solutions/utils/metrics0% | 0% | 0% | 0% | 100%
services/@aws-solutions/utils/logger0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/resources/lib/cl-primary-stack.ts
854 2 2
constructor()
in source/resources/lib/cl-demo-stack.ts
155 2 3
constructor()
in source/resources/lib/cl-demo-ec2-construct.ts
98 1 3
async function putDestination()
in source/services/helper/index.ts
75 4 6
async function putRecords()
in source/services/transformer/index.ts
42 3 1
async function deleteDestination()
in source/services/helper/index.ts
34 1 2
function buildSource()
in source/services/transformer/index.ts
33 7 2
async function getRegions()
in source/services/helper/index.ts
28 3 0
constructor()
in source/resources/lib/cl-jumpbox-construct.ts
27 1 3
export function applyCfnNagSuppressRules()
in source/resources/lib/utils.ts
23 4 2
function createRecordsFromEvents()
in source/services/transformer/index.ts
23 1 4
async function areRegionsValid()
in source/services/helper/index.ts
22 5 2
function transform()
in source/services/transformer/index.ts
22 5 4
await putDestination()
in source/services/helper/index.ts
11 2 6
export function applyDependsOn()
in source/resources/lib/utils.ts
10 3 2
format: combine()
in source/services/@aws-solutions/utils/logger/index.ts
9 1 1
await got()
in source/services/@aws-solutions/utils/metrics/index.ts
9 1 5
static async sendAnonymousMetric()
in source/services/@aws-solutions/utils/metrics/index.ts
8 1 0
function isValidJson()
in source/services/transformer/index.ts
8 2 1
export function applyRetentionPolicy()
in source/resources/lib/utils.ts
7 3 1