aws-samples / aws-codeguru-profiler-python-demo-application
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 64 units with 498 lines of code in units (48.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (46 lines of code)
    • 11 small units (164 lines of code)
    • 51 very small units (288 lines of code)
0% | 0% | 9% | 32% | 57%
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% | 9% | 32% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sample-demo-flask-app/flaskr0% | 0% | 25% | 38% | 36%
sample-demo-app/aws_python_sample_application0% | 0% | 0% | 29% | 70%
sample-demo-lambda-app0% | 0% | 0% | 55% | 44%
sample-demo-django-app/polls0% | 0% | 0% | 14% | 85%
sample-demo-django-app0% | 0% | 0% | 100% | 0%
sample-demo-flask-app0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_app()
in sample-demo-flask-app/flaskr/__init__.py
23 6 1
def register()
in sample-demo-flask-app/flaskr/auth.py
23 6 0
def update()
in sample-demo-flask-app/flaskr/blog.py
20 4 1
def create()
in sample-demo-flask-app/flaskr/blog.py
19 4 0
def login()
in sample-demo-flask-app/flaskr/auth.py
19 5 0
def run()
in sample-demo-app/aws_python_sample_application/image_processor.py
18 4 1
def lambda_handler()
in sample-demo-lambda-app/lambda_function.py
16 4 2
def _extract_tasks()
in sample-demo-app/aws_python_sample_application/image_processor.py
13 3 1
def vote()
in sample-demo-django-app/polls/views.py
13 3 2
def monochrome_and_upload()
in sample-demo-app/aws_python_sample_application/image_processor.py
12 2 2
def get_post()
in sample-demo-flask-app/flaskr/blog.py
12 4 2
def brighten_and_upload()
in sample-demo-app/aws_python_sample_application/image_processor.py
11 2 2
def main()
in sample-demo-django-app/manage.py
11 2 0
def _list_image_on_s3()
in sample-demo-app/aws_python_sample_application/task_publisher.py
10 2 1
def publish_image_transform_task()
in sample-demo-app/aws_python_sample_application/task_publisher.py
10 3 2
def index()
in sample-demo-flask-app/flaskr/blog.py
10 1 0
def init_db()
in sample-demo-flask-app/flaskr/db.py
10 1 0
def check_prime()
in sample-demo-lambda-app/lambda_function.py
9 5 1
def _upload_images_onto_s3()
in sample-demo-app/aws_python_sample_application/task_publisher.py
9 2 1
def _send_sqs_message()
in sample-demo-app/aws_python_sample_application/task_publisher.py
9 2 2