microsoft / onnxruntime
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 14,497 units with 223,486 lines of code in units (47.1% of code).
    • 24 very complex units (12,095 lines of code)
    • 147 complex units (17,983 lines of code)
    • 802 medium complex units (50,343 lines of code)
    • 1,196 simple units (38,521 lines of code)
    • 12,328 very simple units (104,544 lines of code)
5% | 8% | 22% | 17% | 46%
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
cc7% | 8% | 25% | 18% | 39%
h4% | 8% | 9% | 11% | 66%
py2% | 10% | 26% | 17% | 43%
cpp<1% | 2% | 15% | 19% | 61%
ts0% | 6% | 15% | 16% | 61%
java0% | 0% | 32% | 15% | 51%
cs0% | 0% | 11% | 10% | 78%
c0% | 0% | 33% | 8% | 58%
hpp0% | 0% | 0% | 7% | 92%
mm0% | 0% | 0% | 0% | 100%
tsx0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
onnxruntime4% | 8% | 24% | 18% | 43%
orttraining9% | 7% | 21% | 16% | 45%
tools12% | 9% | 21% | 19% | 36%
winml5% | 5% | 7% | 10% | 71%
js0% | 6% | 17% | 17% | 59%
server0% | 13% | 18% | 25% | 42%
java0% | 0% | 34% | 11% | 53%
csharp0% | 0% | 11% | 10% | 78%
include0% | 0% | 4% | 7% | 87%
ROOT0% | 0% | 44% | 12% | 42%
objectivec0% | 0% | 0% | 0% | 100%
cgmanifests0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def generate_build_tree()
in tools/ci_build/build.py
339 199 19
auto OperatorTypeVisitor()
in onnxruntime/core/providers/dml/DmlExecutionProvider/src/External/DirectMLHelpers/ApiTraits.h
321 159 3
inline AbstractOperatorDesc ConvertOperatorDesc()
in onnxruntime/core/providers/dml/DmlExecutionProvider/src/External/DirectMLHelpers/GeneratedSchemaHelpers.h
636 157 1
common::Status TensorrtExecutionProvider::Compile()
in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc
772 157 2
inline gsl::czstring ToString()
in onnxruntime/core/providers/dml/DmlExecutionProvider/src/External/DirectMLHelpers/ApiTraits.h
146 138 1
void DataOps::populate_op_mode_supported()
in onnxruntime/core/providers/openvino/ov_versions/data_ops.cc
725 137 0
void RegisterContribSchemas()
in onnxruntime/core/graph/contrib_ops/contrib_defs.cc
1994 136 0
void RegisterTrainingOpSchemas()
in orttraining/orttraining/core/graph/training_op_defs.cc
2627 115 0
std::unique_ptr CreateExecutionProviderInstance()
in onnxruntime/python/onnxruntime_pybind_state.cc
372 113 3
Status LayerNormFusion::ApplyImpl()
in onnxruntime/core/optimizer/layer_norm_fusion.cc
219 85 4
std::pair OnnxConverter::IsNodeSupported()
in onnxruntime/core/providers/rknpu/onnx_converter.cc
216 78 2
132 76 2
230 74 3
static bool IsUnsupportedOpMode()
in onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc
230 70 3
def main()
in tools/ci_build/build.py
292 64 0
Status SimplifiedLayerNormFusion::ApplyImpl()
in onnxruntime/core/optimizer/layer_norm_fusion.cc
197 61 4
Status MegatronTransformer::TransformBARTAttention()
in orttraining/orttraining/core/optimizer/megatron_transformer.cc
307 59 6
void RegisterQuantizationSchemas()
in onnxruntime/core/graph/contrib_ops/quantization_defs.cc
806 56 0
Status PartialExecutor::Execute()
in onnxruntime/core/framework/orttraining_partial_executor.cc
311 53 7
Status SequentialExecutor::Execute()
in onnxruntime/core/framework/sequential_executor.cc
300 53 7