aws-samples / amazon-sagemaker-gluonts-entrypoint
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 35 units with 310 lines of code in units (50.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (85 lines of code)
    • 7 small units (88 lines of code)
    • 26 very small units (137 lines of code)
0% | 0% | 27% | 28% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 27% | 28% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/entrypoint0% | 0% | 51% | 23% | 24%
src/entrypoint/gluonts_example0% | 0% | 0% | 48% | 51%
src/gluonts_nb_utils0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
notebooks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in src/entrypoint/train.py
47 9 3
def add_args()
in src/entrypoint/train.py
38 1 1
def model_fn()
in src/entrypoint/inference.py
14 3 2
def jsonify_floats()
in src/entrypoint/inference.py
14 9 1
def mape()
in src/entrypoint/gluonts_example/metrics.py
13 6 3
def log1p_tds()
in src/entrypoint/gluonts_example/util.py
13 3 1
def override_hp()
in src/entrypoint/gluonts_example/util.py
12 5 3
def load_dataset()
in src/entrypoint/train.py
11 2 1
def get_aggregate_metrics()
in src/entrypoint/gluonts_example/evaluator.py
11 3 2
def _write_timeseries()
in src/gluonts_nb_utils/generate_synthetic.py
9 1 0
def get_train_kwargs()
in src/entrypoint/train.py
8 4 2
def _predict_fn()
in src/entrypoint/inference.py
8 2 3
def wmape()
in src/entrypoint/gluonts_example/metrics.py
8 3 3
def __init__()
in src/entrypoint/gluonts_example/evaluator.py
8 1 0
def plot2()
in src/entrypoint/gluonts_example/evaluator.py
8 2 3
def _write_csv()
in src/gluonts_nb_utils/generate_synthetic.py
8 1 0
def plot_prob_forecasts()
in src/entrypoint/gluonts_example/evaluator.py
7 1 5
def freq_name()
in src/entrypoint/gluonts_example/util.py
7 3 1
def fill_dt()
in src/gluonts_nb_utils/__init__.py
7 1 4
def generate_daily_csv()
in src/gluonts_nb_utils/generate_synthetic.py
7 1 8