facebookresearch / EmbodiedQA
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 178 units with 5,320 lines of code in units (77.7% of code).
    • 9 very long units (2,194 lines of code)
    • 10 long units (698 lines of code)
    • 44 medium size units (1,414 lines of code)
    • 40 small units (584 lines of code)
    • 75 very small units (430 lines of code)
41% | 13% | 26% | 10% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py41% | 13% | 26% | 10% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
training56% | 12% | 21% | 4% | 5%
data/shortest-path-gen87% | 0% | 11% | 0% | <1%
utils17% | 27% | 37% | 13% | 3%
data/question-gen9% | 12% | 36% | 24% | 16%
training/utils0% | 0% | 35% | 35% | 29%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def eval()
in training/train_nav.py
525 9 3
def train()
in training/train_nav.py
303 48 3
def eval()
in training/train_eqa.py
282 3 4
def __getitem__()
in training/data.py
278 45 2
def train()
in training/train_eqa.py
260 34 4
def main()
in data/shortest-path-gen/generate-paths-a-star.py
217 54 0
def set_target_object()
in utils/house3d.py
118 30 3
def questionObjectBuilder()
in data/question-gen/engine.py
108 23 5
def __init__()
in training/data.py
103 16 15
def train()
in training/train_vqa.py
93 18 3
def queryLogical()
in data/question-gen/engine.py
91 33 2
def eval()
in training/train_vqa.py
88 16 3
def __init__()
in training/data.py
69 17 2
def _load_envs()
in training/data.py
64 14 3
def build_graph()
in utils/house3d.py
64 23 2
def _parse()
in utils/house3d.py
59 12 2
def fit_grid_path_to_suncg()
in utils/house3d.py
57 1 4
def getNearbyPairs()
in data/question-gen/house_parse.py
57 16 4
def __init__()
in training/models.py
56 1 14
def __init__()
in training/models.py
49 4 14