facebookresearch / mmd
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 90 units with 597 lines of code in units (80.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 3 medium size units (68 lines of code)
    • 11 small units (151 lines of code)
    • 75 very small units (327 lines of code)
0% | 8% | 11% | 25% | 54%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 11% | 25% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
rules0% | 13% | 6% | 35% | 45%
ROOT0% | 0% | 21% | 6% | 71%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def generate_conjuncts()
in rules/conjuncts.py
51 17 4
def implies()
in rules/predicate.py
24 14 2
22 8 3
def _print_rule()
in diagnoser.py
22 1 4
def filter()
in rules/predicate.py
17 5 5
def pass_threshold()
in rules/ruleset.py
16 3 2
def equi_freq()
in rules/predicate.py
16 5 2
def check_useless()
in rules/rule.py
15 13 2
def eval()
in rules/rule.py
14 2 2
def print()
in diagnoser.py
14 3 2
13 3 2
12 4 4
def equi_width()
in rules/predicate.py
12 2 2
def eval()
in rules/predicate.py
11 5 2
def generate()
in rules/predicate.py
11 5 5
def time_log()
in timing.py
10 1 1
def implies()
in rules/rule.py
10 5 2
def get_worst_rule()
in rules/conjuncts.py
10 4 2
def get_eval_result()
in rules/rule.py
9 2 2
def is_irrelevant()
in rules/conjuncts.py
9 5 3