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
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 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 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"