aws-observability / aws-o11y-recipes
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 25 units with 465 lines of code in units (66.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (66 lines of code)
    • 6 medium size units (231 lines of code)
    • 4 small units (70 lines of code)
    • 14 very small units (98 lines of code)
0% | 14% | 49% | 15% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 15% | 44% | 16% | 23%
ts0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sandbox/ho11y0% | 28% | 52% | 7% | 11%
sandbox/CWMetricStreamExporter/lambda0% | 0% | 35% | 27% | 37%
sandbox/CWMetricStreamExporter/cdk/lib0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in sandbox/ho11y/main.go
66 11 0
func initProvider()
in sandbox/ho11y/main.go
43 3 0
func invokeDownstreams()
in sandbox/ho11y/main.go
42 6 1
constructor()
in sandbox/CWMetricStreamExporter/cdk/lib/cdk-stack.ts
41 1 3
func handler()
in sandbox/ho11y/main.go
37 5 2
func HandleRequest()
in sandbox/CWMetricStreamExporter/lambda/main.go
36 6 2
func createDimensionLabels()
in sandbox/CWMetricStreamExporter/lambda/main.go
32 5 1
func sanitize()
in sandbox/CWMetricStreamExporter/lambda/main.go
19 1 1
func sendRequestToAPS()
in sandbox/CWMetricStreamExporter/lambda/main.go
19 3 1
func invoke()
in sandbox/ho11y/main.go
18 2 2
func handleAddSamples()
in sandbox/CWMetricStreamExporter/lambda/main.go
14 5 3
func handleAddLabels()
in sandbox/CWMetricStreamExporter/lambda/main.go
9 1 4
func encodeWriteRequestIntoProtoAndSnappy()
in sandbox/CWMetricStreamExporter/lambda/main.go
9 2 1
func manageThrottle()
in sandbox/ho11y/main.go
9 2 0
func createWriteRequestAndSendToAPS()
in sandbox/CWMetricStreamExporter/lambda/main.go
8 1 1
func createMetricNameLabel()
in sandbox/CWMetricStreamExporter/lambda/main.go
7 1 2
func createNamespaceLabel()
in sandbox/CWMetricStreamExporter/lambda/main.go
7 1 1
func createSumSample()
in sandbox/CWMetricStreamExporter/lambda/main.go
7 1 2
func createCountSample()
in sandbox/CWMetricStreamExporter/lambda/main.go
7 1 2
func createMaxSample()
in sandbox/CWMetricStreamExporter/lambda/main.go
7 1 2