GerritCodeReview / gerrit-linter
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 55 units with 829 lines of code in units (78.8% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (176 lines of code)
    • 10 medium size units (282 lines of code)
    • 15 small units (214 lines of code)
    • 27 very small units (157 lines of code)
0% | 21% | 34% | 25% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 21% | 34% | 25% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/checker0% | 45% | 32% | 10% | 10%
ROOT0% | 0% | 65% | 25% | 9%
gerrit0% | 0% | 8% | 50% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in cmd/checker/main.go
74 22 0
func()
in cmd/checker/checker.go
51 12 1
func()
in cmd/checker/checker.go
51 9 1
func init()
in server.go
44 5 0
func()
in server.go
42 8 1
func()
in cmd/checker/checker.go
34 6 1
26 7 2
func NewGCPServiceAccount()
in cmd/checker/gcp.go
25 6 1
func()
in cmd/checker/checker.go
25 7 1
func Format()
in server.go
23 8 2
func()
in cmd/checker/gcp.go
21 5 1
func()
in cmd/checker/checker.go
21 6 1
func()
in gerrit/server.go
21 6 1
func()
in gerrit/server.go
19 5 1
func()
in gerrit/server.go
17 3 1
func()
in cmd/checker/gcp.go
16 3 1
func()
in gerrit/server.go
16 5 1
16 5 1
func()
in gerrit/server.go
15 4 1
func()
in gerrit/server.go
15 3 1