Method topics_to_alter
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def topics_to_alter
return @topics_to_alter if @topics_to_alter
topics_to_check = []
- 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 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 topics_to_repartition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def topics_to_repartition
return @topics_to_repartition if @topics_to_repartition
@topics_to_repartition = []
- 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"