aws-samples / secure-static-site
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 18 units with 309 lines of code in units (5.8% of code).
    • 1 very long units (152 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 5 small units (68 lines of code)
    • 12 very small units (89 lines of code)
49% | 0% | 0% | 22% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts69% | 0% | 0% | 17% | 12%
tsx0% | 0% | 0% | 34% | 65%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/secure-static-site/lib68% | 0% | 0% | 17% | 14%
packages/secure-static-site-frontend/src0% | 0% | 0% | 34% | 65%
packages/secure-static-site-frontend0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
constructor()
in packages/secure-static-site/lib/static-site.ts
152 8 3
export function ResourcesTable()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
18 1 0
export function getCsp()
in packages/secure-static-site/lib/responseHeaders.ts
17 12 1
async function handleDownloadFont()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
11 2 1
export function getFunctionCode()
in packages/secure-static-site/lib/responseHeaders.ts
11 4 1
export function buildStaticSite()
in packages/secure-static-site/lib/buildStaticSite.ts
11 2 1
function handleDownloadStyle()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
10 1 1
export function StatusChip()
in packages/secure-static-site-frontend/src/StatusChip.tsx
10 3 1
function handleDownloadScript()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
9 1 1
function handleDownloadMedia()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
9 1 1
export function getSts()
in packages/secure-static-site/lib/responseHeaders.ts
9 6 1
function reducer()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
8 3 2
function handleDownloadImage()
in packages/secure-static-site-frontend/src/ResourcesTable.tsx
8 1 1
function handler()
in packages/secure-static-site/lib/viewerResponseFn.js
7 1 1
export function recordToEnvVars()
in packages/secure-static-site/lib/buildStaticSite.ts
6 2 1
value: getCsp()
in packages/secure-static-site/lib/responseHeaders.ts
5 2 1
value: getSts()
in packages/secure-static-site/lib/responseHeaders.ts
5 2 1
export default defineConfig()
in packages/secure-static-site-frontend/vite.config.ts
3 1 1