facebookresearch / tacto
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 104 units with 1,185 lines of code in units (17.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (68 lines of code)
    • 17 medium size units (528 lines of code)
    • 19 small units (274 lines of code)
    • 67 very small units (315 lines of code)
0% | 5% | 44% | 23% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 44% | 23% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
experiments/grasp_stability0% | 13% | 40% | 23% | 22%
tacto0% | 0% | 46% | 21% | 31%
experiments/rolling0% | 0% | 53% | 27% | 19%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def load_data()
in experiments/grasp_stability/train.py
68 7 3
def create_scene()
in experiments/rolling/RollingEnv.py
49 5 1
def _init_light()
in tacto/renderer.py
46 6 1
def train()
in experiments/grasp_stability/train.py
41 5 2
def go()
in experiments/grasp_stability/robot.py
41 10 6
def __getitem__()
in experiments/grasp_stability/train.py
35 11 2
def __init__()
in experiments/grasp_stability/robot.py
35 4 2
def _generate_gel_trimesh()
in tacto/renderer.py
32 5 1
def __init__()
in tacto/renderer.py
30 9 5
30 2 2
def add_object()
in tacto/sensor.py
29 9 4
def simulate()
in experiments/rolling/RollingEnv.py
25 3 3
def test()
in experiments/grasp_stability/train.py
25 3 1
def step()
in experiments/rolling/RollingEnv.py
23 4 2
def _f()
in experiments/rolling/Rolling.py
22 3 2
def load()
in experiments/grasp_stability/draw.py
22 9 3
def _init_camera()
in tacto/renderer.py
22 3 1
def render_from_depth()
in tacto/renderer.py
21 2 5
def __init__()
in experiments/rolling/Rolling.py
18 1 3
def __init__()
in experiments/rolling/RollingEnv.py
18 1 3