aws-samples / mlops-e2e
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 30 units with 879 lines of code in units (42.4% of code).
    • 2 very long units (347 lines of code)
    • 3 long units (237 lines of code)
    • 6 medium size units (179 lines of code)
    • 3 small units (43 lines of code)
    • 16 very small units (73 lines of code)
39% | 26% | 20% | 4% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts56% | 27% | 14% | 2% | 0%
py0% | 26% | 35% | 10% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/lib73% | 0% | 26% | 0% | 0%
consumers/online/infrastructure51% | 40% | 0% | 8% | 0%
model_deploy/lib0% | 100% | 0% | 0% | 0%
ml_pipeline0% | 51% | 28% | 0% | 20%
src0% | 0% | 42% | 21% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in infrastructure/lib/codePipelineConstruct.ts
244 5 3
constructor()
in consumers/online/infrastructure/lib/websiteConstruct.ts
103 1 3
constructor()
in model_deploy/lib/modelDeploymentStack.ts
88 1 3
constructor()
in consumers/online/infrastructure/lib/websiteAPIConstruct.ts
80 1 3
def main()
in ml_pipeline/run_pipeline.py
69 4 0
def main()
in ml_pipeline/get_pipeline_definition.py
39 4 0
constructor()
in infrastructure/lib/dataSourceConstruct.ts
31 1 2
constructor()
in infrastructure/lib/infrastractureStack.ts
31 1 3
def run_main()
in src/preprocess.py
29 1 0
constructor()
in infrastructure/lib/sageMakerConstruct.ts
25 1 3
def __init__()
in src/preprocess.py
24 1 2
constructor()
in consumers/online/infrastructure/lib/infrastructureStack.ts
16 1 3
def _download_file()
in src/preprocess.py
15 1 4
def input_fn()
in src/transform.py
12 4 2
def get_session()
in ml_pipeline/pipeline.py
10 1 2
def build()
in src/preprocess.py
9 3 1
def get_pipeline()
in ml_pipeline/pipeline.py
7 1 0
def save_model()
in src/preprocess.py
7 1 2
def predict_fn()
in src/transform.py
6 3 2
def process()
in src/preprocess.py
5 1 1