facebookresearch / ego-topo
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 259 units with 3,046 lines of code in units (74.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (187 lines of code)
    • 39 medium size units (1,130 lines of code)
    • 69 small units (981 lines of code)
    • 148 very small units (748 lines of code)
0% | 6% | 37% | 32% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 37% | 32% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
anticipation/anticipation/datasets0% | 12% | 51% | 18% | 17%
anticipation/anticipation/models0% | 11% | 13% | 40% | 35%
build_graph/tools/superpoint0% | 38% | 23% | 37% | 0%
build_graph/tools0% | 0% | 49% | 30% | 19%
build_graph0% | 0% | 46% | 34% | 18%
build_graph/localization_network0% | 0% | 41% | 35% | 23%
anticipation/anticipation/runner0% | 0% | 30% | 43% | 26%
build_graph/data0% | 0% | 33% | 29% | 36%
anticipation/anticipation/tools0% | 0% | 55% | 26% | 17%
build_graph/utils0% | 0% | 29% | 44% | 26%
anticipation/anticipation/utils0% | 0% | 0% | 0% | 100%
anticipation/anticipation/configs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in anticipation/anticipation/datasets/epic_future_labels.py
73 13 10
def __define_temporal_convolutional_block()
in anticipation/anticipation/models/backbone/timeception.py
61 2 7
def run()
in build_graph/tools/superpoint/model.py
53 5 2
def viz()
in build_graph/build.py
49 12 6
def parse_annotations()
in build_graph/data/gtea.py
44 8 1
def process_graph_feats()
in anticipation/anticipation/datasets/epic_future_labels.py
44 1 4
def main()
in anticipation/anticipation/tools/train_recognizer.py
41 9 0
def __init__()
in anticipation/anticipation/runner/runner.py
39 6 7
def process_graph_feats()
in anticipation/anticipation/datasets/epic_future_labels.py
38 1 4
def __init__()
in build_graph/build.py
37 7 2
def train()
in build_graph/localization_network/train.py
34 10 6
def parse_annotations()
in build_graph/data/epic.py
34 10 1
def get_node_feats()
in anticipation/anticipation/datasets/epic_future_labels.py
33 13 3
def nms_fast()
in build_graph/tools/superpoint/model.py
32 12 5
def run()
in anticipation/anticipation/runner/runner.py
31 11 5
def load_annotations_anticipation()
in anticipation/anticipation/datasets/epic_future_labels.py
31 19 2
def __getitem__()
in anticipation/anticipation/datasets/epic_future_labels.py
31 4 2
def get_trimmed_dataset()
in anticipation/anticipation/datasets/epic_utils.py
31 9 1
def load_annotations_recognition()
in anticipation/anticipation/datasets/epic_future_labels.py
30 16 2
def run()
in build_graph/tools/generate_sp_matches.py
29 15 0