bazelbuild / bazel-toolchains
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 54 units with 1,165 lines of code in units (63.7% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (322 lines of code)
    • 13 medium size units (434 lines of code)
    • 18 small units (268 lines of code)
    • 18 very small units (141 lines of code)
0% | 27% | 37% | 23% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 27% | 37% | 23% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/rbeconfigsgen0% | 35% | 31% | 21% | 11%
pkg/monitoring0% | 32% | 28% | 20% | 18%
cmd/rbe_configs_gen0% | 0% | 76% | 23% | 0%
cmd/rbe_configs_upload0% | 0% | 42% | 35% | 21%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func genCppConfigs()
in pkg/rbeconfigsgen/rbeconfigsgen.go
83 16 3
func()
in pkg/rbeconfigsgen/options.go
69 22 1
func genJavaConfigs()
in pkg/rbeconfigsgen/rbeconfigsgen.go
61 14 2
func Run()
in pkg/rbeconfigsgen/rbeconfigsgen.go
55 13 1
func()
in pkg/monitoring/monitoring.go
54 3 1
func printFlags()
in cmd/rbe_configs_gen/rbe_configs_gen.go
49 15 0
func()
in pkg/monitoring/monitoring.go
48 3 1
func main()
in cmd/rbe_configs_gen/rbe_configs_gen.go
42 6 0
func copyCppConfigsToTarball()
in pkg/rbeconfigsgen/rbeconfigsgen.go
38 10 2
func copyCppConfigsToOutputDir()
in pkg/rbeconfigsgen/rbeconfigsgen.go
35 9 2
func newDockerRunner()
in pkg/rbeconfigsgen/rbeconfigsgen.go
34 7 2
func main()
in cmd/rbe_configs_upload/rbe_configs_upload.go
30 8 0
func assembleConfigTarball()
in pkg/rbeconfigsgen/rbeconfigsgen.go
28 9 2
func()
in pkg/rbeconfigsgen/rbeconfigsgen.go
27 7 1
func installBazelisk()
in pkg/rbeconfigsgen/rbeconfigsgen.go
27 7 3
func createManifest()
in pkg/rbeconfigsgen/rbeconfigsgen.go
27 6 1
func uploadConfigs()
in cmd/rbe_configs_upload/rbe_configs_upload.go
25 6 2
func copyConfigsToOutputDir()
in pkg/rbeconfigsgen/rbeconfigsgen.go
24 8 2
func appendCppEnv()
in pkg/rbeconfigsgen/rbeconfigsgen.go
20 6 2
func genConfigBuild()
in pkg/rbeconfigsgen/rbeconfigsgen.go
20 4 1