opensearch-project / opensearch-ruby
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 506 units with 4,785 lines of code in units (19.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (76 lines of code)
    • 35 medium size units (932 lines of code)
    • 151 small units (2,125 lines of code)
    • 319 very small units (1,652 lines of code)
0% | 1% | 19% | 44% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 1% | 19% | 44% | 34%
rake0% | 0% | 0% | 65% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
opensearch-transport/lib0% | 9% | 22% | 21% | 47%
opensearch-api/lib0% | 0% | 16% | 63% | 19%
profile/benchmarking0% | 0% | 53% | 8% | 38%
opensearch-dsl/lib0% | 0% | 6% | 27% | 65%
opensearch/lib0% | 0% | 0% | 62% | 37%
opensearch-api/spec0% | 0% | 0% | 100% | 0%
rake_tasks0% | 0% | 0% | 65% | 35%
profile0% | 0% | 0% | 100% | 0%
opensearch-transport/spec0% | 0% | 0% | 0% | 100%
opensearch/spec0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
perform_request
in opensearch-transport/lib/opensearch/transport/transport/base.rb
76 33 7
__parse_host
in opensearch-transport/lib/opensearch/transport/client.rb
43 11 1
initialize
in opensearch-transport/lib/opensearch/transport/client.rb
41 25 2
msearch
in opensearch-api/lib/opensearch/api/actions/msearch.rb
39 11 1
search_document_small
in profile/benchmarking/simple.rb
34 2 1
stored_fields
in opensearch-dsl/lib/opensearch/dsl/search.rb
34 7 1
__report_unsupported_parameters
in opensearch-api/lib/opensearch/api/utils.rb
33 8 2
search_document_large
in profile/benchmarking/simple.rb
33 2 1
update_document
in profile/benchmarking/simple.rb
32 2 1
search_documents
in profile/benchmarking/complex.rb
29 1 1
msearch_template
in opensearch-api/lib/opensearch/api/actions/msearch_template.rb
28 8 1
get_document_large
in profile/benchmarking/simple.rb
27 1 1
perform_request
in opensearch-transport/lib/opensearch/transport/transport/http/curb.rb
27 6 6
mtermvectors
in opensearch-api/lib/opensearch/api/actions/mtermvectors.rb
26 7 1
termvectors
in opensearch-api/lib/opensearch/api/actions/termvectors.rb
26 12 1
index_document_small
in profile/benchmarking/simple.rb
26 1 1
index_document_large
in profile/benchmarking/simple.rb
26 1 1
get_document_small
in profile/benchmarking/simple.rb
26 1 1
index_documents
in profile/benchmarking/complex.rb
26 1 1
bulk
in opensearch-api/lib/opensearch/api/actions/bulk.rb
24 7 1