Method interactions
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def interactions(run, credentials)
wait = false
run.notifications(:requests).each do |note|
if @run.has_parent?
- 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 perform
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def perform
return unless run_callback(TavernaPlayer.pre_run_callback, "pre-callback")
status_message("connect")
- 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
File worker.rb
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
module TavernaPlayer
class Worker
include TavernaPlayer::Concerns::Callback
include TavernaPlayer::Concerns::Zip
Method perform
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
return unless run_callback(TavernaPlayer.pre_run_callback, "pre-callback")
status_message("connect")
Method interactions
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def interactions(run, credentials)
wait = false
run.notifications(:requests).each do |note|
if @run.has_parent?
Method process_outputs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process_outputs(run)
outputs = []
Dir.mktmpdir(run.id, Rails.root.join("tmp")) do |tmp_dir|
run.output_ports.each_value do |port|
- 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 create_run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_run(server, workflow, credentials)
retries ||= TavernaPlayer.server_connection_error_retries
server.create_run(workflow, credentials)
rescue T2Server::ServerAtCapacityError
status_message("full")
- 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 failed
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def failed(exception, run = nil)
begin
unless run.nil?
download_log(run)
run.delete
- 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 unless run_callback(TavernaPlayer.post_run_callback, "post-callback")
Avoid too many return
statements within this method. Open
return