facebookresearch / accentor
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 29 units with 961 lines of code in units (65.8% of code).
    • 5 very long units (724 lines of code)
    • 1 long units (66 lines of code)
    • 2 medium size units (79 lines of code)
    • 1 small units (12 lines of code)
    • 20 very small units (80 lines of code)
75% | 6% | 8% | 1% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py75% | 6% | 8% | 1% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT75% | 6% | 8% | 1% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in gen_delex.py
172 48 0
def main()
in run_multiple_choice.py
170 51 0
def main()
in gen_predict.py
164 55 0
def main()
in run_language_modeling.py
109 29 0
def train()
in run_multiple_choice.py
109 46 4
def evaluate()
in run_multiple_choice.py
66 15 5
def load_and_cache_examples()
in run_multiple_choice.py
48 16 5
def __init__()
in utils_multiple_choice.py
31 8 1
def _create_examples()
in utils_multiple_choice.py
12 2 3
def convert_examples_to_features()
in utils_multiple_choice.py
9 1 0
def get_dataset()
in run_language_modeling.py
8 3 3
def select_field()
in run_multiple_choice.py
8 3 2
def bleuscorer()
in utils.py
7 4 2
def set_seed()
in run_multiple_choice.py
6 2 1
def __init__()
in utils_multiple_choice.py
6 1 6
def set_seed()
in run_generation.py
5 2 1
def __init__()
in utils_multiple_choice.py
4 1 0
def get_train_examples()
in utils_multiple_choice.py
3 1 2
def get_test_examples()
in utils_multiple_choice.py
3 1 2
def get_dev_examples()
in utils_multiple_choice.py
3 1 2