aws-samples / aws-serverless-for-machine-learning-inference
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 15 units with 565 lines of code in units (83.8% of code).
    • 2 very long units (297 lines of code)
    • 1 long units (90 lines of code)
    • 4 medium size units (103 lines of code)
    • 3 small units (47 lines of code)
    • 5 very small units (28 lines of code)
52% | 15% | 18% | 8% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts73% | 22% | 0% | 3% | 0%
py0% | 0% | 63% | 19% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib73% | 22% | 0% | 3% | 0%
container_images/batch_image0% | 0% | 65% | 19% | 15%
lambda_fn/batch_jobs_submitter0% | 0% | 100% | 0% | 0%
lambda_fn/realtime_inf/realtime_fn0% | 0% | 100% | 0% | 0%
lambda_fn/ecr_cleanup0% | 0% | 0% | 50% | 50%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
constructor()
in lib/batch-resources.ts
181 1 3
constructor()
in lib/lambda-resources.ts
116 1 3
constructor()
in lib/ml_serverless-stack.ts
90 1 3
def handler()
in lambda_fn/batch_jobs_submitter/index.py
30 4 2
def get_inference()
in container_images/batch_image/inference.py
26 4 3
def lambda_handler()
in lambda_fn/realtime_inf/realtime_fn/index.py
25 4 2
def resnet_pipeline()
in container_images/batch_image/inference.py
22 5 2
def on_delete()
in lambda_fn/ecr_cleanup/index.py
17 4 1
constructor()
in lib/base-resources.ts
16 1 3
def logMessage()
in container_images/batch_image/inference.py
14 7 3
def on_event()
in lambda_fn/ecr_cleanup/index.py
10 4 2
def main()
in container_images/batch_image/inference.py
6 1 0
def constructMessageFormat()
in container_images/batch_image/inference.py
5 2 4
def on_update()
in lambda_fn/ecr_cleanup/index.py
4 1 1
def on_create()
in lambda_fn/ecr_cleanup/index.py
3 1 1