aws-samples / simple-forecast-solution
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 112 units with 2,709 lines of code in units (73.1% of code).
    • 3 very long units (841 lines of code)
    • 7 long units (422 lines of code)
    • 24 medium size units (738 lines of code)
    • 31 small units (438 lines of code)
    • 47 very small units (270 lines of code)
31% | 15% | 27% | 16% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py31% | 15% | 27% | 16% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/cdk97% | 0% | 0% | 0% | 2%
afa21% | 7% | 41% | 15% | 13%
afa/app0% | 33% | 18% | 25% | 22%
cdk/cdk/afc_lambdas0% | 24% | 51% | 24% | 0%
cdk/cdk/afc_lambdas/postprocess0% | 0% | 71% | 28% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in cdk/cdk/stack.py
411 2 4
def __init__()
in cdk/cdk/bootstrap.py
272 2 4
158 1 0
70 6 0
def prepare_handler()
in cdk/cdk/afc_lambdas/index.py
66 1 2
def prepare_handler()
in cdk/cdk/afc_lambdas/prepare.py
66 1 2
def run_cv_select()
in afa/core.py
58 10 7
55 6 0
def make_df_top()
in afa/app/app.py
54 5 7
def download_afc_files()
in afa/app/app.py
53 4 0
def make_ml_df_top()
in afa/app/app.py
49 5 7
def create_predictor_handler()
in cdk/cdk/afc_lambdas/index.py
45 1 2
def create_predictor_handler()
in cdk/cdk/afc_lambdas/create_predictor.py
45 1 2
def forecaster()
in afa/core.py
37 9 1
37 3 2
def run_cv()
in afa/core.py
37 7 8
35 6 2
def delete_afc_resources_handler()
in cdk/cdk/afc_lambdas/delete_resources.py
34 1 2
def delete_afc_resources_handler()
in cdk/cdk/afc_lambdas/index.py
34 1 2
def run_pipeline()
in afa/core.py
34 9 8