facebookresearch / LASER
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,106 lines of code in units (48.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 21 medium size units (673 lines of code)
    • 16 small units (241 lines of code)
    • 34 very small units (192 lines of code)
0% | 0% | 60% | 21% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 60% | 21% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source0% | 0% | 61% | 17% | 21%
source/lib0% | 0% | 55% | 37% | 7%
tasks/CCMatrix0% | 0% | 70% | 0% | 29%
docker0% | 0% | 90% | 0% | 9%
tasks/bucc0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def vectorize()
in docker/app.py
50 5 0
def dl_file()
in tasks/CCMatrix/dl_cc_matrix.py
49 10 3
def SplitLines()
in source/lib/text_processing.py
42 9 3
def IndexTextOpen()
in source/lib/indexing.py
41 8 1
def forward()
in source/embed.py
38 8 3
def __init__()
in source/nli.py
38 10 8
def TestCorpus()
in source/nli.py
34 10 5
def __init__()
in source/sent_classif.py
33 9 7
def Token()
in source/lib/text_processing.py
32 15 9
def IndexSearchMultiple()
in source/lib/indexing.py
32 11 5
def sort_files()
in tasks/CCMatrix/dl_cc_matrix.py
30 6 3
def LoadDataNLI()
in source/nli.py
30 5 8
def JoinEmbed()
in source/lib/text_processing.py
29 6 4
def _make_batches()
in source/embed.py
28 11 2
def transpose_file()
in tasks/CCMatrix/dl_cc_matrix.py
26 7 2
def validate()
in tasks/CCMatrix/dl_cc_matrix.py
26 8 2
def knnGPU()
in source/mine_bitexts.py
25 5 4
def TextLoadUnify()
in source/mine_bitexts.py
24 6 2
def TestCorpus()
in source/sent_classif.py
23 5 4
def MarginAbs()
in source/paraphrase.py
22 12 5