pytorch / glow
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,331 units with 87,839 lines of code in units (64.5% of code).
    • 23 very complex units (10,029 lines of code)
    • 28 complex units (4,424 lines of code)
    • 271 medium complex units (17,653 lines of code)
    • 469 simple units (17,428 lines of code)
    • 3,540 very simple units (38,305 lines of code)
11% | 5% | 20% | 19% | 43%
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
cpp12% | 5% | 21% | 20% | 40%
h6% | 1% | 10% | 9% | 72%
py0% | 0% | 9% | 21% | 69%
c0% | 0% | 36% | 42% | 20%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/LLVMIRCodeGen33% | 1% | 16% | 18% | 30%
lib/Backends14% | 6% | 22% | 22% | 34%
lib/Importer23% | 5% | 20% | 21% | 29%
lib/Runtime34% | 0% | 16% | 19% | 29%
lib/Optimizer6% | 6% | 32% | 23% | 31%
tools/loader16% | 0% | 23% | 23% | 36%
lib/Graph4% | 7% | 7% | 12% | 66%
torch_glow/src2% | 5% | 13% | 24% | 54%
include/glow3% | 1% | 12% | 7% | 73%
lib/Base4% | 0% | 45% | 19% | 30%
lib/IR0% | 31% | 11% | 12% | 44%
lib/Partitioner0% | 17% | 31% | 28% | 21%
lib/Onnxifi0% | 30% | 24% | 16% | 28%
lib/Quantization0% | 0% | 54% | 21% | 23%
tools/ClassGen0% | 0% | 8% | 6% | 84%
lib/Exporter0% | 0% | 16% | 14% | 69%
lib/CodeGen0% | 0% | 64% | 10% | 25%
lib/Backend0% | 0% | 38% | 17% | 43%
inference_engines/x-inference-engines0% | 0% | 36% | 42% | 20%
lib/Converter0% | 0% | 42% | 12% | 44%
utils/scripts0% | 0% | 12% | 21% | 66%
lib/Support0% | 0% | 17% | 12% | 69%
torch_glow/utils0% | 0% | 24% | 0% | 75%
lib/ExecutionContext0% | 0% | 30% | 11% | 57%
utils0% | 0% | 4% | 30% | 65%
lib/ExecutionEngine0% | 0% | 0% | 63% | 36%
tools/Debugger0% | 0% | 0% | 30% | 69%
tools/IncludeBin0% | 0% | 0% | 100% | 0%
lib/PassManager0% | 0% | 0% | 18% | 81%
torch_glow/torch_glow0% | 0% | 0% | 0% | 100%
torch_glow0% | 0% | 0% | 0% | 100%
tools/png2bin0% | 0% | 0% | 0% | 100%
lib/Flags0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
bool Interpreter::isOpSupported()
in lib/Backends/Interpreter/Interpreter.cpp
789 336 1
static NodeSupportLevels isNodeSupported()
in lib/Backends/NNPI/NNPI.cpp
697 260 1
bool LLVMBackend::isOpSupported()
in lib/LLVMIRCodeGen/LLVMBackend.cpp
459 216 1
Error Caffe2ModelLoader::loadOperator()
in lib/Importer/Caffe2ModelLoader.cpp
1197 180 1
void LLVMIRGen::generateLLVMIRForInstr()
in lib/LLVMIRCodeGen/LLVMIRGen.cpp
1621 124 2
Error ONNXModelLoader::loadOperator()
in lib/Importer/ONNXModelLoader.cpp
285 99 1
Error OpenCLFunction::execute()
in lib/Backends/OpenCL/OpenCL.cpp
692 86 1
bool SinkCode::run()
in lib/Optimizer/GraphOptimizer/GraphOptimizer.cpp
470 79 2
Error TFLiteModelLoader::loadOperator()
in lib/Importer/TFLiteModelLoader.cpp
235 76 2
int Executor::executeNetwork()
in tools/loader/ExecutorCore.cpp
323 74 0
Error Provisioner::provisionNetwork()
in lib/Runtime/Provisioner/Provisioner.cpp
399 68 1
bool OCLBackend::isOpSupported()
in lib/Backends/OpenCL/OpenCL.cpp
132 66 1
275 65 4
bool HabanaBackend::isOpSupported()
in lib/Backends/Habana/Habana.cpp
79 61 1
Expected tryLoadCommonOperator()
in include/glow/Importer/CommonOperatorLoader.h
184 58 3
Error Caffe2ModelLoader::loadWeight()
in lib/Importer/Caffe2ModelLoader.cpp
306 56 1
static void libjit_insert_tensor()
in lib/LLVMIRCodeGen/libjit/libjit.cpp
107 56 10
Error HostManager::addNetwork()
in lib/Runtime/HostManager/HostManager.cpp
297 55 2
103 55 1
Error fromDynamicImpl()
in torch_glow/src/GlowCompileSpec.h
233 55 2