facebookresearch / fastMRI
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 453 units with 5,632 lines of code in units (76.7% of code).
    • 2 very long units (426 lines of code)
    • 18 long units (1,318 lines of code)
    • 45 medium size units (1,352 lines of code)
    • 77 small units (1,135 lines of code)
    • 311 very small units (1,401 lines of code)
7% | 23% | 24% | 20% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 23% | 24% | 20% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
banding_removal/fastmri12% | 13% | 23% | 24% | 25%
fastmri_examples/unet0% | 58% | 35% | 2% | 3%
fastmri_examples/varnet0% | 58% | 34% | 3% | 3%
fastmri/pl_modules0% | 45% | 19% | 17% | 16%
fastmri_examples/cs0% | 40% | 18% | 22% | 18%
fastmri/data0% | 0% | 11% | 15% | 73%
fastmri0% | 0% | 13% | 26% | 60%
fastmri/models0% | 0% | 13% | 23% | 62%
fastmri_examples/zero_filled0% | 0% | 51% | 48% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in banding_removal/fastmri/args.py
296 2 2
def __init__()
in banding_removal/fastmri/data/mri_data.py
130 47 5
def build_args()
in fastmri_examples/varnet/train_varnet_demo.py
84 15 0
def run()
in banding_removal/fastmri/training_loop_mixin.py
83 21 2
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 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 build_args()
in fastmri_examples/unet/unet_reproduce_20201111.py/unet_brain_leaderboard.py
80 11 0
def build_args()
in fastmri_examples/unet/train_unet_demo.py
78 10 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 grid()
in banding_removal/fastmri/common/image_grid.py
75 18 4
def validation_step_end()
in fastmri/pl_modules/mri_module.py
70 13 2
def __call__()
in banding_removal/fastmri/transforms/kspace.py
69 12 6
def run()
in banding_removal/fastmri/spawn_dist.py
68 24 2
def add_data_specific_args()
in fastmri/pl_modules/data_module.py
62 1 1
def validation_epoch_end()
in fastmri/pl_modules/mri_module.py
57 11 2
def add_model_specific_args()
in fastmri/pl_modules/varnet_module.py
55 1 1
def create_arg_parser()
in fastmri_examples/cs/run_bart.py
53 1 0