golang / tour
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 7 units with 107 lines of code in units (69.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (44 lines of code)
    • 4 small units (56 lines of code)
    • 1 very small units (7 lines of code)
0% | 0% | 41% | 52% | 6%
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% | 41% | 52% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
reader0% | 0% | 100% | 0% | 0%
wc0% | 0% | 100% | 0% | 0%
pic0% | 0% | 0% | 100% | 0%
tree0% | 0% | 0% | 78% | 21%
Alternative Visuals
Longest Units
Top 7 longest units
Unit# linesMcCabe index# params
func Validate()
in reader/validate.go
23 7 1
func Test()
in wc/wc.go
21 6 1
func Show()
in pic/pic.go
19 3 2
func()
in tree/tree.go
14 4 1
func ShowImage()
in pic/pic.go
12 2 1
func insert()
in tree/tree.go
11 3 2
func New()
in tree/tree.go
7 2 1