facebookresearch / active-mri-acquisition
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 229 units with 2,434 lines of code in units (61.6% of code).
    • 2 very long units (299 lines of code)
    • 5 long units (306 lines of code)
    • 18 medium size units (542 lines of code)
    • 34 small units (484 lines of code)
    • 170 very small units (803 lines of code)
12% | 12% | 22% | 19% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 12% | 22% | 19% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
activemri/experimental/cvpr19_models46% | 27% | 5% | 16% | 4%
activemri/baselines17% | 0% | 30% | 18% | 33%
activemri/experimental/cvpr19_models/options0% | 76% | 0% | 21% | 1%
activemri/envs0% | 13% | 21% | 5% | 59%
activemri/experimental/cvpr19_models/models0% | 0% | 47% | 19% | 33%
activemri/experimental/cvpr19_models/data0% | 0% | 30% | 34% | 35%
activemri/data0% | 0% | 0% | 46% | 53%
activemri/experimental/cvpr19_models/util0% | 0% | 0% | 25% | 75%
activemri/models0% | 0% | 0% | 43% | 56%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __call__()
in activemri/experimental/cvpr19_models/trainer.py
192 13 1
def _train_dqn_policy()
in activemri/baselines/ddqn.py
107 14 1
def initialize()
in activemri/experimental/cvpr19_models/options/train_options.py
88 5 2
def update()
in activemri/experimental/cvpr19_models/trainer.py
60 10 2
def initialize()
in activemri/experimental/cvpr19_models/options/base_options.py
54 1 2
def inference()
in activemri/experimental/cvpr19_models/trainer.py
53 4 2
def _init_from_config_dict()
in activemri/envs/envs.py
51 10 3
def get_mask_func()
in activemri/experimental/cvpr19_models/data/masking_utils.py
46 8 3
def update_parameters()
in activemri/baselines/ddqn.py
46 7 2
def __call__()
in activemri/baselines/ddqn.py
39 6 1
def _create_dataset()
in activemri/envs/envs.py
37 2 1
def preprocess_inputs()
in activemri/experimental/cvpr19_models/models/fft_utils.py
35 4 4
def forward()
in activemri/experimental/cvpr19_models/models/reconstruction.py
32 5 3
def forward()
in activemri/experimental/cvpr19_models/models/evaluator.py
30 4 4
def load()
in activemri/baselines/replay_buffer.py
30 2 3
def __call__()
in activemri/experimental/cvpr19_models/data/masking_utils.py
28 6 3
def get_target_tensor()
in activemri/experimental/cvpr19_models/models/fft_utils.py
26 6 6
def get_action()
in activemri/baselines/simple_baselines.py
26 8 4
def create_data_loaders()
in activemri/experimental/cvpr19_models/data/__init__.py
25 2 2
def save()
in activemri/baselines/replay_buffer.py
25 2 3