pytorch / nestedtensor
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 436 units with 6,062 lines of code in units (58.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 24 medium complex units (1,593 lines of code)
    • 41 simple units (1,283 lines of code)
    • 371 very simple units (3,186 lines of code)
0% | 0% | 26% | 21% | 52%
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
cpp0% | 0% | 37% | 20% | 41%
py0% | 0% | 15% | 26% | 58%
h0% | 0% | 7% | 14% | 77%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
nestedtensor/csrc0% | 0% | 34% | 19% | 45%
nestedtensor/csrc/utils0% | 0% | 35% | 4% | 60%
nestedtensor/nested0% | 0% | 22% | 24% | 52%
ROOT0% | 0% | 70% | 0% | 29%
benchmarks0% | 0% | 4% | 26% | 69%
nestedtensor/csrc/scripts0% | 0% | 44% | 0% | 56%
nestedtensor/csrc/storage0% | 0% | 0% | 23% | 76%
nestedtensor/nn0% | 0% | 0% | 100% | 0%
nestedtensor/csrc/cuda0% | 0% | 0% | 41% | 58%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Tensor NestedTensor_add_Tensor()
in nestedtensor/csrc/BinaryOps.cpp
103 25 3
bool _verify_variables()
in nestedtensor/csrc/creation.cpp
102 25 7
Tensor NestedTensor_conv2d()
in nestedtensor/csrc/conv2d.cpp
88 24 7
Tensor NestedTensor_cudnn_convolution_relu()
in nestedtensor/csrc/conv2d.cpp
88 24 7
c10::optional nt_from_tensor_mask()
in nestedtensor/csrc/masking.cpp
67 24 3
Tensor NestedTensor_batch_norm()
in nestedtensor/csrc/autograd_functions.cpp
121 21 9
def fuse_conv_relu()
in nestedtensor/nested/fuser.py
45 19 2
def _nn_functional_embedding_bag()
in nestedtensor/nested/nested.py
64 19 11
void add_functions()
in nestedtensor/csrc/python_functions.cpp
145 16 1
Tensor NestedTensor_mul_Tensor()
in nestedtensor/csrc/BinaryOps.cpp
59 15 2
Tensor NestedTensor_sub_Tensor()
in nestedtensor/csrc/BinaryOps.cpp
64 15 3
at::Tensor get_item()
in nestedtensor/csrc/py_init.cpp
52 15 2
57 14 0
at::Tensor interpolate()
in nestedtensor/csrc/python_functions.cpp
64 14 5
def create_template_map()
in nestedtensor/csrc/scripts/binaryops.py
33 14 1
def run()
in benchmarks/segmentation_layers.py
42 13 1
Tensor NestedTensor_slice()
in nestedtensor/csrc/nested_tensor_impl.cpp
57 13 5
void register_python_nested_node()
in nestedtensor/csrc/utils/python_nested_node.cpp
71 12 1
std::tuple to_tensor_mask()
in nestedtensor/csrc/masking.cpp
59 12 2
Tensor to_padded_tensor()
in nestedtensor/csrc/masking.cpp
79 12 2