facebookresearch / phosa
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 66 units with 838 lines of code in units (22.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (109 lines of code)
    • 9 medium size units (269 lines of code)
    • 16 small units (227 lines of code)
    • 39 very small units (233 lines of code)
0% | 13% | 32% | 27% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 32% | 27% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 100% | 0% | 0% | 0%
phosa0% | 0% | 44% | 28% | 27%
phosa/utils0% | 0% | 17% | 37% | 44%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_args()
in demo.py
58 1 0
def main()
in demo.py
51 5 1
def visualize_optimal_poses()
in phosa/pose_optimization.py
39 3 4
def compute_random_rotations()
in phosa/utils/geometry.py
36 2 2
def forward()
in phosa/global_opt.py
35 13 2
def assign_interaction_pairs()
in phosa/global_opt.py
30 9 3
def assign_human_masks()
in phosa/global_opt.py
29 8 3
28 8 3
def visualize_human_object()
in phosa/global_opt.py
27 2 2
def project_bbox()
in phosa/global_opt.py
23 5 4
def get_faces_and_textures()
in phosa/global_opt.py
22 2 2
def compute_optimal_translation()
in phosa/pose_optimization.py
19 2 4
def compute_ordinal_depth_loss()
in phosa/global_opt.py
19 5 4
def compute_ordinal_depth_loss()
in phosa/global_opt.py
19 3 1
def __init__()
in phosa/global_opt.py
18 1 0
def compute_offscreen_loss()
in phosa/pose_optimization.py
16 2 2
def local_to_global_cam()
in phosa/utils/camera.py
14 2 3
def compute_iou()
in phosa/utils/bbox.py
14 2 2
def visualize_orthographic()
in phosa/bodymocap.py
13 2 2
def __init__()
in phosa/pose_optimization.py
13 1 0