facebookresearch / isc2021
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 71 units with 1,255 lines of code in units (57.0% of code).
    • 2 very long units (280 lines of code)
    • 3 long units (261 lines of code)
    • 10 medium size units (312 lines of code)
    • 9 small units (133 lines of code)
    • 47 very small units (269 lines of code)
22% | 20% | 24% | 10% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py19% | 12% | 23% | 16% | 28%
c26% | 33% | 26% | 2% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
baselines36% | 22% | 12% | 11% | 17%
lear_gist-1.226% | 33% | 26% | 2% | 11%
isc0% | 0% | 29% | 22% | 47%
scripts0% | 0% | 62% | 17% | 20%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in baselines/GeM_baseline.py
145 28 0
void color_prefilt()
in lear_gist-1.2/gist.c
135 13 2
void prefilt()
in lear_gist-1.2/gist.c
94 13 2
def main()
in baselines/gist_baseline.py
90 16 0
int main()
in lear_gist-1.2/compute_gist_stream.c
77 18 2
def compute_metrics_track2()
in scripts/compute_metrics.py
46 8 1
static void color_down_N()
in lear_gist-1.2/gist.c
45 9 4
int main()
in lear_gist-1.2/compute_gist.c
40 10 2
def search_with_capped_res()
in isc/descriptor_matching.py
33 8 4
def find_matches()
in baselines/how_find_matches.py
29 10 1
static void down_N()
in lear_gist-1.2/gist.c
28 6 3
static void fftshift()
in lear_gist-1.2/gist.c
25 7 3
def find_tp_ranks()
in isc/metrics.py
23 6 2
def knn_match_and_make_predictions()
in isc/descriptor_matching.py
22 6 7
def extract_from_image_list()
in baselines/gist_baseline.py
21 5 3
def load_model()
in baselines/GeM_baseline.py
18 5 2
def apply_maxres_IP()
in isc/descriptor_matching.py
17 4 2
16 7 1
def preproc_image()
in baselines/gist_baseline.py
16 3 2
def match_and_make_predictions()
in isc/descriptor_matching.py
15 4 7