facebookresearch / Large-Scale-VRD
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 350 units with 6,125 lines of code in units (72.3% of code).
    • 8 very long units (1,258 lines of code)
    • 15 long units (1,090 lines of code)
    • 58 medium size units (1,794 lines of code)
    • 71 small units (1,025 lines of code)
    • 198 very small units (958 lines of code)
20% | 17% | 29% | 16% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py20% | 18% | 28% | 16% | 15%
pyx0% | 0% | 92% | 0% | 7%
cc0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/roi_data57% | 15% | 11% | 7% | 7%
lib/datasets46% | 17% | 20% | 7% | 8%
lib/utils11% | 8% | 35% | 22% | 21%
lib/modeling0% | 44% | 28% | 12% | 14%
lib/core0% | 42% | 41% | 9% | 7%
lib/ops0% | 0% | 27% | 55% | 16%
tools0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def eval_im_dets_triplet_topk()
in lib/utils/evaluator_rel.py
227 41 1
def _sample_rois_triplet_yall()
in lib/roi_data/fast_rcnn_rel.py
205 20 15
def add_fast_rcnn_blobs()
in lib/roi_data/fast_rcnn_rel.py
174 25 8
def _sample_rois_softmax_yall()
in lib/roi_data/fast_rcnn_rel.py
164 16 15
def _load_vg_annotation()
in lib/datasets/vg_wiki_and_relco.py
151 18 5
def evaluate_recall()
in lib/datasets/imdb_rel.py
121 14 5
def vis_one_image()
in lib/utils/vis.py
114 29 13
def __init__()
in lib/datasets/vg_wiki_and_relco_lan.py
102 4 1
def add_language_embedding_for_gt()
in lib/modeling/VGG16_rel_softmaxed_triplet.py
94 4 1
def get_gt_perturbed_proposals()
in lib/core/get_gt_perturbed_proposals.py
89 13 1
def colormap()
in lib/utils/colormap.py
88 2 1
def add_embd_triplet_losses_labeled()
in lib/modeling/VGG16_rel_softmaxed_triplet.py
88 20 2
def _sample_rois_pos_neg_for_one_branch()
in lib/roi_data/fast_rcnn_rel.py
82 20 6
def combined_roidb_for_training()
in lib/datasets/roidb_rel.py
78 11 2
def add_VGG16_roi_fc_head_rel_spo_late_fusion()
in lib/modeling/VGG16_rel_softmaxed_triplet.py
73 4 4
def add_visual_embedding()
in lib/modeling/VGG16_rel_softmaxed_triplet.py
72 9 11
def combined_roidb_for_val_test()
in lib/datasets/roidb_rel.py
65 8 1
def add_language_embedding_for_vocab()
in lib/modeling/VGG16_rel_softmaxed_triplet.py
65 4 1
def get_minibatch_blob_names()
in lib/roi_data/minibatch_rel.py
63 9 1
def add_Conv_layer_with_weight_name()
in lib/modeling/detector_rel.py
61 15 11