Showing 8 of 8 total issues
Method run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def run
while @running
sleep @fetch_interval
get_shards.each do |s|
- 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 format_attribute_value
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def format_attribute_value(v)
if v.m
return dynamodb_to_hash(v.m)
elsif v.l
return v.l.map {|i| format_attribute_value(i) }
- 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 run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
while @running
sleep @fetch_interval
get_shards.each do |s|
Method load_sequence
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_sequence(shard_id)
if @pos_file
return nil unless File.exist?("#{@pos_file}.#{shard_id}")
File.read("#{@pos_file}.#{shard_id}").chomp
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"
Further reading
Avoid too many return
statements within this method. Open
return v.bool
Avoid too many return
statements within this method. Open
return v.s
Avoid too many return
statements within this method. Open
return null
Avoid too many return
statements within this method. Open
return BigDecimal.new(v.n).to_i