facebookresearch / CovidPrognosis
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 106 units with 1,128 lines of code in units (62.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (71 lines of code)
    • 8 medium size units (276 lines of code)
    • 31 small units (437 lines of code)
    • 66 very small units (344 lines of code)
0% | 6% | 24% | 38% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 24% | 38% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cp_examples/sip_finetune0% | 25% | 27% | 36% | 10%
cp_examples/mip_finetune0% | 0% | 35% | 52% | 11%
cp_examples/moco_pretrain0% | 0% | 67% | 0% | 32%
covidprognosis/data0% | 0% | 7% | 38% | 54%
covidprognosis/models0% | 0% | 0% | 56% | 43%
covidprognosis/plmodules0% | 0% | 0% | 44% | 55%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def build_args()
in cp_examples/sip_finetune/train_sip.py
71 14 1
def cli_main()
in cp_examples/sip_finetune/train_sip.py
48 1 1
def build_args()
in cp_examples/moco_pretrain/train_moco.py
47 11 1
def build_args()
in cp_examples/mip_finetune/train_mip.py
37 5 1
def cli_main()
in cp_examples/mip_finetune/train_mip.py
34 1 1
def cli_main()
in cp_examples/moco_pretrain/train_moco.py
33 1 1
def validation_epoch_end()
in cp_examples/sip_finetune/sip_finetune.py
28 5 2
def validation_epoch_end()
in cp_examples/mip_finetune/mip_model.py
26 4 2
def __getitem__()
in covidprognosis/data/mimic_cxr.py
23 4 2
def __dataloader()
in covidprognosis/plmodules/xray_datamodule.py
19 3 2
def add_model_specific_args()
in cp_examples/mip_finetune/mip_model.py
19 1 1
def fetch_pos_weights()
in cp_examples/sip_finetune/train_sip.py
18 8 5
def default_labels()
in covidprognosis/data/chexpert.py
17 1 0
def default_labels()
in covidprognosis/data/nih_chest_xrays.py
17 1 0
def default_labels()
in covidprognosis/data/mimic_cxr.py
17 1 0
def forward()
in covidprognosis/models/moco_model.py
16 3 3
def load_pretrained_model()
in cp_examples/mip_finetune/mip_model.py
16 4 2
def training_step()
in cp_examples/mip_finetune/mip_model.py
16 2 3
def training_step()
in cp_examples/sip_finetune/sip_finetune.py
16 2 3
def __getitem__()
in covidprognosis/data/nih_chest_xrays.py
14 6 2