facebookresearch / unbiased-teacher
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 74 units with 1,143 lines of code in units (56.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (214 lines of code)
    • 19 medium size units (543 lines of code)
    • 11 small units (166 lines of code)
    • 41 very small units (220 lines of code)
0% | 18% | 47% | 14% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 18% | 47% | 14% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ubteacher/data0% | 34% | 43% | 8% | 13%
ubteacher/engine0% | 16% | 46% | 21% | 15%
ubteacher/checkpoint0% | 0% | 100% | 0% | 0%
ubteacher/modeling0% | 0% | 27% | 19% | 52%
ubteacher0% | 0% | 100% | 0% | 0%
ROOT0% | 0% | 77% | 0% | 22%
ubteacher/solver0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_step_full_semisup()
in ubteacher/engine/trainer.py
88 16 1
63 12 2
def __call__()
in ubteacher/data/dataset_mapper.py
63 14 2
44 8 2
def build_hooks()
in ubteacher/engine/trainer.py
40 10 1
def _load_model()
in ubteacher/checkpoint/detection_checkpoint.py
35 12 2
def _init_box_head()
in ubteacher/modeling/roi_heads/roi_heads.py
33 5 3
def __init__()
in ubteacher/data/dataset_mapper.py
32 7 3
def __iter__()
in ubteacher/data/common.py
31 10 1
def add_ubteacher_config()
in ubteacher/config.py
29 1 1
def _do_loss_eval()
in ubteacher/engine/hooks.py
29 12 1
def build_hooks()
in ubteacher/engine/trainer.py
29 5 1
def build_strong_augmentation()
in ubteacher/data/detection_utils.py
27 2 2
def __init__()
in ubteacher/engine/trainer.py
27 7 2
def main()
in train_net.py
27 5 1
def build_detection_test_loader()
in ubteacher/data/build.py
25 3 3
def __init__()
in ubteacher/engine/trainer.py
24 3 2
def run_step()
in ubteacher/engine/trainer.py
23 5 1
def _write_metrics()
in ubteacher/engine/trainer.py
23 13 2
def _write_metrics()
in ubteacher/engine/trainer.py
23 13 2