facebookresearch / self_defeating_improvements
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 20 units with 367 lines of code in units (70.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (112 lines of code)
    • 0 medium complex units (0 lines of code)
    • 1 simple units (17 lines of code)
    • 18 very simple units (238 lines of code)
0% | 30% | 0% | 4% | 64%
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% | 30% | 0% | 4% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
svhn_based_exp0% | 30% | 0% | 4% | 64%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_dataset()
in svhn_based_exp/utils.py
112 27 4
def get_model()
in svhn_based_exp/utils.py
17 10 4
def get_num_classes()
in svhn_based_exp/utils.py
10 5 1
def construct_tensor_dataset()
in svhn_based_exp/utils.py
18 5 6
def get_upstream_model()
in svhn_based_exp/utils.py
18 5 4
def test_epoch()
in svhn_based_exp/utils.py
35 5 6
def set_logger()
in svhn_based_exp/logger.py
18 4 3
def train_epoch()
in svhn_based_exp/utils.py
27 4 7
def test_by_nn()
in svhn_based_exp/utils.py
33 4 5
def get_repre()
in svhn_based_exp/utils.py
11 3 3
def get_dist()
in svhn_based_exp/utils.py
6 3 3
def __init__()
in svhn_based_exp/models.py
5 2 4
def forward()
in svhn_based_exp/models.py
4 2 2
def get_criterion()
in svhn_based_exp/utils.py
6 2 1
def get_upstream_preprocessing()
in svhn_based_exp/utils.py
17 2 5
def __init__()
in svhn_based_exp/models.py
7 1 2
def forward()
in svhn_based_exp/models.py
6 1 2
def get_logger()
in svhn_based_exp/logger.py
2 1 1
def split_test_val()
in svhn_based_exp/utils.py
12 1 1
def get_output_from_model()
in svhn_based_exp/utils.py
3 1 5