awslabs / dynamic-training-with-apache-mxnet-on-aws
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 10,381 units with 144,299 lines of code in units (57.2% of code).
    • 89 very long units (13,249 lines of code)
    • 355 long units (24,038 lines of code)
    • 1,553 medium size units (47,677 lines of code)
    • 2,009 small units (29,701 lines of code)
    • 6,375 very small units (29,634 lines of code)
9% | 16% | 33% | 20% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h9% | 18% | 36% | 19% | 15%
cc14% | 23% | 34% | 17% | 10%
py7% | 12% | 30% | 22% | 26%
cpp14% | 43% | 22% | 13% | 6%
jl10% | 6% | 17% | 23% | 40%
scala3% | 9% | 23% | 22% | 41%
pm2% | 16% | 32% | 24% | 24%
R0% | 17% | 54% | 21% | 6%
java0% | 8% | 34% | 20% | 36%
hpp0% | 8% | 30% | 14% | 46%
pyx0% | 0% | 67% | 0% | 32%
groovy0% | 0% | 0% | 76% | 23%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src11% | 21% | 36% | 18% | 12%
example6% | 14% | 37% | 21% | 20%
python6% | 9% | 26% | 24% | 33%
tools16% | 17% | 30% | 16% | 19%
R-package14% | 5% | 30% | 24% | 25%
cpp-package6% | 25% | 24% | 18% | 24%
julia10% | 6% | 17% | 23% | 40%
scala-package2% | 9% | 23% | 22% | 41%
benchmark22% | 27% | 25% | 10% | 13%
perl-package2% | 16% | 32% | 24% | 24%
ci17% | 0% | 15% | 43% | 22%
plugin0% | 19% | 42% | 15% | 22%
include0% | 0% | 17% | 28% | 54%
amalgamation0% | 0% | 35% | 29% | 34%
ROOT0% | 0% | 75% | 0% | 25%
matlab0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def register()
in python/mxnet/operator.py
350 63 1
void GruBackwardSingleLayer()
in src/operator/rnn_impl.h
310 76 27
void VanillaRNNBackwardSingleLayer()
in src/operator/rnn_impl.h
282 80 25
int MXExecutorSimpleBind()
in src/c_api/c_api_executor.cc
273 62 34
cv::Mat Process()
in src/io/image_aug_default.cc
269 69 3
def train()
in example/mxnet_adversarial_vae/vaegan_mxnet.py
267 36 21
int main()
in tools/im2rec.cc
227 56 2
def _parse_proto()
in example/ssd/tools/caffe_converter/convert_symbol.py
219 37 1
nnvm::Graph InferAttr()
in src/executor/infer_graph_attr_pass.cc
218 53 12
void SelectAlgo()
in src/operator/nn/cudnn/cudnn_deconvolution-inl.h
218 30 5
std::vector Imperative::Backward()
in src/imperative/imperative.cc
216 39 6
void SelectAlgo()
in src/operator/nn/cudnn/cudnn_convolution-inl.h
210 30 5
inline void Init()
in src/operator/cudnn_rnn-inl.h
195 14 3
inline void MultiBoxTargetForward()
in src/operator/contrib/multibox_target.cc
190 39 13
void ElemwiseBinaryOp::RspRspOp()
in src/operator/tensor/elemwise_binary_op-inl.h
186 62 11
void IM2REC::im2rec()
in R-package/src/im2rec.cc
185 42 14
void InitDescriptors()
in src/operator/nn/cudnn/cudnn_convolution-inl.h
183 15 4
inline void InitDescriptors()
in src/operator/nn/cudnn/cudnn_deconvolution-inl.h
173 12 4
void SgMKLDNNConvOperator::Forward()
in src/operator/subgraph/mkldnn/mkldnn_conv.cc
170 60 4
static bool ConvolutionShape()
in src/operator/nn/convolution.cc
167 33 3