apple / ml-gsn
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 167 units with 2,139 lines of code in units (65.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (98 lines of code)
    • 19 simple units (622 lines of code)
    • 146 very simple units (1,419 lines of code)
0% | 0% | 4% | 29% | 66%
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% | 4% | 29% | 66%
cpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models0% | 0% | 7% | 25% | 66%
datasets0% | 0% | 0% | 69% | 30%
ROOT0% | 0% | 0% | 100% | 0%
utils0% | 0% | 0% | 12% | 87%
builders0% | 0% | 0% | 75% | 24%
options0% | 0% | 0% | 52% | 47%
models/op0% | 0% | 0% | 0% | 100%
notebooks0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def backproject()
in models/backprojection_utils.py
54 11 9
def generate()
in models/gsn.py
44 11 3
def DiffAugment()
in models/diff_augment.py
23 10 4
def __init__()
in models/generator.py
67 10 7
def sample_local_latents()
in models/generator.py
23 9 3
def forward()
in models/generator.py
72 8 4
def build_dataloader()
in builders/builders.py
34 7 2
def get_trajectory_Rt()
in datasets/replica.py
25 7 1
def __getitem__()
in datasets/replica.py
61 7 2
def get_trajectory_Rt()
in datasets/vizdoom.py
25 7 1
def __getitem__()
in datasets/vizdoom.py
53 7 2
def query_network()
in models/generator.py
16 7 4
def parse()
in options/base_config.py
23 7 3
def convert_type()
in utils/fid.py
8 7 2
def torch_cov()
in utils/fid.py
27 7 2
def process_latents()
in models/generator.py
11 6 2
def process_latents()
in models/generator.py
9 6 2
def __init__()
in models/layers.py
16 6 5
def forward()
in models/layers.py
35 6 3
def forward()
in models/losses.py
40 6 7