golang / geo
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 1,180 units with 9,846 lines of code in units (89.8% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (437 lines of code)
    • 100 medium size units (2,816 lines of code)
    • 183 small units (2,610 lines of code)
    • 890 very small units (3,983 lines of code)
0% | 4% | 28% | 26% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 4% | 28% | 26% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
s20% | 4% | 30% | 26% | 38%
s10% | 0% | 21% | 33% | 44%
r30% | 0% | 10% | 31% | 58%
r20% | 0% | 0% | 19% | 80%
r10% | 0% | 0% | 13% | 86%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in s2/shapeindex.go
79 27 1
func()
in s2/shapeindex.go
74 19 1
func()
in s2/shapeindex.go
64 19 1
func()
in s2/edge_query.go
60 16 1
func()
in s2/cell_index.go
57 9 1
func()
in s2/regioncoverer.go
52 16 1
51 13 4
func()
in s2/rect.go
47 16 1
func()
in s2/rect_bounder.go
46 10 1
func()
in s2/polygon.go
46 14 1
func()
in s2/cell.go
45 11 1
43 12 3
func()
in s2/regioncoverer.go
42 16 1
func()
in s2/contains_point_query.go
40 14 1
func()
in s2/edge_query.go
40 13 1
func()
in s2/cell.go
40 13 1
39 10 2
func decodePointsCompressed()
in s2/pointcompression.go
39 10 3
func()
in s2/convex_hull_query.go
38 8 1
37 11 1