facebookresearch / fastMRI
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 453 units with 5,632 lines of code in units (76.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (130 lines of code)
    • 18 medium complex units (1,231 lines of code)
    • 38 simple units (1,002 lines of code)
    • 396 very simple units (3,269 lines of code)
0% | 2% | 21% | 17% | 58%
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% | 2% | 21% | 17% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
banding_removal/fastmri0% | 3% | 16% | 12% | 66%
fastmri_examples/varnet0% | 0% | 58% | 34% | 7%
fastmri_examples/unet0% | 0% | 44% | 49% | 6%
fastmri/pl_modules0% | 0% | 30% | 8% | 61%
fastmri0% | 0% | 0% | 23% | 76%
fastmri_examples/cs0% | 0% | 0% | 18% | 81%
fastmri/models0% | 0% | 0% | 13% | 86%
fastmri_examples/zero_filled0% | 0% | 0% | 48% | 51%
fastmri/data0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in banding_removal/fastmri/data/mri_data.py
130 47 5
def run()
in banding_removal/fastmri/spawn_dist.py
68 24 2
def run()
in banding_removal/fastmri/training_loop_mixin.py
83 21 2
def grid()
in banding_removal/fastmri/common/image_grid.py
75 18 4
def start_of_epoch_hook()
in banding_removal/fastmri/learning_rate_mixin.py
40 16 2
def build_args()
in fastmri_examples/varnet/train_varnet_demo.py
84 15 0
def build_args()
in fastmri_examples/varnet/varnet_reproduce_20201111/varnet_brain_leaderboard.py
82 14 0
def build_args()
in fastmri_examples/varnet/varnet_reproduce_20201111/varnet_knee_leaderboard.py
82 14 0
def visualize_dev()
in banding_removal/fastmri/visualization_mixin.py
78 14 2
def compute_stats()
in banding_removal/fastmri/training_loop_mixin.py
78 14 4
def validation_step_end()
in fastmri/pl_modules/mri_module.py
70 13 2
def __init__()
in banding_removal/fastmri/model/classifiers/torchvision_resnet.py
42 13 9
def __init__()
in banding_removal/fastmri/model/classifiers/unpooled_resnet.py
41 13 9
def worker_init_fn()
in fastmri/pl_modules/data_module.py
38 12 1
def __call__()
in banding_removal/fastmri/transforms/kspace.py
69 12 6
def build_args()
in fastmri_examples/unet/unet_reproduce_20201111.py/unet_brain_leaderboard.py
80 11 0
def build_args()
in fastmri_examples/unet/unet_reproduce_20201111.py/unet_knee_mc_leaderboard.py
82 11 0
def build_args()
in fastmri_examples/unet/unet_reproduce_20201111.py/unet_knee_sc_leaderboard.py
82 11 0
def validation_epoch_end()
in fastmri/pl_modules/mri_module.py
57 11 2
def build_args()
in fastmri_examples/unet/train_unet_demo.py
78 10 0