Showing 16 of 22 total issues
Class Entity
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Entity
# The Entity type name
attr_reader :type
# The OData4::Service's identifying name
attr_reader :service_name
Class Query
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Query
attr_reader :options
include InBatches
Class Service
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Service
# The Faraday connection object used by the service to make requests
attr_reader :connection
# The OData4 Service's URL
attr_reader :service_url
Method process_links
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.process_links(entity, xml_doc)
entity.instance_eval do
new_links = instance_variable_get(:@links) || {}
schema.navigation_properties[name].each do |nav_name, details|
xml_doc.xpath("./link[@title='#{nav_name}']").each do |node|
- 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 read_metadata
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_metadata
# From file, good for debugging
if options[:metadata_file]
data = File.read(options[:metadata_file])
::Nokogiri::XML(data).remove_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 fetch_result
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fetch_result
raise "Invalid navigation link for #{nav_name}" unless link[:href]
options = {
type: nav_property.entity_type,
- 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 validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate(value)
return if value.nil? && allows_nil?
raise ArgumentError, 'Value must be a Hash' unless value.is_a?(Hash)
value.keys.each do |name|
unless property_names.include?(name) || name =~ /@odata/
- 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 process_metadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.process_metadata(entity, metadata)
entity.instance_eval do
new_links = instance_variable_get(:@links) || {}
schema.navigation_properties[name].each do |nav_name, details|
href = metadata["#{nav_name}@odata.navigationLink"]
- 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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate(value)
return [] if value.nil? && allows_nil?
values = parse_value(value)
if values.length > 1 && !is_flags?
- 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_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_xml
namespaces = XML_NAMESPACES.merge('xml:base' => service.service_url)
builder = Nokogiri::XML::Builder.new do |xml|
xml.entry(namespaces) do
xml.category(term: type,
- 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 process_property_from_xml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_property_from_xml(property_xml)
property_name = property_xml.attributes['Name'].value
property_type = property_xml.attributes['Type'].value
property_options = { service: service }
- 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 value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def value
if (@value.nil? || @value.empty?) && allows_nil?
nil
else
begin
- 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 value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def value
if link.nil?
if nav_property.nav_type == :collection
[]
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 <<
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def <<(entity)
url_chunk, options = setup_entity_post_request(entity)
result = execute_entity_post_request(options, url_chunk)
if entity.is_new?
doc = ::Nokogiri::XML(result.body).remove_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 parse_wkt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_wkt(value)
if value =~ /^geography'(SRID=(\d+);)+(\w+)\((.+)\)'$/
$3 == type_name or raise ArgumentError, "Invalid geography type '#{$3}'"
self.srid = $1 ? $2.to_i : DEFAULT_SRID
coords_from_s($4)
- 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 check_content_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_content_type
# Dynamically extend instance with methods for
# processing the current result type
if is_atom?
extend OData4::Service::Response::Atom
- 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"