Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c232c440
Commit
c232c440
authored
Jul 15, 2020
by
Gabriel Mazetto
Committed by
Ash McKenzie
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix perceived/cyclomatic complexity
parent
70711a4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
40 deletions
+16
-40
ee/app/controllers/ee/admin/application_settings_controller.rb
...p/controllers/ee/admin/application_settings_controller.rb
+16
-40
No files found.
ee/app/controllers/ee/admin/application_settings_controller.rb
View file @
c232c440
...
...
@@ -22,7 +22,6 @@ module EE
define_method
(
action
)
{
perform_update
if
submitted?
}
end
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def
visible_application_setting_attributes
attrs
=
super
...
...
@@ -30,36 +29,22 @@ module EE
attrs
+=
EE
::
ApplicationSettingsHelper
.
repository_mirror_attributes
end
if
License
.
feature_available?
(
:custom_project_templates
)
attrs
<<
:custom_project_templates_group_id
end
if
License
.
feature_available?
(
:email_additional_text
)
attrs
<<
:email_additional_text
end
if
License
.
feature_available?
(
:custom_file_templates
)
attrs
<<
:file_template_project_id
end
if
License
.
feature_available?
(
:pseudonymizer
)
attrs
<<
:pseudonymizer_enabled
end
if
License
.
feature_available?
(
:default_project_deletion_protection
)
attrs
<<
:default_project_deletion_protection
end
if
License
.
feature_available?
(
:adjourned_deletion_for_projects_and_groups
)
attrs
<<
:deletion_adjourned_period
end
if
License
.
feature_available?
(
:required_ci_templates
)
attrs
<<
:required_instance_ci_template
end
if
License
.
feature_available?
(
:disable_name_update_for_users
)
attrs
<<
:updating_name_disabled_for_users
# License feature => attribute name
{
custom_project_templates: :custom_project_templates_group_id
,
email_additional_text: :email_additional_text
,
custom_file_templates: :file_template_project_id
,
pseudonymizer: :pseudonymizer_enabled
,
default_project_deletion_protection: :default_project_deletion_protection
,
adjourned_deletion_for_projects_and_groups: :deletion_adjourned_period
,
required_ci_templates: :required_instance_ci_template
,
disable_name_update_for_users: :updating_name_disabled_for_users
,
packages: :npm_package_requests_forwarding
,
default_branch_protection_restriction_in_groups: :group_owners_can_manage_default_branch_protection
}.
each
do
|
license_feature
,
attribute_name
|
if
License
.
feature_available?
(
license_feature
)
attrs
<<
attribute_name
end
end
if
License
.
feature_available?
(
:admin_merge_request_approvers_rules
)
...
...
@@ -70,14 +55,6 @@ module EE
attrs
<<
{
compliance_frameworks:
[]
}
end
if
License
.
feature_available?
(
:packages
)
attrs
<<
:npm_package_requests_forwarding
end
if
License
.
feature_available?
(
:default_branch_protection_restriction_in_groups
)
attrs
<<
:group_owners_can_manage_default_branch_protection
end
if
::
License
.
feature_available?
(
:geo
)
&&
::
Feature
.
enabled?
(
:maintenance_mode
)
attrs
<<
:maintenance_mode
attrs
<<
:maintenance_mode_message
...
...
@@ -85,7 +62,6 @@ module EE
attrs
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def
seat_link_payload
data
=
::
Gitlab
::
SeatLinkData
.
new
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment