aws-samples / amazon-eks-observability-demo
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 21 units with 353 lines of code in units (21.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (56 lines of code)
    • 3 medium size units (85 lines of code)
    • 10 small units (167 lines of code)
    • 7 very small units (45 lines of code)
0% | 15% | 24% | 47% | 12%
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% | 21% | 51% | 5%
go0% | 0% | 31% | 36% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
base/lib0% | 70% | 29% | 0% | 0%
observability/lib0% | 0% | 28% | 71% | 0%
apps/simple-frontend0% | 0% | 81% | 0% | 18%
utils0% | 0% | 0% | 78% | 21%
apps/simple-frontend-otel0% | 0% | 0% | 63% | 36%
apps/simple-backend0% | 0% | 0% | 55% | 44%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in base/lib/base-stack.ts
56 6 3
constructor()
in observability/lib/opentelemetry-stack.ts
32 1 3
func main()
in apps/simple-frontend/main.go
30 4 0
constructor()
in base/lib/ingress-controller-stack.ts
23 1 3
constructor()
in observability/lib/cloudwatch-namespace.ts
19 1 3
func initTracer()
in apps/simple-frontend-otel/main.go
19 2 0
constructor()
in observability/lib/cluster-logging-stack.ts
18 1 3
export function loadManifest()
in utils/manifest-utils.ts
18 4 1
constructor()
in observability/lib/container-insights-stack.ts
16 1 3
func main()
in apps/simple-backend/main.go
16 2 0
export function prepareNamespace()
in utils/manifest-utils.ts
16 1 3
export function importCluster()
in utils/cluster-utils.ts
16 4 2
constructor()
in observability/lib/prometheus-cloudwatch-stack.ts
15 1 3
constructor()
in observability/lib/xray-stack.ts
14 1 3
10 1 5
func main()
in apps/simple-frontend-otel/main.go
7 1 0
func init()
in apps/simple-frontend/main.go
7 1 0
func init()
in apps/simple-backend/main.go
7 1 0
func random()
in apps/simple-backend/main.go
6 1 1
func handler()
in apps/simple-frontend-otel/main.go
4 1 2