facebookresearch / DONERF
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 236 units with 3,660 lines of code in units (87.0% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (458 lines of code)
    • 17 medium complex units (919 lines of code)
    • 27 simple units (715 lines of code)
    • 187 very simple units (1,568 lines of code)
0% | 12% | 25% | 19% | 42%
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% | 12% | 25% | 19% | 42%
cpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 15% | 24% | 21% | 37%
src/util0% | 0% | 26% | 9% | 63%
src/native0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def load_config()
in src/evaluate.py
77 37 7
def initialize()
in src/train_data.py
119 33 5
def generate_data()
in src/evaluate.py
110 31 3
def train()
in src/train.py
78 30 1
def render_all_imgs()
in src/plots.py
74 27 3
def __init__()
in src/models.py
53 23 8
def batch()
in src/features.py
66 23 3
def main()
in src/evaluate.py
76 23 0
def pre_train()
in src/train.py
79 22 1
def render_img()
in src/plots.py
64 20 4
def main()
in src/prepare_dataset.py
112 19 0
def color_space_transform()
in src/util/flip_loss.py
96 18 2
def batches()
in src/datasets.py
36 16 2
26 15 5
def evaluate()
in src/evaluate.py
37 15 3
24 14 5
def info_content_weight_map()
in src/util/IW_SSIM_PyTorch.py
86 14 3
def __init__()
in src/models.py
34 13 9
def generate_diff_data()
in src/evaluate.py
37 13 6
def main()
in src/comparison.py
36 12 0