tensorflow / rust
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 4,250 units with 60,434 lines of code in units (37.7% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (445 lines of code)
    • 61 medium complex units (3,535 lines of code)
    • 423 simple units (13,411 lines of code)
    • 3,762 very simple units (43,043 lines of code)
0% | <1% | 5% | 22% | 71%
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% | <1% | 5% | 22% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/protos0% | 1% | 8% | 11% | 77%
tensorflow-op-codegen/src0% | 2% | 7% | 11% | 78%
src/ops0% | 0% | 4% | 31% | 63%
tensorflow-sys0% | 0% | 51% | 23% | 24%
src0% | 0% | 0% | <1% | 99%
tensorflow-sys/src0% | 0% | 0% | 0% | 100%
src/eager0% | 0% | 0% | 0% | 100%
tensorflow-internal-macros/src0% | 0% | 0% | 0% | 100%
tensorflow-proto-codegen/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fn compute_size()
in src/protos/rewriter_config.rs
110 34 1
fn write_to_with_cached_sizes()
in src/protos/rewriter_config.rs
113 34 2
fn write_to_with_cached_sizes()
in tensorflow-op-codegen/src/protos/tensor.rs
111 28 2
fn write_to_with_cached_sizes()
in src/protos/tensor.rs
111 28 2
fn is_initialized()
in src/protos/saved_object_graph.rs
53 21 1
fn compute_size()
in src/protos/config.rs
64 20 1
fn write_to_with_cached_sizes()
in src/protos/config.rs
63 20 2
fn is_initialized()
in src/protos/struct_pb.rs
48 19 1
fn compute_size()
in tensorflow-op-codegen/src/protos/tensor.rs
60 18 1
fn build_impl()
in src/ops/ops_impl.rs
63 18 4
fn compute_size()
in src/protos/step_stats.rs
61 18 1
fn write_to_with_cached_sizes()
in src/protos/step_stats.rs
63 18 2
fn compute_size()
in src/protos/tensor.rs
60 18 1
fn build_impl()
in src/ops/ops_impl.rs
64 17 5
fn compute_size()
in src/protos/config.rs
61 17 1
fn write_to_with_cached_sizes()
in src/protos/config.rs
65 17 2
fn compute_size()
in src/protos/cost_graph.rs
56 17 1
fn write_to_with_cached_sizes()
in src/protos/cost_graph.rs
56 17 2
fn merge_from()
in src/protos/config.rs
124 16 2
fn merge_from()
in src/protos/struct_pb.rs
95 16 2