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.
Passed
Pull Request — master (#634)
by
unknown
03:34
created

AdminsHelper.recording_default_visibility_string()   A

Complexity

Conditions 2

Size

Total Lines 8

Duplication

Lines 7
Ratio 87.5 %

Importance

Changes 0
Metric Value
cc 2
dl 7
loc 8
rs 10
c 0
b 0
f 0
1
# frozen_string_literal: true
2
3
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
4
#
5
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
6
#
7
# This program is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU Lesser General Public License as published by the Free Software
9
# Foundation; either version 3.0 of the License, or (at your option) any later
10
# version.
11
#
12
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15
#
16
# You should have received a copy of the GNU Lesser General Public License along
17
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18
19
module AdminsHelper
20
  include Pagy::Frontend
21
22
  def display_invite
23
    current_page?(admins_path) && invite_registration
24
  end
25
26
  def registration_method
27
    Setting.find_or_create_by!(provider: user_settings_provider).get_value("Registration Method")
28
  end
29
30
  def invite_registration
31
    registration_method == Rails.configuration.registration_methods[:invite]
32
  end
33
34
  def approval_registration
35
    registration_method == Rails.configuration.registration_methods[:approval]
36
  end
37
38 View Code Duplication
  def room_authentication_string
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
39
    if Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true"
40
      I18n.t("administrator.site_settings.authentication.enabled")
41
    else
42
      I18n.t("administrator.site_settings.authentication.disabled")
43
    end
44
  end
45
46 View Code Duplication
  def recording_default_visibility_string
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
47
    if Setting.find_or_create_by!(provider: user_settings_provider)
48
              .get_value("Default Recording Visibility") == "public"
49
      I18n.t("administrator.site_settings.recording_visibility.public")
50
    else
51
      I18n.t("administrator.site_settings.recording_visibility.private")
52
    end
53
  end
54
55
  def registration_method_string
56
    case registration_method
57
    when Rails.configuration.registration_methods[:open]
58
        I18n.t("administrator.site_settings.registration.methods.open")
59
    when Rails.configuration.registration_methods[:invite]
60
        I18n.t("administrator.site_settings.registration.methods.invite")
61
    when Rails.configuration.registration_methods[:approval]
62
        I18n.t("administrator.site_settings.registration.methods.approval")
63
      end
64
  end
65
66
  def room_limit_number
67
    Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Limit").to_i
68
  end
69
end
70