aws-samples / aws-proton-sample-lambda-crud-service
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 45 units with 509 lines of code in units (58.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 9 medium size units (257 lines of code)
    • 6 small units (82 lines of code)
    • 30 very small units (170 lines of code)
0% | 0% | 50% | 16% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 0% | 50% | 16% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 50% | 16% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
self.list_tasks
in src/task.rb
36 5 2
list_task
in src/api.rb
31 4 2
create_task
in src/api.rb
31 4 2
get_task
in src/api.rb
31 4 2
update_task
in src/api.rb
31 4 2
delete_task
in src/api.rb
30 4 2
self.create_task
in src/task.rb
24 3 3
self.update_task
in src/task.rb
22 7 4
initialize
in src/shapes.rb
21 4 1
initialize
in src/shapes.rb
16 3 1
valid?
in src/shapes.rb
16 4 0
update_task
in src/app.rb
13 2 1
initialize
in src/shapes.rb
13 4 1
create_task
in src/app.rb
12 2 1
to_json
in src/task.rb
12 1 1
list_tasks
in src/app.rb
10 2 1
get_task
in src/app.rb
10 2 1
delete_task
in src/app.rb
10 2 1
valid?
in src/shapes.rb
10 3 0
self.generate
in src/pagination_token.rb
9 1 1