aws / aws-xray-daemon
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 120 units with 1,601 lines of code in units (76.3% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (239 lines of code)
    • 15 medium size units (482 lines of code)
    • 36 small units (526 lines of code)
    • 65 very small units (354 lines of code)
0% | 14% | 30% | 32% | 22%
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% | 30% | 32% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/tracing0% | 44% | 20% | 23% | 10%
pkg/processor0% | 29% | 32% | 18% | 19%
pkg/telemetry0% | 22% | 32% | 20% | 23%
pkg/cfg0% | 0% | 43% | 29% | 27%
pkg/conn0% | 0% | 29% | 51% | 19%
pkg/proxy0% | 0% | 54% | 26% | 18%
pkg/logger0% | 0% | 100% | 0% | 0%
pkg/util0% | 0% | 67% | 0% | 32%
pkg/bufferpool0% | 0% | 0% | 63% | 36%
pkg/ringbuffer0% | 0% | 0% | 71% | 28%
pkg/tracesegment0% | 0% | 0% | 90% | 9%
pkg/cli0% | 0% | 0% | 44% | 56%
pkg/profiler0% | 0% | 0% | 62% | 37%
pkg/socketconn0% | 0% | 0% | 61% | 38%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func initDaemon()
in cmd/tracing/daemon.go
63 6 1
func()
in pkg/processor/batchprocessor.go
62 11 1
func()
in cmd/tracing/daemon.go
58 10 1
func newT()
in pkg/telemetry/telemetry.go
56 8 4
func NewServer()
in pkg/proxy/server.go
49 8 3
func GetAWSConfigSession()
in pkg/conn/conn.go
42 8 5
func DefaultConfig()
in pkg/cfg/cfg.go
39 1 0
func LoadLogConfig()
in pkg/logger/log_config.go
35 14 3
func New()
in pkg/processor/processor.go
35 3 6
func()
in pkg/processor/processor.go
33 9 1
func initCli()
in cmd/tracing/daemon.go
32 1 1
func merge()
in pkg/cfg/cfg.go
31 4 1
func SplitHeaderBody()
in pkg/util/util.go
31 7 3
func()
in pkg/telemetry/telemetry.go
29 5 1
28 4 0
func EvaluateConnectionError()
in pkg/telemetry/telemetry.go
26 9 1
func()
in cmd/tracing/tracing_windows.go
25 4 1
func()
in pkg/telemetry/telemetry.go
24 5 1
func ConfigValidation()
in pkg/cfg/cfg.go
23 6 1
func evaluateBufferMemory()
in cmd/tracing/daemon.go
20 4 1