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
...
@@ -22,7 +22,6 @@ module EE
define_method
(
action
)
{
perform_update
if
submitted?
}
define_method
(
action
)
{
perform_update
if
submitted?
}
end
end
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def
visible_application_setting_attributes
def
visible_application_setting_attributes
attrs
=
super
attrs
=
super
...
@@ -30,36 +29,22 @@ module EE
...
@@ -30,36 +29,22 @@ module EE
attrs
+=
EE
::
ApplicationSettingsHelper
.
repository_mirror_attributes
attrs
+=
EE
::
ApplicationSettingsHelper
.
repository_mirror_attributes
end
end
if
License
.
feature_available?
(
:custom_project_templates
)
# License feature => attribute name
attrs
<<
:custom_project_templates_group_id
{
end
custom_project_templates: :custom_project_templates_group_id
,
email_additional_text: :email_additional_text
,
if
License
.
feature_available?
(
:email_additional_text
)
custom_file_templates: :file_template_project_id
,
attrs
<<
:email_additional_text
pseudonymizer: :pseudonymizer_enabled
,
end
default_project_deletion_protection: :default_project_deletion_protection
,
adjourned_deletion_for_projects_and_groups: :deletion_adjourned_period
,
if
License
.
feature_available?
(
:custom_file_templates
)
required_ci_templates: :required_instance_ci_template
,
attrs
<<
:file_template_project_id
disable_name_update_for_users: :updating_name_disabled_for_users
,
end
packages: :npm_package_requests_forwarding
,
default_branch_protection_restriction_in_groups: :group_owners_can_manage_default_branch_protection
if
License
.
feature_available?
(
:pseudonymizer
)
}.
each
do
|
license_feature
,
attribute_name
|
attrs
<<
:pseudonymizer_enabled
if
License
.
feature_available?
(
license_feature
)
end
attrs
<<
attribute_name
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
end
end
if
License
.
feature_available?
(
:admin_merge_request_approvers_rules
)
if
License
.
feature_available?
(
:admin_merge_request_approvers_rules
)
...
@@ -70,14 +55,6 @@ module EE
...
@@ -70,14 +55,6 @@ module EE
attrs
<<
{
compliance_frameworks:
[]
}
attrs
<<
{
compliance_frameworks:
[]
}
end
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
)
if
::
License
.
feature_available?
(
:geo
)
&&
::
Feature
.
enabled?
(
:maintenance_mode
)
attrs
<<
:maintenance_mode
attrs
<<
:maintenance_mode
attrs
<<
:maintenance_mode_message
attrs
<<
:maintenance_mode_message
...
@@ -85,7 +62,6 @@ module EE
...
@@ -85,7 +62,6 @@ module EE
attrs
attrs
end
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def
seat_link_payload
def
seat_link_payload
data
=
::
Gitlab
::
SeatLinkData
.
new
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