facebookresearch / interaction-exploration
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 291 units with 3,018 lines of code in units (75.5% of code).
    • 4 very long units (515 lines of code)
    • 2 long units (156 lines of code)
    • 19 medium size units (581 lines of code)
    • 48 small units (677 lines of code)
    • 218 very small units (1,089 lines of code)
17% | 5% | 19% | 22% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py17% | 5% | 19% | 22% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
rl/ppo59% | 17% | 5% | 6% | 11%
interaction_exploration47% | 0% | 0% | 21% | 31%
affordance_seg23% | 0% | 17% | 32% | 26%
rl/common0% | 18% | 14% | 13% | 53%
envs0% | 0% | 27% | 23% | 49%
interaction_exploration/tools0% | 0% | 63% | 24% | 11%
ROOT0% | 0% | 45% | 32% | 21%
interaction_exploration/utils0% | 0% | 18% | 57% | 24%
rl/models0% | 0% | 19% | 0% | 80%
interaction_exploration/models0% | 0% | 0% | 40% | 60%
interaction_exploration/config0% | 0% | 0% | 0% | 100%
rl/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def eval()
in rl/ppo/ppo_trainer.py
144 23 1
def enjoy()
in interaction_exploration/viz_trainer.py
131 20 1
def collect_affordance_episodes()
in affordance_seg/collect_dset.py
123 15 1
def train()
in rl/ppo/ppo_trainer.py
117 24 1
def recurrent_generator()
in rl/common/rollout_storage.py
78 6 3
def update()
in rl/ppo/ppo.py
78 5 2
def compute_masks()
in envs/thor_beacons.py
49 33 3
def compute_graph()
in interaction_exploration/tools/calculate_max_interactions.py
44 14 1
def update_beacon_coordinates()
in envs/thor_beacons.py
40 17 2
def viz()
in affordance_seg/train_unet.py
40 7 2
def construct_envs()
in rl/common/env_utils.py
38 18 2
def compute_masks()
in envs/thor_beacons.py
37 27 3
def run()
in interaction_exploration/tools/calculate_max_interactions.py
36 12 3
def __init__()
in kb_agent.py
30 4 2
def image_to_world()
in interaction_exploration/utils/map_util.py
29 2 3
def get_target_obj()
in envs/thor.py
28 17 3
def seq_forward()
in rl/models/rnn_state_encoder.py
28 5 4
def save_episode()
in affordance_seg/collect_dset.py
27 3 2
def get_beacon_position()
in envs/thor_beacons.py
23 9 3
def init_environment()
in interaction_exploration/tools/calculate_max_interactions.py
23 11 1