bazelbuild / bazelisk
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 111 units with 1,478 lines of code in units (83.6% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (200 lines of code)
    • 16 medium size units (475 lines of code)
    • 32 small units (465 lines of code)
    • 60 very small units (338 lines of code)
0% | 13% | 32% | 31% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 16% | 32% | 30% | 19%
py0% | 0% | 22% | 39% | 38%
js0% | 0% | 70% | 0% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
core0% | 23% | 19% | 45% | 11%
httputil0% | 21% | 36% | 11% | 30%
repositories0% | 0% | 55% | 13% | 30%
ROOT0% | 0% | 27% | 32% | 39%
versions0% | 0% | 71% | 23% | 4%
platforms0% | 0% | 69% | 0% | 30%
runfiles0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func RunBazelisk()
in core/core.go
91 27 2
func migrate()
in core/core.go
58 9 3
func DownloadBinary()
in httputil/httputil.go
51 12 3
func Parse()
in versions/versions.go
48 15 2
func()
in repositories/github.go
39 9 1
func GetEnvOrConfig()
in core/core.go
36 9 1
func get()
in httputil/httputil.go
32 9 2
func getBazelVersion()
in core/core.go
31 8 0
func MaybeDownload()
in httputil/httputil.go
31 8 6
30 8 1
func CreateRepositories()
in core/repositories.go
29 6 6
29 4 3
func()
in repositories/gcs.go
26 8 1
func runBazel()
in core/core.go
26 5 3
26 3 0
25 9 0
func DetermineBazelFilename()
in platforms/platforms.go
23 5 2
func()
in repositories/gcs.go
23 8 1
func tryFindNetrcFileCreds()
in httputil/httputil.go
21 4 1
func linkLocalBazel()
in core/core.go
19 5 2