Showing 15 of 15 total issues
Class Run
has 80 methods (exceeds 20 allowed). Consider refactoring. Open
class Run
include XML::Methods
private_class_method :new
File run.rb
has 576 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'base64'
require 'time'
require 'taverna-baclava'
module T2Server
Method poll
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def poll(type = :all)
updates = []
requests = @cache[:requests]
replies = @cache[:replies]
- 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
Class Server
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Server
include XML::Methods
# :stopdoc:
# Internal references to the main rest and admin top-level resource
Method value
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def value(range = nil, &block)
# The following block is a workaround for Taverna Server versions prior
# to 2.4.1 and can be removed when support for those versions is no
# longer required.
if error? && @size == 0
- 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_all_inputs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _set_all_inputs
input_ports.each_value do |port|
next unless port.set?
uri = Util.append_to_uri_path(links[:inputs], "input/#{port.name}")
- 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 _fake_lists
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _fake_lists
data_map = {}
input_ports.each_value do |port|
next unless port.set?
- 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_peer_verification
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_peer_verification
if @params[:verify_peer]
if @params[:ca_file]
@http.ca_file = @params[:ca_file]
end
- 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 connect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ConnectionFactory.connect(uri, params = nil)
# we want to use URIs here
if !uri.is_a? URI
raise URI::InvalidURIError.new
end
- 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_keypair_credential
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_keypair_credential(uri, filename, password,
name = "Imported Certificate", type = :pkcs12)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(port, ref, error, size, type = "")
Method GET
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def GET(uri, type, range, credentials, &block)
Method xml_keypair_cred_fragment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xml_keypair_cred_fragment(uri, name, key, type, password)
Method initialize_run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize_run(workflow, credentials = nil)
# If workflow is a String, it might be a filename! If so, stream it.
if (workflow.instance_of? String) && (File.file? workflow)
return File.open(workflow, "r") do |file|
create(links[:runs], file, "application/vnd.taverna.t2flow+xml",
- 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 []