facebookresearch / SubMix
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 19 units with 196 lines of code in units (82.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (25 lines of code)
    • 7 small units (97 lines of code)
    • 11 very small units (74 lines of code)
0% | 0% | 12% | 49% | 37%
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% | 12% | 49% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 12% | 49% | 37%
Alternative Visuals
Longest Units
Top 19 longest units
Unit# linesMcCabe index# params
def __init__()
in submix.py
25 1 7
def query()
in submix.py
20 6 2
15 3 5
def big_patent_preprocess()
in preprocess-bigpatent.py
15 5 2
14 3 2
def renyiDiv()
in submix.py
11 4 3
def renyi_dp()
in submix.py
11 4 4
11 2 4
10 2 4
10 2 2
8 2 3
8 2 2
7 4 2
def _tensorloading()
in preprocess-bigpatent.py
7 3 1
6 3 4
def _mix()
in submix.py
6 1 5
def mix()
in submix.py
5 1 4
def _get_eps()
in submix.py
5 1 6
def logit2prob()
in submix.py
2 1 1