facebookresearch / AutoCTR
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 665 units with 8,727 lines of code in units (73.1% of code).
    • 3 very long units (437 lines of code)
    • 26 long units (1,745 lines of code)
    • 105 medium size units (3,410 lines of code)
    • 95 small units (1,465 lines of code)
    • 436 very small units (1,670 lines of code)
5% | 19% | 39% | 16% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 19% | 39% | 16% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
nasrec18% | 8% | 47% | 10% | 14%
scripts25% | 47% | 0% | 24% | 2%
gen-py/block_config0% | 38% | 32% | 11% | 17%
gen-py/config0% | 13% | 46% | 16% | 22%
models0% | 41% | 0% | 19% | 39%
utils0% | 17% | 31% | 30% | 20%
trainers0% | 0% | 34% | 50% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def vec_to_block_config()
in nasrec/base_searcher.py
196 30 3
def random_sample()
in nasrec/base_searcher.py
125 9 1
def preprocess_kdd()
in scripts/preprocess.py
116 33 1
def get_args()
in utils/search_utils.py
93 6 0
def read()
in gen-py/config/ttypes.py
88 38 2
def read()
in gen-py/block_config/ttypes.py
82 39 2
def read()
in gen-py/config/ttypes.py
79 35 2
def read()
in gen-py/config/ttypes.py
78 34 2
def preprocess_avazu()
in scripts/preprocess.py
77 26 1
def mutate_arc()
in nasrec/base_searcher.py
76 15 2
def read()
in gen-py/block_config/ttypes.py
76 36 2
def read()
in gen-py/block_config/ttypes.py
73 34 2
def _init_base_searcher_params()
in nasrec/base_searcher.py
72 20 1
def read()
in gen-py/block_config/ttypes.py
72 34 2
def read()
in gen-py/block_config/ttypes.py
72 34 2
def final_preprocess()
in scripts/preprocess.py
72 13 1
def read()
in gen-py/config/ttypes.py
71 35 2
def _build_final_block()
in models/nas_modules.py
65 15 1
def preprocess_criteo()
in scripts/preprocess.py
65 19 1
def read()
in gen-py/config/ttypes.py
60 30 2