aws-samples / cross-aws-sdk-workshop
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 152 units with 2,036 lines of code in units (55.4% of code).
    • 3 very long units (489 lines of code)
    • 2 long units (120 lines of code)
    • 17 medium size units (529 lines of code)
    • 31 small units (435 lines of code)
    • 99 very small units (463 lines of code)
24% | 5% | 25% | 21% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts77% | 0% | 10% | 7% | 4%
go0% | 12% | 42% | 29% | 15%
java0% | 0% | 18% | 14% | 66%
py0% | 0% | 0% | 40% | 59%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib77% | 0% | 10% | 7% | 4%
lambda/go/process-transcription0% | 79% | 0% | 20% | 0%
lambda/go/start-transcription0% | 58% | 0% | 34% | 7%
lambda/go/add-podcasts0% | 0% | 86% | 13% | 0%
lambda/java/src0% | 0% | 18% | 14% | 66%
lambda/go/upload-podcast0% | 0% | 70% | 24% | 5%
lambda/go/get-podcast0% | 0% | 68% | 25% | 6%
lambda/go/update-episode-status0% | 0% | 70% | 30% | 0%
lambda/go/list-podcasts0% | 0% | 28% | 44% | 27%
lambda/go/play-podcast0% | 0% | 30% | 43% | 26%
lambda/python0% | 0% | 0% | 40% | 59%
lambda/go0% | 0% | 0% | 38% | 61%
lambda/go/check-transcription0% | 0% | 0% | 66% | 33%
lambda/go/stub-function0% | 0% | 0% | 68% | 31%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
189 5 3
165 6 3
135 3 1
func()
in lambda/go/process-transcription/main.go
67 8 1
func()
in lambda/go/start-transcription/main.go
53 6 1
func()
in lambda/go/add-podcasts/main.go
48 11 1
func()
in lambda/go/add-podcasts/main.go
44 8 1
func()
in lambda/go/add-podcasts/main.go
44 8 1
func()
in lambda/go/upload-podcast/main.go
40 9 1
constructor()
in lib/cdk-stack.ts
37 1 3
func()
in lambda/go/get-podcast/main.go
32 7 1
public APIGatewayV2HTTPResponse handleRequest()
in lambda/java/src/main/java/com/amazonaws/workshop/ListPodcasts.java
32 5 2
func()
in lambda/go/add-podcasts/main.go
28 5 1
func()
in lambda/go/update-episode-status/main.go
28 3 1
27 1 3
func()
in lambda/go/add-podcasts/main.go
27 6 1
func()
in lambda/go/list-podcasts/main.go
26 6 1
func()
in lambda/go/add-podcasts/main.go
26 3 1
func()
in lambda/go/add-podcasts/main.go
26 3 1
func()
in lambda/go/play-podcast/main.go
22 8 1