Commit c232c440 authored by Gabriel Mazetto's avatar Gabriel Mazetto Committed by Ash McKenzie

Fix perceived/cyclomatic complexity

parent 70711a4d
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment