bazelbuild / bazel-watcher
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 213 units with 2,170 lines of code in units (75.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (121 lines of code)
    • 27 medium size units (775 lines of code)
    • 42 small units (603 lines of code)
    • 142 very small units (671 lines of code)
0% | 5% | 35% | 27% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 5% | 33% | 28% | 32%
js0% | 0% | 68% | 23% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
example_client0% | 86% | 0% | 13% | 0%
ibazel0% | 9% | 48% | 19% | 22%
ibazel/profiler0% | 0% | 26% | 50% | 23%
ibazel/output_runner0% | 0% | 63% | 20% | 16%
release/npm0% | 0% | 87% | 0% | 12%
ibazel/command0% | 0% | 29% | 36% | 34%
ibazel/fswatcher0% | 0% | 42% | 28% | 28%
bazel0% | 0% | 23% | 49% | 26%
ibazel/workspace0% | 0% | 91% | 0% | 8%
ibazel/process_group0% | 0% | 25% | 16% | 57%
ibazel/live_reload0% | 0% | 26% | 16% | 56%
bazel/testing0% | 0% | 0% | 22% | 77%
ibazel/log0% | 0% | 0% | 25% | 75%
ibazel/lifecycle_hooks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in example_client/example_client.go
70 8 0
func()
in ibazel/ibazel.go
51 20 1
function getNativeBinary()
in release/npm/index.js
44 7 0
(function()()
in ibazel/profiler/profiler.js
44 3 1
func()
in ibazel/ibazel.go
42 9 1
func()
in ibazel/process_group/process_group_windows.go
39 9 1
func()
in ibazel/ibazel_unix.go
36 10 1
func main()
in release/npm/generate_package.go
34 7 0
func()
in ibazel/ibazel.go
34 7 1
func New()
in ibazel/ibazel.go
33 4 0
func()
in ibazel/command/notify_command.go
31 6 1
func()
in bazel/bazel.go
30 8 1
func main()
in ibazel/main.go
30 6 0
func()
in ibazel/output_runner/output_runner.go
29 6 1
func()
in ibazel/fswatcher/fsnotify/fsnotify.go
28 7 1
func newEvent()
in ibazel/fswatcher/fsevents/fsevents.go
25 9 2
func()
in ibazel/profiler/profiler.go
25 9 1
func()
in ibazel/output_runner/output_runner.go
25 7 1
func matchRegex()
in ibazel/output_runner/output_runner.go
25 6 2
func()
in ibazel/ibazel.go
24 6 1