awslabs / aws-lambda-go-api-proxy
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 104 units with 851 lines of code in units (73.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (121 lines of code)
    • 3 medium size units (78 lines of code)
    • 23 small units (301 lines of code)
    • 76 very small units (351 lines of code)
0% | 14% | 9% | 35% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 14% | 9% | 35% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
core0% | 28% | 10% | 26% | 33%
fiber0% | 0% | 41% | 31% | 27%
sample0% | 0% | 0% | 37% | 62%
httpadapter0% | 0% | 0% | 48% | 52%
gorillamux0% | 0% | 0% | 48% | 52%
echo0% | 0% | 0% | 52% | 47%
gin0% | 0% | 0% | 52% | 47%
iris0% | 0% | 0% | 57% | 42%
negroni0% | 0% | 0% | 48% | 52%
chi0% | 0% | 0% | 52% | 47%
handlerfunc0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in core/request.go
68 20 1
func()
in core/requestv2.go
53 15 1
func()
in fiber/adapter.go
32 5 1
func()
in core/responsev2.go
25 4 1
func()
in core/response.go
21 3 1
func getPets()
in sample/main.go
19 5 1
func()
in core/requestv2.go
15 4 1
func addToHeaderV2()
in core/requestv2.go
15 3 2
func()
in core/request.go
15 4 1
func addToHeader()
in core/request.go
15 3 2
func()
in iris/adapter.go
15 4 1
func()
in core/requestv2.go
13 3 1
func()
in core/requestv2.go
13 3 1
func()
in core/request.go
13 3 1
func()
in core/request.go
13 3 1
func()
in httpadapter/adapter.go
12 3 1
func()
in httpadapter/adapterv2.go
12 3 1
func()
in negroni/adapter.go
12 3 1
func()
in gorillamux/adapter.go
12 3 1
func()
in gorillamux/adapterv2.go
12 3 1