facebookresearch / tbsm
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 29 units with 1,075 lines of code in units (79.3% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (261 lines of code)
    • 6 medium complex units (452 lines of code)
    • 4 simple units (108 lines of code)
    • 17 very simple units (254 lines of code)
0% | 24% | 42% | 10% | 23%
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% | 24% | 42% | 10% | 23%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 28% | 42% | 5% | 23%
tools0% | 0% | 37% | 38% | 23%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def forward()
in tbsm_pytorch.py
68 34 4
def synthetic_experiment()
in tbsm_synthetic.py
193 29 0
def iterate_train_data()
in tbsm_pytorch.py
96 23 11
def build_taobao_train_or_val()
in tbsm_data_pytorch.py
102 21 3
def get_tbsm()
in tbsm_pytorch.py
78 18 2
def train_tbsm()
in tbsm_pytorch.py
65 18 2
def produce_neg_item_hist_with_cate()
in tools/taobao_prepare.py
58 13 2
def build_taobao_test()
in tbsm_data_pytorch.py
53 12 3
def forward()
in tbsm_pytorch.py
33 8 3
def data_wrap()
in tbsm_pytorch.py
7 7 5
def gen_dataset()
in tools/taobao_prepare.py
60 6 5
def __getitem__()
in tbsm_data_pytorch.py
8 6 2
def truncate_and_save()
in tbsm_data_pytorch.py
30 5 9
def test_tbsm()
in tbsm_pytorch.py
27 5 2
def collate_wrapper_tbsm()
in tbsm_data_pytorch.py
22 4 1
def make_tbsm_data_and_loader()
in tbsm_data_pytorch.py
38 3 2
def set_seed()
in tbsm_pytorch.py
10 3 2
def iterate_val_data()
in tbsm_pytorch.py
21 3 4
def remap()
in tools/taobao_prepare.py
19 2 1
def __init__()
in tbsm_data_pytorch.py
11 2 0