lib/sidekiq-scheduler/sidekiq_adapter.rb
Method check_using_old_sidekiq_scheduler_config!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.check_using_old_sidekiq_scheduler_config!(sidekiq_config)
%i[enabled dynamic dynamic_every schedule listened_queues_only rufus_scheduler_options].each do |option|
if SIDEKIQ_GTE_7_0_0
if sidekiq_config.key?(option)
raise OptionNotSupportedAnymore, ":#{option} option should be under the :scheduler: key"
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sidekiq_queues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.sidekiq_queues(sidekiq_config)
if SIDEKIQ_GTE_7_0_0
if sidekiq_config.nil? || (sidekiq_config.respond_to?(:empty?) && sidekiq_config.empty?)
Sidekiq.instance_variable_get(:@config).queues.map(&:to_s)
else
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"