Method process_bid
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def process_bid(options = {})
job = options[:job]
id = options[:id]
tx = options[:tx] || job.transfer(id)
timestamp = options[:timestamp]
- 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 process_bid
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_bid(options = {})
job = options[:job]
id = options[:id]
tx = options[:tx] || job.transfer(id)
timestamp = options[:timestamp]
Method find_bids
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def find_bids(offset = BLOCK_OVERLAP)
block_num = head_block
time = block_time
starting_block = block_num - block_span(offset)
bids = []
Method find_bids
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def find_bids(offset = BLOCK_OVERLAP)
block_num = head_block
time = block_time
starting_block = block_num - block_span(offset)
bids = []
- 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 join_threads
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def join_threads
unless @threads.nil?
loop do
alive = @threads.map do |thread|
thread if thread.alive?
- 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"