Showing 112 of 150 total issues
Method handle_after_consume
has a Cognitive Complexity of 17 (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 resolve_partitions_with_time_offsets
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def resolve_partitions_with_time_offsets
time_tpl = Rdkafka::Consumer::TopicPartitionList.new
# First we need to collect the time based once
@expanded_topics.each do |name, partitions|
- 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 15 (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 report_aggregated_topics_metrics
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def report_aggregated_topics_metrics(statistics, consumer_group_id)
config.aggregated_rd_kafka_metrics.each do |metric|
statistics.fetch('topics').each do |topic_name, topic_values|
sum = 0
- 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 stop
has a Cognitive Complexity of 15 (exceeds 5 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?
- 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 15 (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 15 (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, true)
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 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 resolve_partitions_with_negative_offsets
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def resolve_partitions_with_negative_offsets
@expanded_topics.each do |name, partitions|
next unless partitions.is_a?(Hash)
partitions.each do |partition, offset|
- 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 find_all
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def find_all
scopes = [Strategies]
modules = Strategies.constants
modules.each do |const|
- 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 call
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call
# If no changes at all, just print and stop
if topics_to_create.empty? && topics_to_repartition.empty? && topics_to_alter.empty?
puts "Karafka will #{yellow('not')} perform any actions. No changes needed."
Method topics_to_alter
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def topics_to_alter
return @topics_to_alter if @topics_to_alter
topics_to_check = []
Method report_metric
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_metric(metric, statistics, base_tags)
case metric.scope
when :root
public_send(
metric.type,
Method poll
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def poll(timeout)
time_poll ||= TimeTrackers::Poll.new(timeout)
return nil if time_poll.exceeded?
Method each
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def each
Admin.with_consumer(@settings) do |consumer|
tpl = TplBuilder.new(consumer, @topics_with_partitions).call
consumer.assign(tpl)
- 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 13 (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 handle_after_consume
has a Cognitive Complexity of 13 (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 call
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def call
# If no changes at all, just print and stop
if topics_to_create.empty? && topics_to_repartition.empty? && topics_to_alter.empty?
puts "Karafka will #{yellow('not')} perform any actions. No changes needed."
- 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 13 (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 report_metric
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_metric(metric, statistics, consumer_group_id)
case metric.scope
when :root
# Do nothing on the root metrics as the same metrics are reported in a granular
# way from other places