facebookresearch / hypernymysuite
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 70 units with 595 lines of code in units (79.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (284 lines of code)
    • 8 small units (123 lines of code)
    • 52 very small units (188 lines of code)
0% | 0% | 47% | 20% | 31%
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% | 47% | 20% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
hypernymysuite0% | 0% | 39% | 23% | 36%
ROOT0% | 0% | 69% | 12% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in main.py
39 14 0
def gather_metrics()
in compile_table.py
37 6 1
def main()
in compile_table.py
33 8 0
def __load_sparse_matrix()
in hypernymysuite/reader.py
31 7 2
def bibless_setup()
in hypernymysuite/evaluation.py
26 4 1
def correlation_setup()
in hypernymysuite/evaluation.py
25 2 2
def __init__()
in hypernymysuite/evaluation.py
24 5 4
def bless_directionality_setup()
in hypernymysuite/evaluation.py
24 1 1
def siege_setup()
in hypernymysuite/evaluation.py
24 3 2
def wbless_setup()
in hypernymysuite/evaluation.py
21 3 1
def read_json_log()
in compile_table.py
20 6 1
def read_sparse_matrix()
in hypernymysuite/reader.py
17 6 3
def __init__()
in hypernymysuite/unsup.py
16 3 3
def __init__()
in hypernymysuite/base.py
16 8 2
def __init__()
in hypernymysuite/unsup.py
15 4 3
def compute_row_entropy()
in hypernymysuite/unsup.py
14 3 2
def __init__()
in hypernymysuite/pattern.py
13 1 2
def all_evaluations()
in hypernymysuite/evaluation.py
12 3 2
def __try_three_columns()
in hypernymysuite/reader.py
10 4 1
def __flatten_dict()
in compile_table.py
9 4 2