facebookresearch / DeepHandMesh
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 102 units with 1,202 lines of code in units (85.7% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (188 lines of code)
    • 9 medium size units (284 lines of code)
    • 30 small units (436 lines of code)
    • 60 very small units (294 lines of code)
0% | 15% | 23% | 36% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 15% | 23% | 36% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common/nets0% | 22% | 8% | 23% | 46%
data0% | 52% | 29% | 16% | 1%
main0% | 24% | 27% | 47% | 0%
common/utils0% | 0% | 37% | 41% | 21%
common/nets/DiffableRenderer0% | 0% | 77% | 0% | 22%
common0% | 0% | 0% | 54% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def forward()
in common/nets/loss.py
68 18 5
def __init__()
in data/dataset.py
62 15 3
def forward()
in main/model.py
58 19 5
def get_keypoint_rgb()
in common/utils/vis.py
49 23 1
def main()
in main/train.py
37 7 0
def __getitem__()
in data/dataset.py
35 2 2
def euler2mat()
in common/utils/transforms.py
31 2 2
def load_skeleton()
in common/utils/mesh.py
29 12 3
def decode()
in main/model.py
29 10 2
def gen_trans_from_patch_cv()
in common/utils/preprocessing.py
25 2 9
def __init__()
in common/nets/resnet.py
25 4 2
def forward()
in common/nets/DiffableRenderer/DiffableRenderer.py
24 7 5
def load_obj()
in common/utils/mesh.py
20 5 2
def load_joint_coord()
in data/dataset.py
19 10 4
def vis_3d_keypoints()
in common/utils/vis.py
18 8 7
def vis_keypoints()
in common/utils/vis.py
17 8 8
def __init__()
in common/logger.py
17 2 3
def __init__()
in common/nets/loss.py
17 2 4
def main()
in main/test.py
17 4 0
def __init__()
in main/model.py
17 1 9