Showing 339 of 417 total issues
Method parse_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_element(element)
case element
when ImportName
o = Import.new
@imports << o
Method decode_tag
has 31 lines of code (exceeds 25 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
Method fault2exception
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.fault2exception(fault, registry = nil)
registry ||= Mapping::DefaultRegistry
detail = ""
if fault.detail
begin
Method parse_attr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_attr(attr, value)
case attr
when NamespaceAttrName
@namespace = value.source
if @content
Method add_operation
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_operation(drv, binding)
name_creator = WSDL::SOAP::ClassNameCreator.new
modulepath = 'WSDLDriverFactory'
methoddefcreator =
WSDL::SOAP::MethodDefCreator.new(@wsdl, name_creator, modulepath, {})
Method fault
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fault(e, wsdl_fault_details)
if e.is_a?(UnhandledMustUnderstandHeaderError)
faultcode = FaultCode::MustUnderstand
else
faultcode = FaultCode::Server
Method encode_data
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encode_data(ns, obj, parent)
if obj.respond_to?(:to_xmlpart)
formatted = trim_eol(obj.to_xmlpart)
formatted = trim_indent(formatted)
formatted = formatted.gsub(/^/, @indent).sub(/\n+\z/, '')
Method parse_attr
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_attr(attr, value)
case attr
when NameAttrName
@name = XSD::QName.new(targetnamespace, value.source)
when RefAttrName
Method unknownstubobj2soap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unknownstubobj2soap(obj, definition)
return SOAPNil.new if obj.nil?
if definition.elements.size == 0
ele = Mapping.obj2soap(obj)
ele.elename = definition.elename if definition.elename
Method _obj2soap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _obj2soap(obj, type_qname = nil)
ret = nil
if obj.is_a?(SOAPCompoundtype)
obj.replace do |ele|
Mapping._obj2soap(ele, self)
Method initialize
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(style, use, encodingstyle, op_name, optype_name,
headerparts, bodyparts, faultpart, soapaction)
Method create_structdef
has 28 lines of code (exceeds 25 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
Method dump_porttype
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dump_porttype(porttype)
assigned_method = collect_assigned_method(@definitions, porttype.name, @modulepath)
class_name = mapped_class_basename(porttype.name, @modulepath)
c = XSD::CodeGen::ClassDef.new(class_name)
element_definitions = @definitions.collect_elements
Method parse_element
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_element(element)
case element
when AllName
@content = All.new
when SequenceName
Method unknownstruct2obj
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unknownstruct2obj(node, info, map)
unless node.type.name
return nil
end
typestr = Mapping.elename2name(node.type.name)
Method unmarshal
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unmarshal(conn_data)
xml = nil
opt = {}
contenttype = conn_data.receive_contenttype
if /#{MIMEMessage::MultipartContentType}/i =~ contenttype
Method valid?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def valid?(value)
return false unless check_restriction(value)
return false unless check_length(value)
return false unless check_maxlength(value)
return false unless check_minlength(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 unknownstruct2obj
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def unknownstruct2obj(node, info, map)
unless node.type.name
return nil
end
typestr = Mapping.elename2name(node.type.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 dump
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def dump(varname)
@varname = varname
result = ''
str = dump_complextype
unless str.empty?
- 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 dump
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def dump(porttype = nil)
result = "require 'soap/rpc/driver'\n\n"
if @modulepath
modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
modulepath.each do |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"