facebookresearch / sound-spaces
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 649 units with 7,365 lines of code in units (52.4% of code).
    • 7 very long units (1,113 lines of code)
    • 23 long units (1,485 lines of code)
    • 51 medium size units (1,588 lines of code)
    • 76 small units (1,091 lines of code)
    • 492 very small units (2,088 lines of code)
15% | 20% | 21% | 14% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py15% | 20% | 21% | 14% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ss_baselines/savi24% | 18% | 17% | 15% | 23%
ss_baselines/av_wan14% | 20% | 29% | 14% | 21%
ss_baselines/av_nav19% | 28% | 22% | 5% | 25%
ss_baselines/common12% | 9% | 17% | 17% | 43%
scripts0% | 38% | 42% | 15% | 3%
soundspaces0% | 28% | 16% | 13% | 40%
soundspaces/tasks0% | 13% | 13% | 10% | 63%
soundspaces/datasets0% | 0% | 30% | 43% | 26%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in ss_baselines/savi/ddppo/algo/ddppo_trainer.py
283 46 1
def train()
in ss_baselines/savi/ppo/ppo_trainer.py
176 24 1
def train()
in ss_baselines/av_wan/ppo/ppo_trainer.py
174 22 1
def train()
in ss_baselines/av_nav/ppo/ppo_trainer.py
140 19 1
def run()
in ss_baselines/savi/pretraining/audiogoal_trainer.py
119 28 3
def _setup_actor_critic_agent()
in ss_baselines/savi/ddppo/algo/ddppo_trainer.py
111 23 3
def observations_to_image()
in ss_baselines/common/utils.py
110 21 3
def recurrent_generator()
in ss_baselines/savi/models/rollout_storage.py
95 10 3
def update()
in ss_baselines/savi/ppo/ppo.py
83 5 2
def update()
in ss_baselines/av_nav/ppo/ppo.py
78 5 2
def recurrent_generator()
in ss_baselines/common/rollout_storage.py
78 6 3
def main()
in ss_baselines/savi/run.py
76 6 0
def __init__()
in ss_baselines/savi/models/visual_cnn.py
70 12 4
def main()
in ss_baselines/av_wan/run.py
67 5 0
def main()
in ss_baselines/av_nav/run.py
67 5 0
def update()
in ss_baselines/av_wan/models/mapper.py
64 19 4
def step()
in soundspaces/simulator.py
64 15 3
def main()
in scripts/cache_observations.py
62 6 1
def interactive_demo()
in scripts/interactive_demo.py
62 19 2
def main()
in scripts/interactive_demo.py
60 4 0