microsoft / recommenders
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 718 units with 10,803 lines of code in units (62.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 24 medium complex units (1,706 lines of code)
    • 54 simple units (1,999 lines of code)
    • 640 very simple units (7,098 lines of code)
0% | 0% | 15% | 18% | 65%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 15% | 18% | 65%
cpp0% | 0% | 41% | 39% | 19%
scala0% | 0% | 0% | 19% | 80%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
recommenders/models0% | 0% | 17% | 18% | 64%
recommenders/datasets0% | 0% | 13% | 23% | 63%
contrib/sarplus0% | 0% | 29% | 21% | 48%
recommenders/evaluation0% | 0% | 9% | 0% | 90%
recommenders/utils0% | 0% | 9% | 16% | 74%
recommenders/tuning0% | 0% | 0% | 45% | 54%
contrib/azureml_designer_modules0% | 0% | 0% | 0% | 100%
tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def solve()
in recommenders/models/rlrmc/conjugate_gradient_ms.py
136 25 5
def cal_metric()
in recommenders/models/deeprec/deeprec_utils.py
70 22 3
def fit()
in contrib/sarplus/python/pysarplus/SARPlus.py
57 18 2
def call()
in recommenders/models/deeprec/models/sequential/rnn_cell_implement.py
152 17 3
def call()
in recommenders/models/deeprec/models/sequential/rnn_cell_implement.py
155 17 3
def check_nn_config()
in recommenders/models/deeprec/deeprec_utils.py
139 16 1
def check_type()
in recommenders/models/newsrec/newsrec_utils.py
53 16 1
def fit()
in recommenders/models/deeprec/models/base_model.py
86 15 4
def _data_generating()
in recommenders/datasets/amazon_reviews.py
66 14 5
def transform()
in recommenders/datasets/pandas_df_utils.py
38 14 2
def parser_one_line()
in recommenders/models/deeprec/io/sequential_iterator.py
60 14 2
def _create_vocab()
in recommenders/datasets/amazon_reviews.py
55 13 4
def check_type()
in recommenders/models/deeprec/deeprec_utils.py
82 13 1
def _get_initializer()
in recommenders/models/deeprec/models/base_model.py
45 12 1
def _kims_cnn()
in recommenders/models/deeprec/models/dkn.py
73 12 4
def fit()
in recommenders/models/ncf/ncf_singlenode.py
26 12 2
def fit()
in recommenders/models/sar/sar_singlenode.py
63 12 2
def get_cudnn_version()
in recommenders/utils/gpu_utils.py
38 12 0
std::vector predict()
in contrib/sarplus/python/src/pysarplus.cpp
35 11 4
def _check_column_dtypes_diversity_serendipity()
in recommenders/evaluation/python_evaluation.py
61 11 1