aws-samples / enterprise-controls-catalog-via-aws-audit-manager
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 14 units with 258 lines of code in units (67.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (56 lines of code)
    • 4 medium size units (120 lines of code)
    • 3 small units (45 lines of code)
    • 6 very small units (37 lines of code)
0% | 21% | 46% | 17% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 21% | 46% | 17% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 100% | 0% | 0% | 0%
lambda/src0% | 0% | 59% | 22% | 18%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
constructor()
in lib/audit-manager-blog-stack.ts
56 1 3
38 5 1
29 4 1
export async function loadDataFile()
in lambda/src/data-file.ts
27 5 1
26 3 2
function buildFrameworkRequest()
in lambda/src/frameworks.ts
16 1 2
async function loadCustomFrameworkList()
in lambda/src/frameworks.ts
15 3 0
14 3 0
function buildControlRequest()
in lambda/src/controls.ts
10 1 1
async function sendNotification()
in lambda/src/index.ts
9 1 1
function getType()
in lambda/src/data-file.ts
6 3 1
function getExtension()
in lambda/src/data-file.ts
6 3 1
async function handleError()
in lambda/src/index.ts
4 1 1
await sendNotification()
in lambda/src/index.ts
2 1 0