awslabs / dynamic-training-with-apache-mxnet-on-aws
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 10,381 units with 144,299 lines of code in units (57.2% of code).
    • 14 very complex units (3,061 lines of code)
    • 44 complex units (5,337 lines of code)
    • 414 medium complex units (24,680 lines of code)
    • 868 simple units (27,777 lines of code)
    • 9,041 very simple units (83,444 lines of code)
2% | 3% | 17% | 19% | 57%
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
cc4% | 4% | 25% | 19% | 44%
h2% | 2% | 16% | 21% | 57%
py1% | 4% | 15% | 18% | 59%
jl6% | 4% | 9% | 11% | 69%
scala0% | 1% | 11% | 13% | 73%
pm0% | 0% | 11% | 12% | 75%
cpp0% | 0% | 11% | 47% | 41%
pyx0% | 0% | 48% | 18% | 32%
hpp0% | 0% | 4% | 15% | 79%
java0% | 0% | 0% | 30% | 69%
R0% | 0% | 0% | 2% | 97%
groovy0% | 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
src2% | 3% | 21% | 21% | 50%
python1% | 3% | 15% | 16% | 62%
example1% | 3% | 14% | 19% | 61%
tools5% | 13% | 11% | 24% | 44%
julia6% | 4% | 9% | 11% | 69%
R-package6% | 8% | 4% | 7% | 73%
benchmark0% | 22% | 12% | 25% | 39%
scala-package0% | 1% | 11% | 13% | 73%
perl-package0% | 0% | 11% | 12% | 75%
cpp-package0% | 0% | 9% | 29% | 60%
plugin0% | 0% | 12% | 18% | 69%
ci0% | 0% | 17% | 8% | 73%
amalgamation0% | 0% | 51% | 14% | 34%
include0% | 0% | 3% | 14% | 81%
ROOT0% | 0% | 0% | 75% | 25%
matlab0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void VanillaRNNBackwardSingleLayer()
in src/operator/rnn_impl.h
282 80 25
void GruBackwardSingleLayer()
in src/operator/rnn_impl.h
310 76 27
cv::Mat Process()
in src/io/image_aug_default.cc
269 69 3
jl
function fit()
in julia/src/model.jl
166 65 3
def register()
in python/mxnet/operator.py
350 63 1
void ElemwiseBinaryOp::RspRspOp()
in src/operator/tensor/elemwise_binary_op-inl.h
186 62 11
int MXExecutorSimpleBind()
in src/c_api/c_api_executor.cc
273 62 34
void SgMKLDNNConvOperator::Forward()
in src/operator/subgraph/mkldnn/mkldnn_conv.cc
170 60 4
NDArray::RObjectType DispatchOps()
in R-package/src/ndarray.cc
150 57 3
int main()
in tools/im2rec.cc
227 56 2
nnvm::Graph InferAttr()
in src/executor/infer_graph_attr_pass.cc
218 53 12
void LstmBackwardSingleLayer()
in src/operator/rnn_impl.h
166 52 25
def fit()
in example/image-classification/common/fit.py
147 52 4
def fit()
in example/quantization/common/fit.py
147 52 4
mkldnn_memory_format_t GetDefaultFormat()
in src/operator/nn/mkldnn/mkldnn_base.cc
66 44 1
void IM2REC::im2rec()
in R-package/src/im2rec.cc
185 42 14
def _parse_proto()
in tools/caffe_converter/convert_symbol.py
156 39 1
inline void MultiBoxTargetForward()
in src/operator/contrib/multibox_target.cc
190 39 13
std::vector Imperative::Backward()
in src/imperative/imperative.cc
216 39 6
cv::Mat Process()
in src/io/image_det_aug_default.cc
141 39 3