opensearch-project / opensearch-py
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 597 units with 6,627 lines of code in units (42.2% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (393 lines of code)
    • 93 medium size units (2,297 lines of code)
    • 149 small units (2,391 lines of code)
    • 349 very small units (1,546 lines of code)
0% | 5% | 34% | 36% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 14% | 26% | 49%
pyi0% | 4% | 48% | 42% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
utils0% | 33% | 25% | 24% | 16%
opensearchpy/client0% | 3% | 40% | 37% | 19%
opensearchpy0% | 11% | 27% | 19% | 40%
opensearchpy/helpers0% | 0% | 23% | 41% | 34%
opensearchpy/connection0% | 0% | 8% | 45% | 46%
opensearchpy/_async0% | 0% | 0% | 57% | 42%
ROOT0% | 0% | 0% | 44% | 55%
opensearchpy/_async/client0% | 0% | 0% | 42% | 57%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def test_dist()
in utils/build-dists.py
89 13 1
def main()
in utils/build-dists.py
79 3 0
pyi
def search()
in opensearchpy/client/__init__.pyi
61 1 0
def default()
in opensearchpy/serializer.py
60 21 2
pyi
def update_by_query()
in opensearchpy/client/__init__.pyi
53 1 0
pyi
def delete_by_query()
in opensearchpy/client/__init__.pyi
51 1 0
def expand_action()
in opensearchpy/helpers/actions.py
50 10 1
def perform_request()
in opensearchpy/transport.py
47 16 6
def query_params()
in opensearchpy/client/utils.py
34 15 1
def __init__()
in utils/generate-api.py
33 10 5
pyi
def count()
in opensearchpy/client/__init__.pyi
32 1 0
pyi
def explain()
in opensearchpy/client/__init__.pyi
31 1 0
pyi
def search_template()
in opensearchpy/client/__init__.pyi
31 1 0
pyi
def update()
in opensearchpy/client/__init__.pyi
31 1 0
pyi
def validate_query()
in opensearchpy/client/indices.pyi
30 1 0
pyi
def index()
in opensearchpy/client/__init__.pyi
30 1 0
pyi
def mtermvectors()
in opensearchpy/client/__init__.pyi
30 1 0
pyi
def termvectors()
in opensearchpy/client/__init__.pyi
30 1 0
def dump_modules()
in utils/generate-api.py
29 6 1
def _normalize_hosts()
in opensearchpy/client/utils.py
28 14 1