awslabs / gluon-ts
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 3,261 units with 23,028 lines of code in units (43.0% of code).
    • 5 very long units (761 lines of code)
    • 25 long units (1,625 lines of code)
    • 126 medium size units (3,664 lines of code)
    • 410 small units (5,940 lines of code)
    • 2,695 very small units (11,038 lines of code)
3% | 7% | 15% | 25% | 47%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 7% | 15% | 25% | 47%
R0% | 0% | 0% | 65% | 34%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/gluonts/nursery4% | 12% | 14% | 24% | 45%
src/gluonts/model4% | 8% | 19% | 31% | 36%
src/gluonts/dataset10% | 3% | 15% | 25% | 44%
src/gluonts/core0% | 17% | 23% | 8% | 50%
src/gluonts/torch0% | 7% | 20% | 16% | 55%
src/gluonts/mx0% | 0% | 9% | 23% | 67%
src/gluonts/transform0% | 0% | 17% | 32% | 50%
src/gluonts0% | 0% | 38% | 13% | 48%
src/gluonts/shell0% | 0% | 13% | 42% | 44%
ROOT0% | 0% | 57% | 14% | 28%
src/gluonts/testutil0% | 0% | 27% | 11% | 61%
src/gluonts/time_feature0% | 0% | 14% | 23% | 61%
src/gluonts/evaluation0% | 0% | 0% | 23% | 76%
evaluations0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def calculate_dataset_statistics()
in src/gluonts/dataset/stat.py
215 33 1
def calculate_dataset_statistics()
in src/gluonts/nursery/SCott/pts/dataset/stat.py
183 27 1
def create_transformation()
in src/gluonts/model/tft/_estimator.py
149 10 1
def create_transformation()
in src/gluonts/model/san/_estimator.py
110 8 1
def create_transformation()
in src/gluonts/nursery/SCott/pts/model/deepvar/deepvar_estimator.py
104 9 1
def create_transformation()
in src/gluonts/nursery/SCott/pts/model/deepar/deepar_estimator.py
89 9 2
def create_transformation()
in src/gluonts/model/seq2seq/_forking_estimator.py
84 15 1
def make_timeseries()
in src/gluonts/dataset/artificial/_base.py
82 12 2
def make_timeseries()
in src/gluonts/nursery/SCott/pts/dataset/artificial.py
82 12 2
def create_transformation()
in src/gluonts/nursery/SCott/pts/model/transformer/transformer_estimator.py
80 7 1
def create_transformation()
in src/gluonts/model/deepar/_estimator.py
69 7 1
def stratified_train_model()
in src/gluonts/nursery/SCott/pts/model/estimator.py
69 1 2
def get_mixed_pattern()
in src/gluonts/nursery/SCott/preprocess_data.py
68 9 2
def make_features()
in src/gluonts/model/rotbaum/_preprocess.py
65 13 3
def get_mixed_pattern()
in src/gluonts/nursery/SCott/dataset_tools/synthetic.py
65 9 2
def predict()
in src/gluonts/model/predictor.py
64 16 3
def preprocess_from_single_ts()
in src/gluonts/model/rotbaum/_preprocess.py
64 10 2
def create_transformation()
in src/gluonts/torch/model/deepar/estimator.py
64 7 1
def generate_lstnet_dataset()
in src/gluonts/nursery/SCott/pts/dataset/repository/_lstnet.py
64 6 2
def train_model()
in src/gluonts/nursery/SCott/pts/model/estimator.py
62 1 2