facebookresearch / fairmotion
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 392 units with 3,650 lines of code in units (60.0% of code).
    • 1 very long units (105 lines of code)
    • 6 long units (391 lines of code)
    • 26 medium size units (813 lines of code)
    • 62 small units (863 lines of code)
    • 297 very small units (1,478 lines of code)
2% | 10% | 22% | 23% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 10% | 22% | 23% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fairmotion/tasks/motion_prediction25% | 0% | 18% | 19% | 36%
fairmotion/viz0% | 17% | 24% | 18% | 39%
fairmotion/data0% | 34% | 46% | 6% | 12%
fairmotion/tasks/clustering0% | 19% | 17% | 32% | 31%
fairmotion/models0% | 0% | 27% | 19% | 53%
fairmotion/ops0% | 0% | 16% | 31% | 52%
fairmotion/tasks/motion_graph0% | 0% | 35% | 47% | 16%
fairmotion/core0% | 0% | 5% | 32% | 61%
fairmotion/utils0% | 0% | 0% | 0% | 100%
fairmotion/tasks/changepoint_detection0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in fairmotion/tasks/motion_prediction/training.py
105 10 1
def extract_manual_features()
in fairmotion/tasks/clustering/generate_features.py
96 2 1
def parse_asf()
in fairmotion/data/asfamc.py
75 14 1
def main()
in fairmotion/viz/body_visualizer.py
58 5 1
def keyboard_callback()
in fairmotion/viz/bvh_visualizer.py
56 11 2
def parse_amc()
in fairmotion/data/asfamc.py
54 14 3
def render_ground()
in fairmotion/viz/pyrender_visualizer.py
52 11 14
def _init_GL()
in fairmotion/viz/glut_viewer.py
48 1 3
def save()
in fairmotion/data/bvh.py
46 11 5
def append_and_blend()
in fairmotion/ops/motion.py
44 9 3
def forward()
in fairmotion/models/transformer.py
41 8 5
def forward()
in fairmotion/models/rnn.py
39 3 5
def main()
in fairmotion/viz/bvh_visualizer.py
38 5 1
def _write_hierarchy()
in fairmotion/data/bvh.py
38 9 6
def create_random_motion()
in fairmotion/tasks/motion_graph/motion_graph.py
35 9 3
def create_motion_from_amass_data()
in fairmotion/data/amass.py
35 5 3
def main()
in fairmotion/tasks/clustering/clustering.py
34 11 1
def main()
in fairmotion/tasks/motion_prediction/test.py
33 5 1
def R_from_vectors()
in fairmotion/ops/math.py
31 4 2
def create_motion_by_following()
in fairmotion/tasks/motion_graph/motion_graph.py
29 5 2