bazelbuild / bazel-bench
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 88 units with 1,145 lines of code in units (78.7% of code).
    • 1 very long units (109 lines of code)
    • 2 long units (136 lines of code)
    • 16 medium size units (495 lines of code)
    • 10 small units (153 lines of code)
    • 59 very small units (252 lines of code)
9% | 11% | 43% | 13% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 11% | 43% | 13% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
report23% | 0% | 42% | 10% | 23%
ROOT0% | 39% | 40% | 8% | 10%
utils0% | 0% | 48% | 22% | 29%
testutils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _generate_report_for_date()
in report/generate_report.py
109 5 7
def main()
in benchmark.py
76 17 1
def create_summary()
in benchmark.py
60 9 2
def _prepare_data_for_graph()
in report/generate_report.py
46 5 2
def _generate_report_for_date()
in report/generate_master_report.py
45 5 6
def main()
in report/generate_report.py
40 4 1
def _run_benchmark()
in benchmark.py
40 6 14
33 5 1
def _prepare_time_series_data()
in report/generate_master_report.py
32 6 1
def main()
in report/generate_master_report.py
32 3 1
def _accumulate_event_duration()
in utils/json_profiles_merger_lib.py
31 11 3
def from_flags()
in utils/benchmark_config.py
28 5 9
def export_csv()
in utils/output_handling.py
27 4 3
def _parse_unit()
in utils/benchmark_config.py
26 10 2
25 6 7
def command()
in utils/bazel.py
25 6 3
22 6 4
def upload_to_bigquery()
in utils/bigquery_upload.py
22 3 5
def _single_run()
in benchmark.py
21 4 5
def _get_proportion_breakdown()
in report/generate_report.py
19 6 1