aws-samples / cloud-experiments
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 58 units with 684 lines of code in units (6.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (291 lines of code)
    • 16 small units (224 lines of code)
    • 32 very small units (169 lines of code)
0% | 0% | 42% | 32% | 24%
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% | 44% | 29% | 25%
tsx0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
api/streamlit_experiments0% | 0% | 63% | 32% | 3%
experiments/notebooks/cloudstory-api0% | 0% | 26% | 33% | 39%
experiments/notebooks/covid0% | 0% | 72% | 0% | 27%
experiments/data-apps/location0% | 0% | 40% | 59% | 0%
experiments/data-apps/covid_insights0% | 0% | 0% | 41% | 58%
experiments/data-apps/rides0% | 0% | 0% | 0% | 100%
experiments/data-apps/wine0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_today_stats()
in experiments/notebooks/covid/covid.py
47 12 1
def list_bucket_contents()
in api/streamlit_experiments/s3.py
36 11 0
def weekly_increase()
in api/streamlit_experiments/covid.py
30 2 1
def list_resources()
in experiments/data-apps/location/location_api.py
29 3 0
def video_persons_result()
in experiments/notebooks/cloudstory-api/cloudstory.py
27 8 1
def list_bucket_contents()
in experiments/notebooks/cloudstory-api/cloudstory.py
26 9 3
def mortality()
in api/streamlit_experiments/covid.py
25 2 1
def video_labels_result()
in experiments/notebooks/cloudstory-api/cloudstory.py
25 5 1
def s3_select()
in api/streamlit_experiments/s3.py
24 7 0
def growth_factor()
in api/streamlit_experiments/covid.py
22 2 1
def s3_select()
in experiments/notebooks/cloudstory-api/cloudstory.py
18 4 3
async function initializeMap()
in experiments/data-apps/location/location_map_component/location_map/frontend/src/LocationMap.tsx
17 2 0
def search_buckets()
in api/streamlit_experiments/s3.py
16 6 0
def list_glue_tables()
in experiments/notebooks/cloudstory-api/cloudstory.py
16 5 2
def double_days()
in api/streamlit_experiments/covid.py
15 3 1
function transformRequest()
in experiments/data-apps/location/location_map_component/location_map/frontend/src/LocationMap.tsx
15 4 2
def athena_query()
in experiments/notebooks/cloudstory-api/cloudstory.py
15 2 3
def growth_scatter()
in api/streamlit_experiments/covid.py
14 1 1
def daily_increase()
in api/streamlit_experiments/covid.py
14 1 1
def show_video()
in experiments/notebooks/cloudstory-api/cloudstory.py
14 3 5