Showing 112 of 150 total issues
Method on_error_occurred
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_error_occurred(event)
push_tags
error = event[:error]
client.active_span&.set_error(error)
Method handle_after_consume
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def handle_after_consume
coordinator.on_finished do |last_group_message|
return if revoked?
if coordinator.success?
- 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 handle_after_consume
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def handle_after_consume
coordinator.on_finished do
return if revoked?
if coordinator.success?
- 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 declaratives_routing_topics
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def declaratives_routing_topics
return @declaratives_routing_topics if @declaratives_routing_topics
collected_topics = {}
default_servers = kafka_config[:'bootstrap.servers']
- 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 validate!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def validate!(builder)
nodes_setup = Hash.new do |h, node_id|
h[node_id] = { active: false, node_id: node_id }
end
- 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 handle_after_consume
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def handle_after_consume
coordinator.on_finished do
return if revoked?
if coordinator.success?
- 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_resources_to_migrate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_resources_to_migrate
# We build non-fetched topics resources representations for further altering
resources = candidate_topics.map do |topic|
Admin::Configs::Resource.new(type: :topic, name: topic.name)
end
- 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_consumer
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_consumer
::Rdkafka::Config.logger = ::Karafka::App.config.logger
# We need to refresh the setup of this subscription group in case we started running in a
# swarm. The initial configuration for validation comes from the parent node, but it needs
Method stop
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stop
# Ensure that the stopping procedure is initialized only once
@mutex.synchronize do
return if @stopping
Method handle_after_consume
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle_after_consume
coordinator.on_finished do |last_group_message|
if coordinator.success?
coordinator.pause_tracker.reset
- 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 mark_as_consumed!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def mark_as_consumed!(message, offset_metadata = @_current_offset_metadata)
if @_in_transaction && !collapsed?
mark_in_transaction(message, offset_metadata, false)
elsif collapsed?
super
- 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 handle_after_consume
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle_after_consume
coordinator.on_finished do |last_group_message|
if coordinator.success?
coordinator.pause_tracker.reset
- 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 shutdown
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def shutdown
active_listeners = @listeners.active
# When we are done processing immediately quiet all the listeners so they do not pick up
# new work to do
- 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 mark_as_consumed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def mark_as_consumed(message, offset_metadata = @_current_offset_metadata)
if @_in_transaction
mark_in_transaction(message, offset_metadata, true)
else
# seek offset can be nil only in case `#seek` was invoked with offset reset request
- 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 mark_as_consumed!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def mark_as_consumed!(message, offset_metadata = @_current_offset_metadata)
if @_in_transaction
mark_in_transaction(message, offset_metadata, false)
else
# seek offset can be nil only in case `#seek` was invoked with offset reset request
- 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 handle_after_consume
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle_after_consume
coordinator.on_finished do
if coordinator.success?
coordinator.pause_tracker.reset
- 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 handle_post_filtering
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_post_filtering
filter = coordinator.filter
# We pick the timeout before the action because every action takes time. This time
# may then mean we end up having throttle time equal to zero when pause is needed
Method stop
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stop
# Initialize the stopping process only if Karafka was running
return if Karafka::App.stopping?
return if Karafka::App.stopped?
return if Karafka::App.terminated?
Method process
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process
job = @jobs_queue.pop
instrument_details = { caller: self, job: job, jobs_queue: @jobs_queue }
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
# Close producer just in case. While it should not be used, we do not want even a
# theoretical case since librdkafka is not thread-safe.
# We close it prior to forking just to make sure, there is no issue with initialized
# producer (should not be initialized but just in case)