facebookresearch / you2me
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 35 units with 589 lines of code in units (75.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (149 lines of code)
    • 6 medium size units (212 lines of code)
    • 8 small units (117 lines of code)
    • 19 very small units (111 lines of code)
0% | 25% | 35% | 19% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 34% | 22% | 18% | 24%
cpp0% | 0% | 75% | 22% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
utils0% | 31% | 15% | 19% | 32%
ROOT0% | 39% | 36% | 16% | 6%
calc_homography0% | 0% | 75% | 22% | 2%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def build_vocab()
in utils/build_vocab.py
95 1 4
def main()
in train.py
54 3 1
def main()
in sample.py
50 2 1
static Vec3b computeColor()
in calc_homography/myflow.cpp
48 10 2
int main()
in calc_homography/myflow.cpp
37 5 2
static void drawOpticalFlow()
in calc_homography/myflow.cpp
29 8 4
def __getitem__()
in utils/data_loader.py
24 1 2
def build_annotation()
in utils/build_annotation.py
24 1 1
void saveFlow()
in calc_homography/myflow.cpp
19 3 4
def sample()
in utils/model.py
19 1 5
def getPair()
in utils/data_loader.py
18 2 6
static void showFlow()
in calc_homography/myflow.cpp
15 2 3
def collate_fn()
in utils/data_loader.py
12 2 1
12 3 3
def forward()
in utils/model.py
11 1 2
11 1 3
def draw_joints()
in utils/visualize.py
10 1 2
def forward()
in utils/model.py
10 1 6
def set_axes_equal()
in utils/visualize.py
9 1 1
def load_video()
in sample.py
9 1 3