facebookresearch / NSVF
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 500 units with 5,387 lines of code in units (75.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (46 lines of code)
    • 27 medium complex units (1,374 lines of code)
    • 27 simple units (612 lines of code)
    • 445 very simple units (3,355 lines of code)
0% | <1% | 25% | 11% | 62%
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% | <1% | 28% | 12% | 58%
h0% | 0% | 0% | 0% | 100%
cpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fairnr/tasks0% | 18% | 37% | 0% | 43%
fairnr/modules0% | 0% | 24% | 7% | 67%
fairnr_cli0% | 0% | 63% | 23% | 12%
fairnr/data0% | 0% | 23% | 15% | 61%
fairnr0% | 0% | 66% | 0% | 33%
fairnr/criterions0% | 0% | 32% | 9% | 57%
fairnr/models0% | 0% | 6% | 13% | 80%
fairnr/clib0% | 0% | 0% | 31% | 68%
fairnr/clib/include0% | 0% | 0% | 0% | 100%
fairnr/clib/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train_step()
in fairnr/tasks/neural_rendering.py
46 28 7
def __init__()
in fairnr/data/shape_dataset.py
87 25 17
def forward_chunk()
in fairnr/modules/renderer.py
83 23 11
def main()
in fairnr_cli/validate.py
87 23 2
def __init__()
in fairnr/tasks/neural_rendering.py
55 22 2
def main()
in fairnr_cli/train.py
56 21 2
def load_dataset()
in fairnr/tasks/neural_rendering.py
37 18 3
def generate()
in fairnr/renderer.py
77 18 4
def __init__()
in fairnr/modules/encoder.py
66 18 5
def export_voxels()
in fairnr/modules/encoder.py
36 18 2
def forward()
in fairnr/modules/field.py
53 17 4
def compute_loss()
in fairnr/criterions/rendering_loss.py
58 17 5
def add_eval_scores()
in fairnr/models/fairnr_model.py
45 15 9
def _main()
in fairnr_cli/render_multigpu.py
71 15 2
def __init__()
in fairnr/data/shape_dataset.py
40 14 6
def build_feature_field()
in fairnr/modules/field.py
37 13 2
def sample_pixel_from_image()
in fairnr/data/data_utils.py
53 13 8
def launch_cluster()
in fairnr_cli/launch_slurm.py
80 13 2
def __init__()
in fairnr/renderer.py
54 12 10
def save_images()
in fairnr/renderer.py
15 12 4