facebookresearch / flores
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 34 units with 514 lines of code in units (84.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (134 lines of code)
    • 5 medium size units (154 lines of code)
    • 8 small units (127 lines of code)
    • 19 very small units (99 lines of code)
0% | 26% | 29% | 24% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 26% | 29% | 24% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
floresv1/scripts0% | 40% | 27% | 13% | 18%
dynalab0% | 0% | 34% | 44% | 20%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in floresv1/scripts/spm_encode.py
70 19 0
def main()
in floresv1/scripts/translate.py
64 14 0
def main()
in floresv1/scripts/train.py
38 6 0
def initialize()
in dynalab/handler.py
37 2 2
def handle()
in dynalab/handler.py
27 7 2
def main()
in floresv1/scripts/indic_norm_tok.py
27 3 0
def main()
in floresv1/scripts/spm_decode.py
25 7 0
def translate_files_slurm()
in floresv1/scripts/translate.py
20 7 3
def preprocess()
in dynalab/handler.py
18 5 2
def handle_mini_batch()
in dynalab/handler.py
18 1 2
def deserialize()
in dynalab/handler.py
17 7 1
def local_test()
in dynalab/handler.py
17 3 0
def train()
in floresv1/scripts/train.py
13 3 5
def postprocess()
in dynalab/handler.py
12 3 3
def translate_files()
in floresv1/scripts/translate.py
12 4 3
def preprocess_one()
in dynalab/handler.py
10 1 2
def main()
in floresv1/scripts/shuf.py
10 4 0
def build_bt_databin()
in floresv1/scripts/train.py
10 2 5
def translate()
in floresv1/scripts/translate.py
8 1 1
def translate_files_local()
in floresv1/scripts/translate.py
8 4 2