Method build_and_schedule_periodic_jobs
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def build_and_schedule_periodic_jobs
# Shortcut if periodic jobs are not used at all. No need to run the complex flow when it
# will never end up with anything. If periodics on any of the topics are not even defined,
# we can finish fast
@periodic_jobs ||= @subscription_group.topics.count(&:periodic_job?)
- 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 fetch_loop
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch_loop
running!
# Run the initial events fetch to improve chances of having metrics and initial callbacks
# triggers on start.
#
Method build_and_schedule_flow_jobs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_and_schedule_flow_jobs
return if @messages_buffer.empty?
consume_jobs = []
idle_jobs = []
Method fetch_loop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fetch_loop
running!
# Run the initial events fetch to improve chances of having metrics and initial callbacks
# triggers on start.
#
- 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 build_and_schedule_flow_jobs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_and_schedule_flow_jobs
return if @messages_buffer.empty?
consume_jobs = []
idle_jobs = []
- 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"