facebookresearch / gala
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 114 units with 1,151 lines of code in units (90.1% of code).
    • 1 very long units (151 lines of code)
    • 1 long units (99 lines of code)
    • 12 medium size units (394 lines of code)
    • 14 small units (201 lines of code)
    • 86 very small units (306 lines of code)
13% | 8% | 34% | 17% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py13% | 8% | 34% | 17% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
gala15% | 0% | 36% | 18% | 30%
ROOT0% | 65% | 19% | 11% | 3%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_args()
in gala/arguments.py
151 2 1
99 4 5
def recurrent_generator()
in gala/storage.py
50 3 3
def compute_returns()
in gala/storage.py
40 8 6
def aggregate_message()
in gala/gpu_gossip_buffer.py
35 14 3
def __init__()
in gala/model.py
35 9 6
35 4 4
def make_env()
in gala/envs.py
34 12 7
def _forward_gru()
in gala/model.py
33 2 4
def write_message()
in gala/gpu_gossip_buffer.py
30 10 4
29 8 3
def update()
in gala/gala_a2c.py
25 2 2
def make_vec_envs()
in gala/envs.py
24 7 11
def _make_graph()
in gala/graph_manager.py
24 17 1
def _make_graph()
in gala/graph_manager.py
20 16 1
def __init__()
in gala/storage.py
20 4 6
def __init__()
in gala/gpu_gossip_buffer.py
18 5 8
def train()
in main.py
18 6 1
def __init__()
in gala/envs.py
14 2 4
def __init__()
in gala/model.py
14 2 4