neo-ai / tvm
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 15,632 units with 187,724 lines of code in units (66.5% of code).
    • 11 very complex units (2,120 lines of code)
    • 70 complex units (8,329 lines of code)
    • 598 medium complex units (33,839 lines of code)
    • 1,295 simple units (39,152 lines of code)
    • 13,658 very simple units (104,284 lines of code)
1% | 4% | 18% | 20% | 55%
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
py1% | 5% | 19% | 20% | 53%
cc<1% | 4% | 17% | 22% | 54%
h2% | 2% | 12% | 20% | 61%
c9% | 4% | 22% | 18% | 44%
go0% | 0% | 27% | 13% | 59%
mm0% | 0% | 29% | 8% | 61%
java0% | 0% | 7% | 13% | 79%
ts0% | 0% | 5% | 28% | 66%
rs0% | 0% | 0% | <1% | 99%
pxi0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src1% | 3% | 18% | 22% | 54%
python<1% | 4% | 20% | 20% | 53%
vta6% | 11% | 17% | 16% | 48%
nnvm2% | 24% | 13% | 16% | 43%
include0% | 3% | 9% | 21% | 65%
apps0% | 0% | 10% | 29% | 60%
golang0% | 0% | 25% | 12% | 62%
tutorials0% | 0% | 14% | 8% | 76%
jvm0% | 0% | 9% | 3% | 87%
web0% | 0% | 4% | 23% | 72%
ROOT0% | 0% | 0% | 47% | 52%
rust0% | 0% | 0% | 0% | 100%
neo-tools0% | 0% | 0% | 0% | 100%
conda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
PrimExpr RewriteSimplifier::Impl::VisitExpr_()
in src/arith/rewrite_simplify.cc
132 80 1
void StackVM::Run()
in src/runtime/stackvm/stackvm.cc
354 79 1
def conv2d_strategy_cuda()
in python/tvm/relay/op/strategy/cuda.py
243 74 4
def from_tensorflow()
in nnvm/python/nnvm/frontend/tensorflow.py
129 59 5
def _get_relay_func()
in python/tvm/relay/frontend/tensorflow.py
163 59 5
std::string ToString()
in src/parser/token.h
121 58 1
std::string Pretty()
in src/parser/token.h
121 58 1
int TVMGraphExecutorGraphAttr_Load()
in src/runtime/crt/graph_executor/graph_executor.c
293 56 2
inline Token TokenizeOnce()
in src/parser/tokenizer.h
195 56 0
def from_onnx()
in python/tvm/relay/frontend/onnx.py
126 55 4
def InjectDMAIntrin()
in vta/python/vta/transform.py
243 53 0
def _conv()
in python/tvm/relay/frontend/tensorflow_ops.py
136 49 1
inline Tensor einsum()
in include/tvm/topi/einsum.h
205 49 4
void DumpInsn()
in vta/runtime/runtime.cc
122 48 0
ComputeDAG ComputeDAG::RewriteLayout()
in src/auto_scheduler/compute_dag.cc
217 47 2
def _stridedSlice()
in python/tvm/relay/frontend/tensorflow_ops.py
129 47 0
String ReportNode::AsTable()
in src/runtime/profiling.cc
173 46 2
def conv2d_strategy_arm_cpu()
in python/tvm/relay/op/strategy/arm_cpu.py
148 46 4
void Symbol::Compose()
in nnvm/src/core/symbolic.cc
163 45 3
Graph PlaceDevice()
in nnvm/src/pass/place_device.cc
172 45 1