opensearch-project / opensearch-dsl-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 409 units with 2,460 lines of code in units (67.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 14 medium size units (364 lines of code)
    • 41 small units (599 lines of code)
    • 354 very small units (1,497 lines of code)
0% | 0% | 14% | 24% | 60%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 14% | 24% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
opensearch_dsl0% | 0% | 15% | 21% | 62%
utils0% | 0% | 26% | 60% | 12%
opensearch_dsl/response0% | 0% | 0% | 19% | 80%
ROOT0% | 0% | 0% | 74% | 25%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def A()
in opensearch_dsl/aggs.py
34 10 3
def save()
in opensearch_dsl/index.py
34 16 2
def test_dist()
in utils/build-dists.py
33 6 1
def update_from_dict()
in opensearch_dsl/search.py
29 12 2
def __and__()
in opensearch_dsl/query.py
27 12 2
def __getattr__()
in opensearch_dsl/utils.py
26 10 2
def SF()
in opensearch_dsl/function.py
26 11 2
def get_analysis_definition()
in opensearch_dsl/analysis.py
25 12 1
def to_dict()
in opensearch_dsl/search.py
23 12 3
def construct_field()
in opensearch_dsl/field.py
23 7 2
def simulate()
in opensearch_dsl/analysis.py
21 7 5
def _collect_analysis()
in opensearch_dsl/mapping.py
21 7 1
def to_dict()
in opensearch_dsl/utils.py
21 15 1
def merge()
in opensearch_dsl/utils.py
21 10 3
def Q()
in opensearch_dsl/query.py
20 7 2
def __or__()
in opensearch_dsl/query.py
20 7 2
def _setattr()
in opensearch_dsl/utils.py
20 13 3
def main()
in utils/license-headers.py
20 6 0
def __init__()
in opensearch_dsl/search.py
18 7 5
def _get_result()
in opensearch_dsl/search.py
18 7 3