microsoft / O-CNN
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 1,313 units with 17,676 lines of code in units (56.7% of code).
    • 11 very long units (1,592 lines of code)
    • 27 long units (1,850 lines of code)
    • 218 medium size units (6,418 lines of code)
    • 290 small units (4,333 lines of code)
    • 767 very small units (3,483 lines of code)
9% | 10% | 36% | 24% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp15% | 13% | 40% | 19% | 11%
cc0% | 21% | 35% | 23% | 19%
py0% | 2% | 29% | 35% | 32%
h0% | 0% | 24% | 10% | 65%
hpp0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
octree/octree15% | 14% | 36% | 17% | 15%
octree/tools24% | 12% | 50% | 7% | 4%
pytorch/cpp19% | 0% | 35% | 32% | 12%
caffe/src5% | 8% | 44% | 26% | 14%
caffe/tools12% | 37% | 34% | 13% | 2%
tensorflow/libs0% | 17% | 34% | 24% | 23%
caffe/experiments0% | 42% | 20% | 33% | 2%
tensorflow/script0% | 0% | 31% | 36% | 32%
pytorch/projects0% | 0% | 28% | 39% | 32%
tensorflow/data0% | 0% | 42% | 42% | 14%
pytorch/ocnn0% | 0% | 21% | 18% | 59%
tensorflow/util0% | 0% | 0% | 87% | 12%
pytorch0% | 0% | 0% | 100% | 0%
caffe/include0% | 0% | 0% | 0% | 100%
octree/python0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void adaptive_octree()
in octree/tools/adaptive_octree.cpp
313 88 3
void Octree::calc_signal()
in octree/octree/octree.cpp
183 65 2
void merge_octrees()
in caffe/src/caffe/util/octree.cpp
154 37 2
int test()
in caffe/tools/caffe.cpp
130 24 0
void octree_dropout()
in octree/octree/transform_octree.cpp
130 36 4
void Octree::extrapolate_signal()
in octree/octree/octree.cpp
124 42 0
void Octree::calc_signal()
in octree/octree/octree.cpp
121 36 4
Tensor octree_property_gpu()
in pytorch/cpp/octree_property.cpp
117 23 3
Tensor octree_property_cpu()
in pytorch/cpp/octree_property.cpp
117 23 3
int main()
in octree/tools/upgrade_octree.cpp
102 19 2
void Octree::trim_octree()
in octree/octree/octree.cpp
101 35 0
void ScanOctree::trim_octree()
in octree/octree/transform_octree.cpp
96 32 3
void Compute()
in tensorflow/libs/octree_property_op.cc
88 15 1
def shapenet_lmdb_ae()
in caffe/experiments/prepare_dataset.py
86 16 0
void OctreeBaseConvLayer::LayerSetUp()
in caffe/src/caffe/layers/octree_base_conv_layer.cpp
85 18 2
void NeighHelper::init_neigh_index()
in octree/octree/octree_nn.cpp
83 14 0
void Compute()
in tensorflow/libs/transform_points_op.cc
83 27 1
void prune_octree()
in octree/tools/octree_prune.cpp
82 26 2
int time()
in caffe/tools/caffe.cpp
79 6 0
void upgrade_octree()
in caffe/tools/upgrade_octree_database.cpp
76 13 2