facebookresearch / ScaDiver
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 216 units with 2,893 lines of code in units (56.1% of code).
    • 2 very long units (237 lines of code)
    • 8 long units (524 lines of code)
    • 29 medium size units (942 lines of code)
    • 40 small units (583 lines of code)
    • 137 very small units (607 lines of code)
8% | 18% | 32% | 20% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 18% | 32% | 20% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT10% | 20% | 29% | 19% | 21%
bullet0% | 9% | 46% | 24% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in env_humanoid_base.py
120 17 2
def actuate()
in sim_agent.py
117 21 4
def __init__()
in sim_agent.py
83 13 11
def create()
in env_humanoid_imitation.py
81 23 1
def get_task_error()
in env_humanoid_imitation.py
70 15 5
def __init__()
in rllib_model_custom_torch.py
69 5 7
def __init__()
in env_humanoid_tracking.py
58 7 10
def render_joint()
in bullet/bullet_render.py
57 11 2
def render()
in env_humanoid_tracking.py
54 9 3
def step()
in env_humanoid_base.py
52 14 2
def _state_body()
in env_humanoid_base.py
50 12 9
def __init__()
in rllib_model_custom_torch.py
49 2 7
def render_model()
in bullet/bullet_render.py
47 15 15
def add_noise_to_pose_vel()
in env_humanoid_tracking.py
46 10 5
def set_pose()
in sim_agent.py
45 10 3
def compute_reward()
in env_humanoid_base.py
41 13 3
def render()
in env_humanoid_base.py
41 7 2
def compute_target_pose()
in env_humanoid_base.py
38 9 3
def load_motions()
in env_humanoid_imitation.py
38 11 4
def extra_keyboard_callback()
in rllib_env_imitation.py
38 11 2