Showing 339 of 417 total issues
Method post_redirect
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def post_redirect(url, req_body, header, redirect_count)
if str = @test_loopback_response.shift
if @debug_dev
@debug_dev << "= Request\n\n"
@debug_dev << req_body
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
res = WEBrick::HTTPResponse.new({:HTTPVersion => HTTPVersion, :Logger => logger})
begin
@log.info { "received a request from '#{ @remote_host }'" }
if @fcgi
Method parse_element
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_element(element)
case element
when LengthName
Length.new
when MinLengthName
Method set_options
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_options(client, options)
client.proxy = options["proxy"]
options.add_hook("proxy") do |key, value|
client.proxy = value
end
Method encode_data
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encode_data(generator, ns, data, parent)
attrs = encode_attrs(generator, ns, data, parent)
if parent && parent.is_a?(SOAPArray) && parent.position
attrs[ns.name(AttrPositionName)] = "[#{parent.position.join(',')}]"
end
Method dump
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dump(type = nil)
result = "require 'xsd/qname'\n"
# cannot use @modulepath because of multiple classes
if @modulepath
result << "\n"
Method parse_element
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_element(element)
case element
when ImportName
o = Import.new
@imports << o
Method initialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(soapaction, param_def, opt)
@soapaction = soapaction
@request_style = opt[:request_style]
@response_style = opt[:response_style]
@request_use = opt[:request_use]
Method post_redirect
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_redirect(url, req_body, header, redirect_count)
if str = @test_loopback_response.shift
if @debug_dev
@debug_dev << "= Request\n\n"
@debug_dev << req_body
Method create_structdef
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_structdef(mpath, qname, typedef, qualified = false)
classname = mapped_class_basename(qname, mpath)
baseclassname = nil
if typedef.complexcontent
if base = typedef.complexcontent.base
- 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 fetch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def fetch(location)
warn("importing: #{location}") if $DEBUG
content = nil
normalizedlocation = location
if location.scheme == 'file' or
- 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 decode_tag
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def decode_tag(ns, elename, attrs, parent)
@textbuf.clear
is_nil, type, arytype, root, offset, position, href, id =
extract_attrs(ns, attrs)
o = 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"
Further reading
Method collect_fault_messages
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def collect_fault_messages
result = []
porttypes.each do |porttype|
port_binding = porttype.find_binding()
next unless port_binding
Method decode_parent
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def decode_parent(parent, node)
case parent.node
when SOAPUnknown
newparent = parent.node.as_struct
node.parent = newparent
Method set_ssl_config
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_ssl_config(client, ssl_config)
ssl_config.each do |key, value|
cfg = client.ssl_config
if cfg.nil?
raise NotImplementedError.new("SSL not supported")
Method parse_schema_element_definition
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_schema_element_definition(schema_element, default_ns)
if schema_element[0] == :choice
parse_schema_definition(schema_element, default_ns)
elsif schema_element[0].is_a?(Array)
parse_schema_definition(schema_element, default_ns)
Method dump
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dump
buf = ""
unless @requirepath.empty?
buf << dump_requirepath
end
Method dump_porttype
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dump_porttype(porttype)
class_name = mapped_class_name(porttype.name, @modulepath)
defined_const = {}
methoddef = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const).dump(porttype.name)
wsdl_name = @definitions.name ? @definitions.name.name : 'default'
Method set_attributes
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.set_attributes(obj, values)
case obj
when ::SOAP::Mapping::Object
values.each do |attr_name, value|
obj.__add_xmlele_value(attr_name, value)
Method _soap2obj
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _soap2obj(node, klass = nil)
definition = find_node_definition(node)
if klass
klass_definition = schema_definition_from_class(klass)
if definition and (definition.class_for < klass)