golang / freetype
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 179 units with 4,472 lines of code in units (83.3% of code).
    • 3 very long units (1,233 lines of code)
    • 19 long units (1,251 lines of code)
    • 36 medium size units (1,117 lines of code)
    • 27 small units (391 lines of code)
    • 94 very small units (480 lines of code)
27% | 27% | 24% | 8% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go28% | 26% | 25% | 8% | 10%
c0% | 96% | 0% | 0% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
truetype49% | 17% | 17% | 8% | 7%
raster0% | 33% | 40% | 8% | 17%
example/genbasicfont0% | 42% | 12% | 22% | 22%
cmd/print-glyph-points0% | 96% | 0% | 0% | 4%
example/drawer0% | 100% | 0% | 0% | 0%
example/freetype0% | 100% | 0% | 0% | 0%
ROOT0% | 29% | 26% | 16% | 27%
example/round0% | 92% | 0% | 0% | 7%
example/capjoin0% | 100% | 0% | 0% | 0%
example/raster0% | 0% | 91% | 0% | 8%
example/gamma0% | 0% | 88% | 0% | 11%
example/truetype0% | 0% | 65% | 29% | 5%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in truetype/hint.go
1007 303 1
func()
in truetype/glyph.go
125 27 1
func parse()
in truetype/truetype.go
101 33 2
func()
in truetype/hint.go
86 19 1
func()
in raster/raster.go
85 11 1
func()
in truetype/glyph.go
78 16 1
func main()
in example/genbasicfont/main.go
77 10 0
func()
in truetype/glyph.go
74 19 1
int main()
in cmd/print-glyph-points/main.c
72 14 2
func()
in truetype/truetype.go
72 15 1
func main()
in example/drawer/main.go
71 10 0
func()
in truetype/glyph.go
65 14 1
func main()
in example/freetype/main.go
65 11 0
func()
in raster/raster.go
61 9 1
func()
in truetype/face.go
59 9 1
func main()
in example/round/main.go
59 7 0
func()
in freetype.go
59 9 1
func()
in raster/raster.go
57 6 1
func addArc()
in raster/stroke.go
54 9 4
func()
in raster/stroke.go
53 7 1