facebookresearch / deep_bisim4control
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 533 units with 4,760 lines of code in units (76.8% of code).
    • 4 very long units (439 lines of code)
    • 3 long units (252 lines of code)
    • 35 medium size units (1,076 lines of code)
    • 79 small units (1,074 lines of code)
    • 412 very small units (1,919 lines of code)
9% | 5% | 22% | 22% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 5% | 22% | 22% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT21% | 5% | 11% | 26% | 34%
CARLA_0.9.6/PythonAPI21% | 19% | 21% | 12% | 25%
CARLA_0.9.8/PythonAPI21% | 19% | 21% | 11% | 25%
local_dm_control_suite0% | 0% | 15% | 21% | 62%
agent0% | 0% | 43% | 39% | 17%
local_dm_control_suite/utils0% | 0% | 61% | 19% | 19%
distractors0% | 0% | 79% | 0% | 20%
dmc2gym0% | 0% | 16% | 36% | 46%
local_dm_control_suite/wrappers0% | 0% | 41% | 14% | 44%
local_dm_control_suite/common0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in train.py
115 22 0
def __init__()
in CARLA_0.9.6/PythonAPI/carla/agents/navigation/carla_env.py
110 12 10
def __init__()
in CARLA_0.9.8/PythonAPI/carla/agents/navigation/carla_env.py
109 11 10
def make_agent()
in train.py
105 7 4
def _simulator_step()
in CARLA_0.9.6/PythonAPI/carla/agents/navigation/carla_env.py
98 14 3
def _simulator_step()
in CARLA_0.9.8/PythonAPI/carla/agents/navigation/carla_env.py
97 25 3
def parse_args()
in train.py
57 1 0
def evaluate()
in train.py
50 8 9
def dist_from_center_lane()
in CARLA_0.9.6/PythonAPI/carla/agents/navigation/carla_env.py
49 5 3
def initialize_episode()
in local_dm_control_suite/manipulator.py
48 6 2
def dist_from_center_lane()
in CARLA_0.9.8/PythonAPI/carla/agents/navigation/carla_env.py
47 10 2
def reset_other_vehicles()
in CARLA_0.9.8/PythonAPI/carla/agents/navigation/carla_env.py
40 12 1
def animate()
in distractors/n_body_problem.py
38 7 5
def convert()
in local_dm_control_suite/utils/parse_amc.py
37 9 3
def reset_other_vehicles()
in CARLA_0.9.6/PythonAPI/carla/agents/navigation/carla_env.py
35 12 1
def build_arr()
in dmc2gym/natural_imgsource.py
35 14 1
def _make_model()
in local_dm_control_suite/lqr.py
35 8 5
def _make_model()
in local_dm_control_suite/swimmer.py
34 6 1
def __init__()
in agent/bisim_agent.py
33 1 0
def step()
in distractors/n_body_problem.py
33 4 1