GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 9-9 lines in 2 locations

app/controllers/rooms_controller.rb 1 location

@@ 291-299 (lines=9) @@
288
      current_user.nil?
289
  end
290
291
  def room_limit_exceeded
292
    limit = Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Limit").to_i
293
294
    # Does not apply to admin
295
    # 15+ option is used as unlimited
296
    return false if current_user&.has_cached_role?(:admin) || limit == 15
297
298
    current_user.rooms.count >= limit
299
  end
300
301
  def join_room(opts)
302
    room_settings = JSON.parse(@room[:room_settings])

app/helpers/rooms_helper.rb 1 location

@@ 35-43 (lines=9) @@
32
    Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Limit").to_i
33
  end
34
35
  def room_limit_exceeded
36
    limit = Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Limit").to_i
37
38
    # Does not apply to admin or users that aren't signed in
39
    # 15+ option is used as unlimited
40
    return false if current_user&.has_cached_role?(:admin) || limit == 15
41
42
    current_user.rooms.length >= limit
43
  end
44
45
  def current_room_exceeds_limit(room)
46
    # Get how many rooms need to be deleted to reach allowed room number