aws / aws-lambda-go
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 107 units with 1,100 lines of code in units (36.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 14 medium size units (417 lines of code)
    • 23 small units (315 lines of code)
    • 70 very small units (368 lines of code)
0% | 0% | 37% | 28% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 37% | 28% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda0% | 0% | 45% | 35% | 18%
cmd/build-lambda-zip0% | 0% | 100% | 0% | 0%
events0% | 0% | 16% | 30% | 54%
cfn0% | 0% | 66% | 17% | 16%
lambdacontext0% | 0% | 0% | 61% | 38%
lambda/handlertrace0% | 0% | 0% | 0% | 100%
lambda/messages0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func NewHandler()
in lambda/handler.go
50 15 1
func compressExeAndArgs()
in cmd/build-lambda-zip/main.go
37 9 3
func()
in lambda/function.go
34 5 1
func main()
in cmd/build-lambda-zip/main.go
33 5 0
32 5 2
func()
in lambda/runtime_api_client.go
31 6 1
func convertInvokeRequest()
in lambda/invoke_loop.go
29 5 1
func unmarshalDynamoDBAttributeValue()
in events/attributevalue.go
28 11 3
func()
in cfn/response.go
25 6 1
func()
in lambda/runtime_api_client.go
25 6 1
func handleInvoke()
in lambda/invoke_loop.go
25 7 2
func writeExe()
in cmd/build-lambda-zip/main.go
24 5 3
func unmarshalList()
in events/attributevalue.go
22 5 2
func unmarshalMap()
in events/attributevalue.go
22 5 2
func formatFrame()
in lambda/panic.go
20 3 1
func unmarshalBinarySet()
in events/attributevalue.go
18 4 2
func unmarshalNumberSet()
in events/attributevalue.go
16 4 2
func unmarshalStringSet()
in events/attributevalue.go
16 4 2
func validateReturns()
in lambda/handler.go
16 6 1
func LambdaWrapSNS()
in cfn/wrap.go
15 3 1