aws-samples / amazon-sagemaker-hierarchical-forecasting
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 8 units with 121 lines of code in units (68.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (88 lines of code)
    • 1 small units (17 lines of code)
    • 4 very small units (16 lines of code)
0% | 0% | 72% | 14% | 13%
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% | 72% | 14% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code0% | 0% | 65% | 19% | 15%
ROOT0% | 0% | 93% | 0% | 6%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
def prepare_data()
in dataset_prep.py
30 3 1
def train()
in code/train.py
29 2 6
def prepare_data()
in code/dataset_prep.py
29 5 1
def evaluate()
in code/train.py
17 3 4
def parse_args()
in code/train.py
9 1 0
def model_fn()
in code/train.py
3 1 1
def get_region_columns()
in code/dataset_prep.py
2 3 2
def get_region_columns()
in dataset_prep.py
2 3 2