Commit 4aa4449e authored by Christian Couder's avatar Christian Couder

Refactor parse_options() in push_options.rb

This improves code quality by reducing Cognitive Complexity.

This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/67091
parent ec326ecf
......@@ -56,6 +56,13 @@ module Gitlab
next if [namespace, key].any?(&:nil?)
store_option_info(options, namespace, key, value)
end
options
end
def store_option_info(options, namespace, key, value)
options[namespace] ||= HashWithIndifferentAccess.new
if option_multi_value?(namespace, key)
......@@ -66,9 +73,6 @@ module Gitlab
end
end
options
end
def option_multi_value?(namespace, key)
MULTI_VALUE_OPTIONS.any? { |arr| arr == [namespace, key] }
end
......
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