facebookresearch / frankmocap
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 386 units with 6,883 lines of code in units (89.4% of code).
    • 1 very long units (143 lines of code)
    • 22 long units (1,421 lines of code)
    • 92 medium size units (2,976 lines of code)
    • 86 small units (1,292 lines of code)
    • 185 very small units (1,051 lines of code)
2% | 20% | 43% | 18% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 20% | 43% | 18% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
integration69% | 0% | 19% | 6% | 4%
renderer0% | 24% | 49% | 14% | 11%
handmocap0% | 38% | 29% | 20% | 11%
mocap_utils0% | 12% | 37% | 20% | 30%
bodymocap0% | 32% | 39% | 21% | 6%
handmocap/hand_modules0% | 13% | 19% | 38% | 28%
bodymocap/utils0% | 0% | 31% | 38% | 30%
bodymocap/models0% | 0% | 56% | 31% | 12%
renderer/shaders0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def integration_copy_paste()
in integration/copy_and_paste.py
143 16 4
def keyboard()
in renderer/glViewer.py
84 32 3
def Vis_Skeleton_2D_smplCOCO()
in renderer/viewer2D.py
84 20 7
def renderscene()
in renderer/glViewer.py
78 17 0
def DrawMeshes()
in renderer/glViewer.py
76 23 0
def DrawSkeletons()
in renderer/glViewer.py
76 29 0
def show_SMPL()
in renderer/glViewer.py
76 22 6
def regress()
in handmocap/hand_mocap_api.py
72 8 4
def Vis_Skeleton_2D_SPIN49()
in renderer/viewer2D.py
68 23 5
def LoadHagglingData()
in renderer/glViewer.py
66 4 1
def GetFaceMesh()
in renderer/glViewer.py
65 11 7
def render()
in renderer/p3d_renderer.py
64 8 4
def save_pred_to_pkl()
in mocap_utils/demo_utils.py
62 18 6
def __init__()
in renderer/glRenderer.py
60 6 8
def regress()
in bodymocap/body_mocap_api.py
59 4 3
def Vis_Skeleton_2D_H36m()
in renderer/viewer2D.py
58 9 3
def Vis_Densepose()
in renderer/viewer2D.py
55 19 2
def __get_raw_hand_bbox()
in handmocap/hand_bbox_detector.py
55 2 2
def drawbody_SMPLCOCO_TotalCap26()
in renderer/glViewer.py
54 10 3
def Vis_Skeleton_2D_SPIN24()
in renderer/viewer2D.py
53 23 5