opensearch-project / opensearch-benchmark
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 1,558 units with 14,220 lines of code in units (84.7% of code).
    • 8 very long units (1,573 lines of code)
    • 22 long units (1,573 lines of code)
    • 114 medium size units (3,300 lines of code)
    • 186 small units (2,752 lines of code)
    • 1,228 very small units (5,022 lines of code)
11% | 11% | 23% | 19% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 11% | 23% | 19% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
osbenchmark25% | 14% | 21% | 13% | 25%
osbenchmark/workload0% | 17% | 19% | 24% | 38%
osbenchmark/builder0% | 7% | 26% | 27% | 38%
osbenchmark/worker_coordinator0% | 7% | 29% | 14% | 49%
osbenchmark/utils0% | 0% | 15% | 25% | 59%
scripts0% | 0% | 70% | 0% | 29%
opensearch-benchmark-provisionconfigs/1.00% | 0% | 46% | 41% | 11%
opensearch-benchmark-provisionconfigs/main0% | 0% | 46% | 41% | 11%
osbenchmark/tracker0% | 0% | 18% | 54% | 26%
it0% | 0% | 0% | 23% | 76%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_arg_parser()
in osbenchmark/benchmark.py
510 23 0
def gc()
in osbenchmark/chart_generator.py
178 1 3
def io()
in osbenchmark/chart_generator.py
175 1 3
def index()
in osbenchmark/chart_generator.py
170 3 3
def query()
in osbenchmark/chart_generator.py
158 1 3
def query()
in osbenchmark/chart_generator.py
156 1 3
def dispatch_sub_command()
in osbenchmark/benchmark.py
113 19 3
def segment_memory()
in osbenchmark/chart_generator.py
113 1 3
def _create_corpora()
in osbenchmark/workload/loader.py
90 27 4
def gc()
in osbenchmark/chart_generator.py
90 1 3
def merge_time()
in osbenchmark/chart_generator.py
90 1 3
def io()
in osbenchmark/chart_generator.py
90 1 3
def index()
in osbenchmark/chart_generator.py
90 3 3
def create()
in osbenchmark/builder/supplier.py
87 16 5
def merge_count()
in osbenchmark/chart_generator.py
84 1 3
def from_hyphenated_string()
in osbenchmark/workload/workload.py
83 41 2
def read()
in osbenchmark/workload/loader.py
79 14 4
def __init__()
in osbenchmark/client.py
72 20 3
def _publish_total_times()
in osbenchmark/results_publisher.py
68 1 3
def __call__()
in osbenchmark/metrics.py
65 6 1