aws-samples / copilot-primer-workshop
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 14 units with 82 lines of code in units (16.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (26 lines of code)
    • 12 very small units (56 lines of code)
0% | 0% | 0% | 31% | 68%
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% | 0% | 50% | 50%
ts0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend0% | 0% | 0% | 50% | 50%
frontend/webapp/src/modules0% | 0% | 0% | 0% | 100%
frontend/webapp/src/components0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
def update_todo()
in code/backend/app.py
14 3 1
def create_todo()
in code/backend/app.py
12 3 0
addTask()
in code/frontend/webapp/src/modules/tasksModule.ts
9 1 2
export function stringToBool()
in code/frontend/webapp/src/components/util.ts
7 3 1
def convert_from_response()
in code/backend/app.py
7 1 1
doneTask()
in code/frontend/webapp/src/modules/tasksModule.ts
6 2 2
def get_alltodo()
in code/backend/app.py
6 1 0
deleteTask()
in code/frontend/webapp/src/modules/tasksModule.ts
5 1 2
def delete_todo()
in code/backend/app.py
5 1 1
replaceTasks()
in code/frontend/webapp/src/modules/tasksModule.ts
3 1 2
def hello_world()
in code/backend/app.py
2 1 0
def receive_health_check()
in code/backend/app.py
2 1 0
def create_table()
in code/backend/app.py
2 1 0
def delete_table()
in code/backend/app.py
2 1 0