aws-samples / dynamodb-local-testing
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 13 units with 202 lines of code in units (70.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 2 medium size units (61 lines of code)
    • 3 small units (56 lines of code)
    • 7 very small units (34 lines of code)
0% | 25% | 30% | 27% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 71% | 0% | 28% | 0%
go0% | 0% | 46% | 27% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/lib0% | 71% | 0% | 28% | 0%
cmd0% | 0% | 100% | 0% | 0%
pkg/api0% | 0% | 51% | 0% | 48%
pkg/service0% | 0% | 0% | 85% | 14%
pkg/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
constructor()
in cdk/lib/FargateServiceStack.ts
51 1 3
func main()
in cmd/main.go
39 3 0
func()
in pkg/api/postservice_api.go
22 6 1
func()
in pkg/service/postservice.go
20 4 1
constructor()
in cdk/lib/DDBStack.ts
20 1 3
func()
in pkg/service/postservice.go
16 3 1
func()
in pkg/api/postservice_api.go
8 2 1
func handleError()
in pkg/api/postservice_api.go
7 2 3
func NewDdbPostService()
in pkg/service/postservice.go
6 1 1
func GetLocalTimestampNow()
in pkg/utils/utils.go
4 1 0
func handleError500()
in pkg/api/postservice_api.go
3 1 2
func handleError400()
in pkg/api/postservice_api.go
3 1 2
func GetLocalTimestamp()
in pkg/utils/utils.go
3 1 1