microsoft / singleshotpose
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 274 units with 6,834 lines of code in units (73.1% of code).
    • 20 very long units (2,483 lines of code)
    • 17 long units (1,162 lines of code)
    • 46 medium size units (1,653 lines of code)
    • 65 small units (928 lines of code)
    • 126 very small units (608 lines of code)
36% | 17% | 24% | 13% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py36% | 17% | 24% | 13% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
py251% | 8% | 20% | 12% | 8%
ROOT30% | 20% | 22% | 14% | 11%
py2/multi_obj_pose_estimation35% | 22% | 25% | 11% | 4%
multi_obj_pose_estimation20% | 22% | 31% | 15% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def valid()
in py2/valid.py
172 24 4
def valid()
in valid.py
165 23 3
def build_targets()
in py2/multi_obj_pose_estimation/region_loss_multi.py
147 11 11
146 19 8
def get_boxes()
in py2/utils.py
146 19 8
def get_region_boxes()
in py2/utils.py
144 17 5
def build_targets()
in py2/region_loss.py
137 9 11
def forward()
in py2/region_loss.py
122 4 3
116 19 1
def print_cfg()
in py2/cfg.py
116 19 1
def forward()
in py2/multi_obj_pose_estimation/region_loss_multi.py
116 2 3
112 30 2
def create_network()
in py2/darknet.py
112 30 2
def create_network()
in multi_obj_pose_estimation/darknet_multi.py
109 29 2
def create_network()
in py2/multi_obj_pose_estimation/darknet_multi.py
109 29 2
def get_multi_region_boxes()
in multi_obj_pose_estimation/utils_multi.py
105 25 9
def test()
in py2/train.py
105 15 2
def eval()
in py2/multi_obj_pose_estimation/train_multi.py
102 21 3
def eval()
in multi_obj_pose_estimation/train_multi.py
101 22 2
def test()
in train.py
101 15 2