Showing 17 of 17 total issues
Class GlobalOptions
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
class GlobalOptions < Options
include SharedOptions
def initialize(options = {})
@option_type = :global
Class Builder
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Builder
attr_reader :multipart
SCHEMA_TYPES = {
"xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
File options.rb
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "logger"
module Savon
class Options
Method to_hash
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def to_hash(hash, path)
return hash unless hash
return hash.map { |value| to_hash(value, path) } if hash.is_a?(Array)
return hash.to_s unless hash.is_a?(Hash)
- 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 Response
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Response
CRLF = /\r\n/
WSP = /[#{%Q|\x9\x20|}]/
def initialize(http, globals, locals)
Method configure_ssl
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def configure_ssl
connection.ssl.verify = @globals[:ssl_verify] if @globals.include? :ssl_verify
connection.ssl.ca_file = @globals[:ssl_ca_cert_file] if @globals.include? :ssl_ca_cert_file
connection.ssl.verify_hostname = @globals[:verify_hostname] if @globals.include? :verify_hostname
connection.ssl.ca_path = @globals[:ssl_ca_cert_path] if @globals.include? :ssl_ca_cert_path
- 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 initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(options = {})
@option_type = :global
defaults = {
:encoding => "UTF-8",
Method initialize
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(message_tag, namespace_identifier, types, used_namespaces, message, element_form_default, key_converter, unwrap)
Method verify_message!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def verify_message!
return if @expected[:message].eql? :any
unless equals_except_any(@expected[:message], @actual[:message])
expected_message = " with this message: #{@expected[:message].inspect}" if @expected[:message]
expected_message ||= " with no message."
- 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 equals_except_any
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def equals_except_any(msg_expected, msg_real)
return true if msg_expected === msg_real
return false if (msg_expected.nil? || msg_real.nil?) # If both are nil has returned true
msg_expected.each do |key, expected_value|
next if (expected_value == :any && msg_real.include?(key))
- 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 build_connection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_connection(builder)
@globals[:endpoint] ||= endpoint
@locals[:soap_action] ||= soap_action
@locals[:body] = builder.to_s
@connection = SOAPRequest.new(@globals).build(
- 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 build_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_xml
tag(builder, :Envelope, namespaces_with_globals) do |xml|
tag(xml, :Header, header_attributes) { xml << header.to_s } unless header.empty?
tag(xml, :Body, body_attributes) do
if @globals[:no_message_tag]
- 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_attachments_to_multipart_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_attachments_to_multipart_message(multipart_message)
if @locals[:attachments].is_a? Hash
# hash example: { 'att1' => '/path/to/att1', 'att2' => '/path/to/att2' }
@locals[:attachments].each do |identifier, attachment|
add_attachment_to_multipart_message(multipart_message, attachment, identifier)
- 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 to_s
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_s
message_is_xml = @message =~ /^</
has_filters = @filters.any?
pretty_print = @pretty_print
- 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 build_document
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_document
# check if xml was already provided
if @locals.include? :xml
xml_result = @locals[:xml]
else
- 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 present?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.present?(http, xml = nil)
xml_orig ||= http.body
if xml_orig.valid_encoding?
xml = xml_orig
else
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(globals, locals)
@gyoku_options = { :key_converter => globals[:convert_request_keys_to] }
@wsse_auth = locals[:wsse_auth].nil? ? globals[:wsse_auth] : locals[:wsse_auth]
@wsse_timestamp = locals[:wsse_timestamp].nil? ? globals[:wsse_timestamp] : locals[:wsse_timestamp]
- 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"