opensearch-project / opensearch-benchmark-workloads
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 35 units with 514 lines of code in units (80.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (71 lines of code)
    • 8 medium size units (253 lines of code)
    • 8 small units (100 lines of code)
    • 18 very small units (90 lines of code)
0% | 13% | 49% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 49% | 19% | 17%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
noaa/_tools0% | 47% | 42% | 0% | 9%
nested0% | 0% | 73% | 20% | 5%
geonames0% | 0% | 65% | 18% | 15%
nyc_taxis/_tools0% | 0% | 58% | 36% | 4%
http_logs0% | 0% | 0% | 53% | 46%
geopointshape/_tools0% | 0% | 0% | 100% | 0%
nyc_taxis0% | 0% | 0% | 0% | 100%
geoshape/_tools0% | 0% | 0% | 0% | 100%
pmc0% | 0% | 0% | 0% | 100%
http_logs/_tools0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def processWeatherDoc()
in noaa/_tools/process.py
71 29 1
def to_json()
in nyc_taxis/_tools/parse.py
38 16 1
def loadStationsFile()
in noaa/_tools/process.py
38 8 3
def params()
in nested/workload.py
36 2 1
def params()
in nested/workload.py
32 2 1
def params()
in geonames/workload.py
29 2 1
def params()
in geonames/workload.py
29 2 1
def processWeatherFile()
in noaa/_tools/process.py
26 5 2
def params()
in nested/workload.py
25 2 1
def params()
in geonames/workload.py
16 2 1
def params()
in nested/workload.py
14 2 1
def write_mappings()
in nyc_taxis/_tools/parse.py
13 4 0
def register()
in http_logs/workload.py
12 4 1
def __init__()
in nested/workload.py
12 2 4
def _replace_field()
in http_logs/workload.py
11 7 3
def to_geo_point()
in nyc_taxis/_tools/parse.py
11 7 2
def to_json()
in geopointshape/_tools/parse.py
11 4 1
def to_json()
in geoshape/_tools/parse.py
10 4 1
def on_after_load_workload()
in http_logs/workload.py
9 4 2
def on_prepare_workload()
in http_logs/workload.py
8 2 3