facebookresearch / drqv2
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 121 units with 877 lines of code in units (74.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 8 medium size units (181 lines of code)
    • 14 small units (210 lines of code)
    • 98 very small units (434 lines of code)
0% | 5% | 20% | 23% | 49%
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% | 20% | 23% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 5% | 20% | 23% | 49%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in train.py
52 7 1
def make()
in dmc.py
25 5 4
def forward()
in drqv2.py
25 1 2
def __init__()
in drqv2.py
24 1 13
def eval()
in train.py
22 3 1
22 3 7
def schedule()
in utils.py
21 7 2
def setup()
in train.py
21 3 1
def _try_fetch()
in replay_buffer.py
21 8 1
def update()
in drqv2.py
20 3 3
def _store_episode()
in replay_buffer.py
18 3 2
def _sample()
in replay_buffer.py
18 3 1
17 2 3
def make_replay_loader()
in replay_buffer.py
16 1 7
16 2 4
15 4 2
def _dump_to_csv()
in logger.py
14 4 2
def add()
in replay_buffer.py
14 6 2
def __init__()
in train.py
13 1 2
def __init__()
in replay_buffer.py
13 1 8