Showing 13 of 17 total issues
File saml.rb
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/all'
require 'active_support/xml_mini'
require 'active_model'
require 'saml/base'
require 'saml/xml_helpers'
Method to_xml
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def to_xml(*args)
options = args.extract_options!
builder, default_namespace, instruct = args
instruct = true if instruct.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 sign_xml
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sign_xml(message, format = :xml, include_nested_prefixlist = false, &block)
message.add_signature
document = Xmldsig::SignedDocument.new(message.send("to_#{format}"))
- 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_soap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_soap(options = {})
builder = Nokogiri::XML::Builder.new
body = self.to_xml(builder)
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8")
- 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 encrypt_assertion
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encrypt_assertion(assertion, key_descriptor_or_certificate, include_certificate: false, include_key_retrieval_method: false)
case key_descriptor_or_certificate
when OpenSSL::X509::Certificate
certificate = key_descriptor_or_certificate
key_name = nil
Method encrypt_assertion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def encrypt_assertion(assertion, key_descriptor_or_certificate, include_certificate: false, include_key_retrieval_method: false)
case key_descriptor_or_certificate
when OpenSSL::X509::Certificate
certificate = key_descriptor_or_certificate
key_name = 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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(metadata_dir = "config/metadata",
encryption_key_file = "config/ssl/key.pem", encryption_key_password = nil,
signing_key_file = nil, signing_key_password = nil)
Method load_files
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_files(metadata_dir, encryption_key_file, encryption_key_password = nil,
sign_key_file = nil, sign_key_password = nil)
Method x509certificate=
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def x509certificate=(cert)
if cert.present?
if cert =~ /-----BEGIN CERTIFICATE-----/
@x509certificate = OpenSSL::X509::Certificate.new(cert)
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 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*args)
options = args.extract_options!
if options[:subject].present?
@subject = options.delete(:subject)
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 verify_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def verify_xml(message, raw_body)
document = Xmldsig::SignedDocument.new(raw_body)
signature_valid = document.validate do |signature, data, signature_algorithm|
node = document.signatures.find { |s| s.signature_value == signature }.signature.at_xpath('descendant::ds:KeyName', Xmldsig::NAMESPACES)
- 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 verify
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def verify(signature_algorithm, signature, data, key_name = nil)
certificates = if key_name.blank? && iterate_certificates_until_verified?
find_key_descriptors_by_use_or_without('signing').collect(&:certificate)
else
Array(certificate(key_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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse(xml, options = {})
if xml.is_a?(String)
ActiveSupport::XmlMini_REXML.parse(xml)
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"