pulibrary / orangelight

PUL Blacklight Project (Ruby 3.1.0, Rails 7.1.4)
21 stars 7 forks source link

Produce debride tool report for the requests codebase #4176

Closed kevinreiss closed 1 month ago

kevinreiss commented 2 months ago

What maintenance needs to be done?

We have a quite a few unused methods in the Requests Codebase.

Level of urgency

Why is this maintenance needed?

Acceptance criteria

Implementation notes, if any

Debride tool: https://github.com/seattlerb/debride.

From the report ignore:

Requests::EmptyRequestDecorator
  format_brief_record_display         app/models/requests/empty_request_decorator.rb:4 (1)
  non_requestable_mesage              app/models/requests/empty_request_decorator.rb:4 (1)
  requestable?                        app/models/requests/empty_request_decorator.rb:17-19 (3)
illiad_request_parameters           app/models/requests/illiad.rb:26-31 (6)
  illiad_request_url                  app/models/requests/illiad.rb:20-24 (5)
patron_group                        app/models/requests/patron.rb:42-44 (3)
all_items_online?                   app/models/requests/request.rb:107-109 (3)
default_pick_ups                    app/models/requests/request.rb:20 (1)

We went through the report and stopped at:

Requests::Request isbn_numbers

We still have to go through:

isbn_numbers                        app/models/requests/request.rb:174-176 (3)
  isbn_numbers?                       app/models/requests/request.rb:166-172 (7)
  requestable?                        app/models/requests/request.rb:57-59 (3)
  single_aeon_requestable?            app/models/requests/request.rb:61-63 (3)
  user_name=                          app/models/requests/request.rb:7 (1)

Requests::RequestDecorator
  alma_provider_item_unavailable?     app/models/requests/request_decorator.rb:116-118 (3)
  alma_provider_on_shelf_item_available? app/models/requests/request_decorator.rb:112-114 (3)
  any_will_submit_via_form?           app/models/requests/request_decorator.rb:60-63 (4)
  format_brief_record_display         app/models/requests/request_decorator.rb:48-58 (11)
  hidden_fields                       app/models/requests/request_decorator.rb:38-45 (8)
  location_label                      app/models/requests/request_decorator.rb:92-102 (11)
  non_requestable_mesage              app/models/requests/request_decorator.rb:14 (1)
  only_aeon?                          app/models/requests/request_decorator.rb:88-90 (3)
  patron_message                      app/models/requests/request_decorator.rb:32-36 (5)
  single_item_request?                app/models/requests/request_decorator.rb:84-86 (3)

Requests::Requestable
  ask_me?                             app/models/requests/requestable.rb:203-205 (3)
  can_be_delivered?                   app/models/requests/requestable.rb:106-108 (3)
  item_location_code                  app/models/requests/requestable.rb:219-225 (7)
  lewis?                              app/models/requests/requestable.rb:86-88 (3)
  location_label                      app/models/requests/requestable.rb:212-217 (6)
  open?                               app/models/requests/requestable.rb:62-64 (3)
  pageable?                           app/models/requests/requestable.rb:164-166 (3)
  pending?                            app/models/requests/requestable.rb:136-140 (5)
  pick_up_locations                   app/models/requests/requestable.rb:168-175 (8)
  plasma?                             app/models/requests/requestable.rb:90-92 (3)
  resource_shared?                    app/models/requests/requestable.rb:265-267 (3)
  urls                                app/models/requests/requestable.rb:159-162 (4)
  use_restriction?                    app/models/requests/requestable.rb:114-116 (3)

Requests::Requestable::Item
  barcode?                            app/models/requests/requestable/item.rb:118-120 (3)
  copy_number                         app/models/requests/requestable/item.rb:30-32 (3)
  copy_value                          app/models/requests/requestable/item.rb:34-41 (8)
  cron_value                          app/models/requests/requestable/item.rb:26-28 (3)
  description                         app/models/requests/requestable/item.rb:17-19 (3)
  hold_request?                       app/models/requests/requestable/item.rb:63-65 (3)
  inaccessible?                       app/models/requests/requestable/item.rb:59-61 (3)
  missing?                            app/models/requests/requestable/item.rb:92-94 (3)
  pick_up_location_code               app/models/requests/requestable/item.rb:9-11 (3)
  pick_up_location_id                 app/models/requests/requestable/item.rb:4-6 (3)

Requests::Requestable::NullItem
  barcode?                            app/models/requests/requestable/null_item.rb:104-106 (3)
  copy_value                          app/models/requests/requestable/null_item.rb:40-42 (3)
  cron_value                          app/models/requests/requestable/null_item.rb:36-38 (3)
  hold_request?                       app/models/requests/requestable/null_item.rb:60-62 (3)
  inaccessible?                       app/models/requests/requestable/null_item.rb:56-58 (3)
  missing?                            app/models/requests/requestable/null_item.rb:84-86 (3)
  pick_up_location_code               app/models/requests/requestable/null_item.rb:24-26 (3)
  pick_up_location_id                 app/models/requests/requestable/null_item.rb:20-22 (3)

Requests::RequestableDecorator
  aeon_url                            app/models/requests/requestable_decorator.rb:121-128 (8)
  create_fill_in_requestable          app/models/requests/requestable_decorator.rb:92-96 (5)
  delivery_location_code              app/models/requests/requestable_decorator.rb:141-151 (11)
  delivery_location_label             app/models/requests/requestable_decorator.rb:130-139 (10)
  fill_in_digitize?                   app/models/requests/requestable_decorator.rb:33-36 (4)
  fill_in_pick_up?                    app/models/requests/requestable_decorator.rb:43-46 (4)
  libcal_url                          app/models/requests/requestable_decorator.rb:98-107 (10)
  no_services?                        app/models/requests/requestable_decorator.rb:153-155 (3)
  off_site_location                   app/models/requests/requestable_decorator.rb:78-90 (13)
  preferred_request_id                app/models/requests/requestable_decorator.rb:24-26 (3)
  status_badge                        app/models/requests/requestable_decorator.rb:109-111 (3)

Requests::Router
  access_user?                        app/models/requests/router.rb:122-128 (7)
  any_loanable                        app/models/requests/router.rb:5 (1)
  requestable=                        app/models/requests/router.rb:4 (1)

Requests::Service
  submitted                           app/models/requests/service.rb:12-15 (4)
  type                                app/models/requests/service.rb:22 (1)

Requests::SolrOpenUrlContext
  openurl_ctx_kev                     app/models/requests/solr_open_url_context.rb:16-18 (3)

Requests::Submission
  email                               app/models/requests/submission.rb:24-26 (3)
  item_validations                    app/models/requests/submission.rb:47-49 (3)
  marquand?                           app/models/requests/submission.rb:104-106 (3)
  pick_up_location                    app/models/requests/submission.rb:96-98 (3)
  process_submission                  app/models/requests/submission.rb:75-89 (15)
  service_errors                      app/models/requests/submission.rb:91-94 (4)
  service_locations                   app/models/requests/submission.rb:70-73 (4)
  success_messages                    app/models/requests/submission.rb:22 (1)

Requests::Submissions::DigitizeItem
  submitted                           app/models/requests/submissions/digitize_item.rb:28-30 (3)

Requests::Submissions::HoldItem
  duplicate=                          app/models/requests/submissions/hold_item.rb:6 (1)

Requests::Submissions::Service
  sent                                app/models/requests/submissions/service.rb:4 (1)
  submitted                           app/models/requests/submissions/service.rb:18-20 (3)
christinach commented 2 months ago

Resolve this ticket and create a new one to add the 'ignore block' in the part of the code that we want this tool to ignore.