microsoft / recommenders
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 718 units with 10,803 lines of code in units (62.7% of code).
    • 6 very long units (812 lines of code)
    • 33 long units (2,164 lines of code)
    • 98 medium size units (3,097 lines of code)
    • 172 small units (2,476 lines of code)
    • 409 very small units (2,254 lines of code)
7% | 20% | 28% | 22% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 20% | 28% | 22% | 20%
cpp0% | 0% | 80% | 0% | 19%
scala0% | 0% | 0% | 65% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
recommenders/models10% | 22% | 31% | 20% | 15%
recommenders/tuning0% | 45% | 19% | 19% | 15%
recommenders/datasets0% | 9% | 23% | 32% | 33%
recommenders/evaluation0% | 9% | 22% | 18% | 49%
contrib/sarplus0% | 18% | 22% | 32% | 26%
recommenders/utils0% | 0% | 23% | 38% | 38%
contrib/azureml_designer_modules0% | 0% | 0% | 34% | 65%
tools0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def call()
in recommenders/models/deeprec/models/sequential/rnn_cell_implement.py
155 17 3
def call()
in recommenders/models/deeprec/models/sequential/rnn_cell_implement.py
152 17 3
def check_nn_config()
in recommenders/models/deeprec/deeprec_utils.py
139 16 1
def solve()
in recommenders/models/rlrmc/conjugate_gradient_ms.py
136 25 5
def _build_fast_CIN()
in recommenders/models/deeprec/models/xDeepFM.py
129 8 5
def check_nn_config()
in recommenders/models/newsrec/newsrec_utils.py
101 11 1
def _build_naml()
in recommenders/models/newsrec/models/naml.py
91 1 1
def load_data_from_file()
in recommenders/models/deeprec/io/sequential_iterator.py
90 10 4
def fit()
in recommenders/models/deeprec/models/base_model.py
86 15 4
def check_type()
in recommenders/models/deeprec/deeprec_utils.py
82 13 1
def svd_training()
in recommenders/tuning/nni/svd_training.py
77 10 1
def _kims_cnn()
in recommenders/models/deeprec/models/dkn.py
73 12 4
def parser_one_line()
in recommenders/models/newsrec/io/mind_all_iterator.py
73 6 2
def fit_transform()
in recommenders/models/lightgbm/lightgbm_utils.py
72 10 2
def load_data_from_file()
in recommenders/models/newsrec/io/mind_all_iterator.py
72 7 3
def ncf_training()
in recommenders/tuning/nni/ncf_training.py
71 9 1
def cal_metric()
in recommenders/models/deeprec/deeprec_utils.py
70 22 3
def load_data_from_file()
in recommenders/models/deeprec/io/dkn_iterator.py
70 5 2
def _fcn_net()
in recommenders/models/deeprec/models/base_model.py
70 3 4
def __init__()
in recommenders/models/deeprec/models/graphrec/lightgcn.py
69 3 4