opensearch-project / opensearch-rs
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 203 units with 3,431 lines of code in units (11.5% of code).
    • 5 very long units (795 lines of code)
    • 12 long units (821 lines of code)
    • 26 medium size units (841 lines of code)
    • 25 small units (352 lines of code)
    • 135 very small units (622 lines of code)
23% | 23% | 24% | 10% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs23% | 23% | 24% | 10% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
yaml_test_runner/src/step43% | 17% | 26% | 4% | 7%
api_generator/src/generator18% | 26% | 30% | 10% | 13%
yaml_test_runner/src28% | 37% | 16% | 13% | 4%
opensearch/src/root0% | 42% | 28% | 15% | 13%
opensearch/src0% | 26% | 0% | 6% | 66%
opensearch0% | 0% | 100% | 0% | 0%
opensearch/src/http0% | 0% | 0% | 23% | 76%
api_generator/src/rest_spec0% | 0% | 0% | 100% | 0%
api_generator/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn generate_params()
in yaml_test_runner/src/step/do.rs
236 9 4
fn generate_parts()
in yaml_test_runner/src/step/do.rs
177 15 4
fn create_builder_struct()
in api_generator/src/generator/code_gen/request/request_builder.rs
160 12 5
fn generate_parts_enum_from_endpoint()
in api_generator/src/generator/code_gen/url/enum_builder.rs
117 1 0
fn fn_impls()
in yaml_test_runner/src/generator.rs
105 5 4
fn to_tokens()
in yaml_test_runner/src/step/match.rs
100 11 2
fn main()
in yaml_test_runner/src/main.rs
86 11 0
fn create_builder_struct_ctor_fns()
in api_generator/src/generator/code_gen/request/request_builder.rs
79 7 7
fn create_body_fn()
in api_generator/src/generator/code_gen/request/request_builder.rs
77 3 4
fn create_impl_fn()
in api_generator/src/generator/code_gen/request/request_builder.rs
75 3 2
67 1 0
fn generate_body()
in yaml_test_runner/src/step/do.rs
65 5 2
fn let_parameters_exprs()
in api_generator/src/generator/code_gen/url/url_builder.rs
59 3 2
fn create_new_fn()
in api_generator/src/generator/code_gen/request/request_builder.rs
56 5 4
fn deserialize()
in opensearch/src/params.rs
54 4 1
fn write_test_file()
in yaml_test_runner/src/generator.rs
52 4 3
fn create_query_string_expression()
in api_generator/src/generator/code_gen/request/request_builder.rs
51 6 1
fn typekind_to_ty()
in api_generator/src/generator/code_gen/mod.rs
50 8 4
45 1 0
fn parts()
in api_generator/src/generator/code_gen/url/enum_builder.rs
44 5 1