pytorch / ignite
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 860 units with 5,901 lines of code in units (62.1% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (296 lines of code)
    • 38 medium size units (1,085 lines of code)
    • 116 small units (1,576 lines of code)
    • 701 very small units (2,944 lines of code)
0% | 5% | 18% | 26% | 49%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 18% | 26% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ignite/distributed0% | 13% | 8% | 20% | 58%
ignite/handlers0% | 8% | 27% | 26% | 38%
ignite/engine0% | 8% | 20% | 21% | 49%
ignite/metrics0% | 0% | 20% | 20% | 59%
ignite/contrib0% | 0% | 13% | 36% | 49%
assets/tldr0% | 0% | 25% | 62% | 12%
ignite0% | 0% | 0% | 66% | 33%
ignite/base0% | 0% | 0% | 84% | 15%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _setup_ddp_vars_from_slurm_env()
in ignite/distributed/comp_models/native.py
62 15 2
def __call__()
in ignite/handlers/checkpoint.py
61 17 2
def auto_dataloader()
in ignite/distributed/auto.py
60 20 2
def _run_once_on_dataset()
in ignite/engine/engine.py
60 23 1
def write_results()
in ignite/handlers/time_profilers.py
53 2 2
def print_results()
in ignite/handlers/time_profilers.py
49 7 2
def __init__()
in ignite/handlers/param_scheduler.py
42 19 4
def update()
in ignite/metrics/recall.py
40 9 2
def update()
in ignite/metrics/precision.py
40 9 2
def get_results()
in ignite/handlers/time_profilers.py
39 8 1
def _internal_run()
in ignite/engine/engine.py
38 9 1
def __init__()
in ignite/contrib/handlers/clearml_logger.py
37 9 2
def update()
in ignite/metrics/ssim.py
35 7 2
def _setup_engine()
in ignite/engine/deterministic.py
34 17 1
def _log_lr_and_loss()
in ignite/handlers/lr_finder.py
34 12 5
def __init__()
in ignite/handlers/time_profilers.py
34 1 1
def __call__()
in ignite/contrib/handlers/clearml_logger.py
32 5 4
def completed()
in ignite/contrib/metrics/gpu_info.py
31 10 3
def sync_all_reduce()
in ignite/metrics/metric.py
30 9 1
def _check_type()
in ignite/metrics/accuracy.py
30 8 2