facebookresearch / mbrl-lib
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 403 units with 2,723 lines of code in units (45.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (106 lines of code)
    • 15 medium size units (492 lines of code)
    • 36 small units (500 lines of code)
    • 350 very small units (1,625 lines of code)
0% | 3% | 18% | 18% | 59%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 3% | 18% | 18% | 59%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mbrl/env0% | 8% | 29% | 21% | 41%
mbrl/diagnostics0% | 9% | 42% | 15% | 32%
mbrl/util0% | 0% | 9% | 16% | 73%
mbrl/models0% | 0% | 0% | 17% | 82%
mbrl/planning0% | 0% | 0% | 25% | 74%
mbrl0% | 0% | 0% | 43% | 56%
mbrl/algorithms0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def render()
in mbrl/env/cartpole_continuous.py
55 3 2
def __init__()
in mbrl/diagnostics/training_browser.py
51 4 2
def get_EE_pos()
in mbrl/env/pets_reacher.py
48 2 2
def run()
in mbrl/diagnostics/planet_visualizer.py
48 8 1
def onExperimentsSelectionChanged()
in mbrl/diagnostics/training_browser.py
48 9 3
def step()
in mbrl/env/cartpole_continuous.py
46 8 2
def plot_dataset_results()
in mbrl/diagnostics/eval_model_on_dataset.py
44 7 2
def create_axes()
in mbrl/diagnostics/visualize_model_preds.py
37 6 1
def _get_current_state_locomotion()
in mbrl/util/pybullet.py
31 3 1
def __init__()
in mbrl/env/cartpole_continuous.py
28 1 1
def step()
in mbrl/env/ant_truncated_obs.py
26 3 2
def load_experiments()
in mbrl/diagnostics/training_browser.py
26 6 1
def step()
in mbrl/env/humanoid_truncated_obs.py
24 2 2
def make_env_from_str()
in mbrl/util/mujoco.py
22 9 1
def preprocess_fn()
in mbrl/env/pets_cartpole.py
22 3 1
def _trajectory_bookkeeping()
in mbrl/util/replay_buffer.py
21 5 2
def selectedMatchingSequences()
in mbrl/diagnostics/training_browser.py
21 9 1
def __init__()
in mbrl/diagnostics/eval_model_on_dataset.py
20 1 4
def reloadExperiments()
in mbrl/diagnostics/training_browser.py
20 5 2
def _set_env_state_locomotion()
in mbrl/util/pybullet.py
18 3 2