awslabs / amazon-s3-find-and-forget
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 221 units with 2,755 lines of code in units (23.3% of code).
    • 1 very long units (113 lines of code)
    • 3 long units (194 lines of code)
    • 34 medium size units (1,049 lines of code)
    • 47 small units (738 lines of code)
    • 136 very small units (661 lines of code)
4% | 7% | 38% | 26% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 8% | 34% | 28% | 23%
js0% | 0% | 55% | 18% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend/ecs_tasks/delete_files15% | 0% | 28% | 30% | 25%
backend/lambdas/tasks0% | 35% | 26% | 19% | 18%
backend/lambdas/jobs0% | 0% | 79% | 4% | 15%
frontend/src/components0% | 0% | 62% | 17% | 19%
frontend/src0% | 0% | 91% | 0% | 8%
backend/lambda_layers/decorators0% | 0% | 43% | 29% | 26%
backend/lambdas/data_mappers0% | 0% | 33% | 34% | 32%
backend/lambdas/queue0% | 0% | 24% | 50% | 24%
frontend/src/utils0% | 0% | 15% | 31% | 52%
backend/lambda_layers/boto_utils0% | 0% | 0% | 78% | 21%
backend/lambdas/custom_resources0% | 0% | 0% | 38% | 61%
backend/lambdas/settings0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def execute()
in backend/ecs_tasks/delete_files/main.py
113 20 3
def generate_athena_queries()
in backend/lambdas/tasks/generate_queries.py
86 19 3
def column_mapper()
in backend/lambdas/tasks/generate_queries.py
54 12 1
def handler()
in backend/lambdas/tasks/work_query_queue.py
54 18 2
def list_job_events_handler()
in backend/lambdas/jobs/handlers.py
48 11 2
def make_query()
in backend/lambdas/tasks/execute_query.py
46 8 1
def _update_job()
in backend/lambdas/jobs/stats_updater.py
45 2 2
def _aggregate_stats()
in backend/lambdas/jobs/stats_updater.py
44 10 1
url: docsUrl()
in frontend/src/components/help/NewDataMapper.js
43 4 1
def delete_old_versions()
in backend/ecs_tasks/delete_files/s3.py
43 11 4
url: docsUrl()
in frontend/src/components/help/NewDeletionQueueMatch.js
38 3 1
def validate_mapper()
in backend/lambdas/data_mappers/handlers.py
37 14 1
def write_partitions()
in backend/lambdas/tasks/generate_queries.py
35 3 1
def _update_item()
in backend/lambdas/jobs/status_updater.py
35 6 2
function registerValidSW()
in frontend/src/serviceWorker.js
33 8 2
def handler()
in backend/lambdas/tasks/submit_query_results.py
33 8 2
def delete_matches_from_json_file()
in backend/ecs_tasks/delete_files/json_handler.py
32 11 3
def handler()
in backend/lambdas/tasks/generate_queries.py
32 5 2
def handler()
in backend/lambdas/jobs/stream_processor.py
32 11 2
def process_job()
in backend/lambdas/jobs/stream_processor.py
32 4 1