bazelbuild / continuous-integration
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 751 units with 10,028 lines of code in units (51.3% of code).
    • 3 very long units (357 lines of code)
    • 16 long units (1,008 lines of code)
    • 130 medium size units (3,898 lines of code)
    • 174 small units (2,648 lines of code)
    • 428 very small units (2,117 lines of code)
3% | 10% | 38% | 26% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx24% | 18% | 33% | 11% | 11%
py3% | 7% | 45% | 23% | 20%
java0% | 11% | 34% | 36% | 18%
go0% | 8% | 34% | 27% | 28%
rs0% | 23% | 35% | 20% | 20%
ts0% | 0% | 25% | 60% | 15%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dashboard6% | 12% | 33% | 30% | 16%
buildkite3% | 6% | 46% | 22% | 20%
metrics0% | 7% | 33% | 27% | 31%
agent0% | 23% | 35% | 20% | 20%
buildifier0% | 35% | 11% | 31% | 20%
pipegen0% | 16% | 25% | 37% | 19%
pipestats0% | 0% | 68% | 17% | 13%
rbe-configs0% | 0% | 60% | 16% | 23%
docgen0% | 0% | 58% | 20% | 20%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in buildkite/bazelci.py
134 14 1
function ListItem()
in dashboard/client/src/GithubIssueList.tsx
121 5 1
function GithubIssueListFooter()
in dashboard/client/src/GithubIssueList.tsx
102 3 1
func main()
in metrics/main.go
92 13 0
def main()
in buildkite/culprit_finder.py
81 15 1
public Single fetchAndSave()
in dashboard/server/src/main/java/build/bazel/dashboard/github/issue/GithubIssueService.java
79 6 3
fn watch_bep_json_file()
in agent/src/artifact/upload.rs
67 13 6
function FilterPopover()
in dashboard/client/src/GithubIssueList.tsx
66 2 1
def main()
in buildkite/bazel-bench/bazel_bench.py
65 10 1
def main()
in buildifier/buildifier.py
63 8 1
private static QuerySpec buildQuerySpec()
in dashboard/server/src/main/java/build/bazel/dashboard/github/issuelist/GithubIssueListRepoPg.java
59 12 1
func collectPipelineResults()
in metrics/metrics/platform_significance.go
57 18 1
func convertPipeline()
in pipegen/config/config.go
56 4 1
public Maybe fetchCountResult()
in dashboard/server/src/main/java/build/bazel/dashboard/github/issuequery/task/GithubIssueQueryCountTaskRestController.java
55 3 1
def _ci_step_for_platform_and_commits()
in buildkite/bazel-bench/bazel_bench.py
55 3 7
def worker()
in buildkite/create_instances.py
55 15 0
private Maybe buildIssueListItem()
in dashboard/server/src/main/java/build/bazel/dashboard/github/notification/NotificationTask.java
54 8 1
export default function RepoDashboard()
in dashboard/client/src/RepoDashboard.tsx
53 4 2
function GithubIssueListBody()
in dashboard/client/src/GithubIssueList.tsx
51 6 1
public Maybe findOne()
in dashboard/server/src/main/java/build/bazel/dashboard/github/teamtable/GithubTeamTableRepoPg.java
50 1 3