facebookresearch / CausalSkillLearning
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 464 units with 5,221 lines of code in units (83.1% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (513 lines of code)
    • 61 medium size units (1,792 lines of code)
    • 100 small units (1,489 lines of code)
    • 295 very small units (1,427 lines of code)
0% | 9% | 34% | 28% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 9% | 34% | 28% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Experiments0% | 10% | 34% | 28% | 26%
DownstreamRL0% | 21% | 8% | 47% | 22%
DataLoaders0% | 0% | 46% | 20% | 33%
DataGenerator0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def parse_arguments()
in Experiments/Master.py
94 19 0
def __init__()
in Experiments/PolicyManagers.py
77 11 4
def __init__()
in Experiments/PolicyManagers.py
70 5 4
def run_episode()
in DownstreamRL/TrainZPolicyRL.py
57 11 2
def collect_inputs()
in Experiments/PolicyManagers.py
56 5 3
def forward()
in Experiments/PolicyNetworks.py
55 9 4
def forward()
in Experiments/PolicyNetworks.py
53 9 4
def compute_statistics()
in Experiments/MIME_DataLoader.py
51 1 1
def run_iteration()
in Experiments/PolicyManagers.py
45 2 3
def preprocess_dataset()
in Experiments/Roboturk_DataLoader.py
45 6 1
def visualize_robot_data()
in Experiments/PolicyManagers.py
44 5 1
def get_trajectory_segment()
in Experiments/PolicyManagers.py
43 11 2
def update_plots()
in Experiments/PolicyManagers.py
42 3 3
def getit()
in DataLoaders/MIMEandPlan_DataLoader.py
42 2 4
def __getitem__()
in DataLoaders/MIMEandPlan_DataLoader.py
42 2 4
def forward()
in Experiments/PolicyNetworks.py
39 6 5
def rollout_latent_policy()
in Experiments/PolicyManagers.py
39 7 3
def evaluate_loglikelihoods()
in Experiments/PolicyManagers.py
38 10 6
def rollout()
in Experiments/PolicyManagers.py
37 5 4
def vis_walk()
in DataLoaders/RandomWalks.py
37 1 1