Showing 507 of 507 total issues
Class has too many lines. [237/100] Open
class Entity
# The Entity type name
attr_reader :type
# The FrOData::Service's identifying name
attr_reader :service_name
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class has too many lines. [153/100] Open
class Service
# The Faraday connection object used by the service to make requests
attr_reader :connection
# The FrOData Service's URL
attr_reader :service_url
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class has too many lines. [121/100] Open
class Query
attr_reader :options
include InBatches
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class has too many lines. [102/100] Open
class Base < FrOData::Property
# The SRID (Spatial Reference ID) of this property.
attr_accessor :srid
# The default SRID (same as used by GPS)
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class Entity
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Entity
# The Entity type name
attr_reader :type
# The FrOData::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 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Service
# The Faraday connection object used by the service to make requests
attr_reader :connection
# The FrOData Service's URL
attr_reader :service_url
Assignment Branch Condition size for fetch_result is too high. [25.06/15] Open
def fetch_result
raise "Invalid navigation link for #{nav_name}" unless link[:href]
options = {
type: nav_property.entity_type,
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [20/10] Open
def fetch_result
raise "Invalid navigation link for #{nav_name}" unless link[:href]
options = {
type: nav_property.entity_type,
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for process_links is too high. [24.52/15] 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
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [17/10] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [17/10] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for validate is too high. [21.86/15] Open
def validate(value)
return [] if value.nil? && allows_nil?
values = parse_value(value)
if values.length > 1 && !is_flags?
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
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 has too many lines. [15/10] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for to_xml is too high. [19.13/15] 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
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [14/10] Open
def instantiate_property(property_name, value_xml)
prop_type = schema.get_property_type(name, property_name)
prop_type, value_type = prop_type.split(/\(|\)/)
if prop_type == 'Collection'
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for get_property is too high. [19.34/15] Open
def get_property(property_name)
prop_name = property_name.to_s
# Property is lazy loaded
if properties_xml_value.has_key?(prop_name)
property = instantiate_property(prop_name, properties_xml_value[prop_name])
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [14/10] Open
def validate(value)
return [] if value.nil? && allows_nil?
values = parse_value(value)
if values.length > 1 && !is_flags?
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for process_property_from_xml is too high. [19.95/15] 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
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric