aws-samples / aws-lambda-extensions
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 249 units with 3,807 lines of code in units (61.9% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (334 lines of code)
    • 60 medium size units (1,663 lines of code)
    • 73 small units (1,133 lines of code)
    • 111 very small units (677 lines of code)
0% | 8% | 43% | 29% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 12% | 52% | 19% | 15%
java0% | 0% | 78% | 15% | 5%
cs0% | 0% | 60% | 30% | 8%
js0% | 0% | 24% | 66% | 8%
py0% | 0% | 0% | 64% | 35%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
go-example-adaptive-batching-extension0% | 23% | 37% | 18% | 19%
go-example-logs-api-extension0% | 13% | 52% | 24% | 9%
kinesisfirehose-logs-extension-demo0% | 17% | 49% | 14% | 18%
cache-extension-demo0% | 13% | 21% | 42% | 22%
go-example-crash-uploader-extension0% | 0% | 73% | 18% | 8%
go-example-extension-sam-layer0% | 0% | 81% | 9% | 8%
go-example-extension0% | 0% | 81% | 9% | 8%
go-example-ipc-extension0% | 0% | 71% | 10% | 18%
java-example-extension0% | 0% | 78% | 15% | 5%
csharp-example-extension0% | 0% | 60% | 30% | 8%
nodejs-example-logs-api-extension0% | 0% | 44% | 44% | 10%
python-example-elasticsearch-extension0% | 0% | 0% | 71% | 28%
s3-logs-extension-demo-zip-archive0% | 0% | 0% | 67% | 32%
python-example-logs-api-extension0% | 0% | 0% | 59% | 40%
s3-logs-extension-demo-container-image0% | 0% | 0% | 60% | 40%
python-example-extension0% | 0% | 0% | 78% | 21%
nodejs-example-extension0% | 0% | 0% | 82% | 17%
awsappconfig-extension-demo0% | 0% | 0% | 100% | 0%
ruby-example-wrapper0% | 0% | 0% | 0% | 100%
python-example-wrapper0% | 0% | 0% | 0% | 100%
bash-example-wrapper0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in go-example-adaptive-batching-extension/main.go
77 13 0
func main()
in go-example-logs-api-extension/main.go
71 14 0
func main()
in kinesisfirehose-logs-extension-demo/main.go
71 14 0
func()
in go-example-adaptive-batching-extension/agent/http.go
64 13 1
func GetData()
in cache-extension-demo/plugins/dynamodb.go
51 10 1
func uploadFileToS3()
in go-example-crash-uploader-extension/upload.go
36 8 3
func()
in go-example-extension-sam-layer/go-example-extension/extension/client.go
35 7 1
func()
in go-example-logs-api-extension/extension/client.go
35 7 1
func()
in go-example-crash-uploader-extension/extension/client.go
35 7 1
func()
in kinesisfirehose-logs-extension-demo/extension/client.go
35 7 1
func()
in go-example-adaptive-batching-extension/extension/client.go
35 7 1
func()
in go-example-extension/extension/client.go
35 7 1
func()
in go-example-ipc-extension/extension/client.go
34 7 1
func()
in cache-extension-demo/extension/client.go
34 7 1
func()
in go-example-logs-api-extension/agent/http.go
32 5 1
func NewS3Logger()
in go-example-adaptive-batching-extension/agent/logger.go
32 3 0
func()
in go-example-logs-api-extension/logsapi/client.go
31 6 1
func()
in kinesisfirehose-logs-extension-demo/logsapi/client.go
31 6 1
function listen()
in nodejs-example-logs-api-extension/nodejs-example-logs-api-extension/http-listener.js
31 5 2
func searchForFilesAndUploadAndDelete()
in go-example-crash-uploader-extension/upload.go
30 7 5