opensearch-project / opensearch-rs
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 203 units with 3,431 lines of code in units (11.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (523 lines of code)
    • 7 simple units (523 lines of code)
    • 192 very simple units (2,385 lines of code)
0% | 0% | 15% | 15% | 69%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
rs0% | 0% | 15% | 15% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
yaml_test_runner/src/step0% | 0% | 29% | 28% | 42%
api_generator/src/generator0% | 0% | 10% | 14% | 74%
yaml_test_runner/src0% | 0% | 23% | 9% | 67%
opensearch/src/http0% | 0% | 0% | 0% | 100%
opensearch/src0% | 0% | 0% | 0% | 100%
opensearch/src/root0% | 0% | 0% | 0% | 100%
opensearch0% | 0% | 0% | 0% | 100%
api_generator/src/rest_spec0% | 0% | 0% | 0% | 100%
api_generator/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
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 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 write_mod_files()
in yaml_test_runner/src/generator.rs
35 9 2
fn generate_params()
in yaml_test_runner/src/step/do.rs
236 9 4
fn generate_enum()
in yaml_test_runner/src/step/do.rs
30 8 3
fn typekind_to_ty()
in api_generator/src/generator/code_gen/mod.rs
50 8 4
fn generate_param()
in api_generator/src/generator/code_gen/params.rs
42 8 2
fn create_builder_struct_ctor_fns()
in api_generator/src/generator/code_gen/request/request_builder.rs
79 7 7
fn create_query_string_expression()
in api_generator/src/generator/code_gen/request/request_builder.rs
51 6 1
fn fn_impls()
in yaml_test_runner/src/generator.rs
105 5 4
fn generate_body()
in yaml_test_runner/src/step/do.rs
65 5 2
fn parse_version_requirements()
in yaml_test_runner/src/step/skip.rs
35 5 1
fn create_method_expression()
in api_generator/src/generator/code_gen/request/request_builder.rs
35 5 2
fn create_new_fn()
in api_generator/src/generator/code_gen/request/request_builder.rs
56 5 4
fn parts()
in api_generator/src/generator/code_gen/url/enum_builder.rs
44 5 1
fn write_test_file()
in yaml_test_runner/src/generator.rs
52 4 3
fn deserialize()
in opensearch/src/params.rs
54 4 1
fn build_meta()
in opensearch/src/http/transport.rs
20 4 0