aws / aws-xray-sdk-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 322 units with 4,227 lines of code in units (80.8% of code).
    • 1 very long units (221 lines of code)
    • 10 long units (610 lines of code)
    • 46 medium size units (1,409 lines of code)
    • 61 small units (877 lines of code)
    • 204 very small units (1,110 lines of code)
5% | 14% | 33% | 20% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go5% | 14% | 33% | 20% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
xray8% | 17% | 31% | 19% | 24%
strategy0% | 14% | 38% | 23% | 24%
daemoncfg0% | 0% | 46% | 24% | 28%
pattern0% | 0% | 94% | 0% | 6%
awsplugins0% | 0% | 29% | 35% | 35%
header0% | 0% | 40% | 37% | 21%
instrumentation0% | 0% | 55% | 38% | 6%
sample-apps0% | 0% | 62% | 29% | 8%
xraylog0% | 0% | 0% | 51% | 48%
utils0% | 0% | 0% | 0% | 100%
internal0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in xray/response_capturer.go
221 161 1
func newDBAttribute()
in xray/sql_context.go
75 21 6
func()
in strategy/sampling/centralized.go
68 14 1
func stripPasswords()
in xray/sql_context.go
67 18 1
func()
in strategy/sampling/centralized.go
63 16 1
func queryRow()
in xray/sql_context.go
63 17 4
func()
in xray/client.go
58 13 1
57 11 4
56 10 1
func BeginSubsegment()
in xray/segment.go
52 12 2
func Configure()
in xray/config.go
51 15 1
func newGlobalConfig()
in xray/config.go
48 11 0
func WildcardMatch()
in pattern/search_pattern.go
47 13 3
func processManifest()
in strategy/sampling/sampling_rule_manifest.go
47 16 1
45 10 1
func()
in xray/segment.go
43 8 1
func NewClientTrace()
in xray/httptrace.go
41 2 1
func()
in strategy/sampling/centralized.go
40 7 1
func()
in xray/sql_context.go
40 7 1
func()
in xray/sql_context.go
39 7 1