Showing 18 of 26 total issues
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 set_run_user
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_run_user
return if params[:run][:embedded] == "true" || TavernaPlayer.user_proxy.nil?
unless TavernaPlayer.current_user_callback.blank?
user = callback(TavernaPlayer.current_user_callback)
- 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
Method value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def value(*indices)
file_path = file.path
if depth == 0
if file_path.blank?
self[:value]
- 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 add_method
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_method(name)
setter = "#{name}_method_name=".to_sym
mapper = name
(class << self; self; end).instance_eval do
- 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 show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def show
if @run.running?
@interaction = Interaction.find_by_run_id_and_replied(@run.id, false)
unless @interaction.nil?
unless @interaction.displayed
- 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 cancel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cancel
return unless incomplete?
# Set the stop flag for all cases.
self.stop = true
- 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
Avoid too many return
statements within this method. Open
return unless run_callback(TavernaPlayer.post_run_callback, "post-callback")
Method cancel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cancel
@run.cancel unless @run.complete?
respond_with(@run, :action => :show) do |format|
format.html do
- 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 inputs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def inputs
workflow = File.open(file)
model = T2Flow::Parser.new.parse(workflow)
result = []
- 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 output
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def output
# We need to parse out the path into a list of numbers here so we have
# a list of indices into the file structure.
path = []
unless params[:path].nil?
- 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"