facebookresearch / vilbert-multi-task
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 409 units with 8,574 lines of code in units (70.2% of code).
    • 13 very long units (3,077 lines of code)
    • 18 long units (1,170 lines of code)
    • 56 medium size units (1,811 lines of code)
    • 91 small units (1,336 lines of code)
    • 231 very small units (1,180 lines of code)
35% | 13% | 21% | 15% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py35% | 13% | 21% | 15% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT99% | 0% | 0% | <1% | 0%
evaluation81% | 11% | 4% | 1% | 1%
vilbert17% | 11% | 18% | 17% | 35%
vilbert/datasets6% | 22% | 36% | 25% | 9%
script0% | 17% | 42% | 16% | 23%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in train_concap.py
561 87 0
def main()
in train_tasks.py
519 92 0
def main()
in eval_retrieval.py
276 26 0
def main()
in evaluation/eval_coco_retrieval.py
248 20 0
def main()
in eval_tasks.py
243 26 0
def main()
in evaluation/eval_vqa.py
240 20 0
def main()
in evaluation/eval_concap_retrieval.py
218 17 0
def main()
in evaluation/eval_refer_expression.py
188 14 0
def from_pretrained()
in vilbert/utils.py
136 37 4
def ForwardModelsVal()
in vilbert/task_utils.py
120 14 7
def LoadDatasets()
in vilbert/task_utils.py
115 16 4
def _load_dataset()
in vilbert/datasets/vqa_mc_dataset.py
107 9 2
def _load_dataset()
in vilbert/datasets/vqa_dataset.py
106 18 3
def __getitem__()
in vilbert/datasets/visdial_dataset.py
99 14 2
def __getitem__()
in vilbert/datasets/retreival_dataset.py
91 10 2
def __getitem__()
in vilbert/datasets/_image_features_reader.py
85 4 2
def LoadDatasetEval()
in vilbert/task_utils.py
75 11 3
def __getitem__()
in vilbert/datasets/refer_expression_dataset.py
69 5 2
def evaluate()
in evaluation/eval_coco_retrieval.py
68 5 3
def __getitem__()
in vilbert/datasets/flickr_grounding_dataset.py
63 5 2