facebookresearch / OccupancyAnticipation
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 411 units with 5,005 lines of code in units (55.4% of code).
    • 1 very long units (332 lines of code)
    • 15 long units (1,068 lines of code)
    • 48 medium size units (1,451 lines of code)
    • 73 small units (1,051 lines of code)
    • 274 very small units (1,103 lines of code)
6% | 21% | 28% | 20% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py6% | 21% | 28% | 20% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
occant_baselines/rl17% | 17% | 28% | 18% | 18%
occant_baselines/generate_topdown_maps0% | 74% | 0% | 10% | 14%
habitat_extensions0% | 17% | 37% | 25% | 19%
occant_utils0% | 21% | 22% | 26% | 28%
occant_baselines/common0% | 37% | 8% | 22% | 32%
occant_baselines/supervised0% | 37% | 14% | 28% | 19%
occant_baselines/models0% | 0% | 49% | 16% | 33%
ROOT0% | 0% | 62% | 37% | 0%
habitat_extensions/config0% | 0% | 0% | 0% | 100%
occant_baselines/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in occant_baselines/rl/occant_exp_trainer.py
332 38 1
def main()
in occant_baselines/generate_topdown_maps/generate_occant_gt_maps.py
98 17 1
def recurrent_generator()
in occant_baselines/common/rollout_storage.py
91 11 3
def _get_wall_occupancy()
in habitat_extensions/sensors.py
88 11 3
def map_update_fn()
in occant_baselines/supervised/map_update.py
87 11 1
def _transform_observations()
in occant_baselines/rl/policy.py
87 9 3
def predict_deltas()
in occant_baselines/rl/policy.py
74 14 3
def _setup_actor_critic_agent()
in occant_baselines/rl/occant_exp_trainer.py
71 4 3
def grow_projected_map()
in occant_utils/common.py
69 9 3
def main()
in occant_baselines/generate_topdown_maps/generate_environment_layouts.py
67 5 1
def _create_mapper_rollouts()
in occant_baselines/rl/occant_exp_trainer.py
60 4 3
def main()
in occant_utils/generate_exploration_dataset.py
59 9 1
def get_episode_map()
in occant_baselines/generate_topdown_maps/generate_occant_gt_maps.py
56 4 5
def _get_mesh_occupancy()
in habitat_extensions/measures.py
55 11 1
def _synchronize_configs()
in occant_baselines/rl/occant_exp_trainer.py
55 10 2
def _get_mesh_occupancy()
in habitat_extensions/sensors.py
51 8 3
def process_predictions()
in occant_utils/metrics.py
46 1 2
def _create_gp_models()
in occant_baselines/models/occant.py
46 1 1
def _synchronize_configs()
in occant_baselines/rl/occant_nav_trainer.py
46 6 2
def ground_projection()
in occant_baselines/models/mapnet.py
45 2 6