Showing 6 of 8 total issues
File eagle.rb
has 588 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "types"
module LibEagle
CLASS_NAMES = {
'eagle' => "Eagle",
Method valid?
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def valid?
self.class.lib_eagle_objects[:attributes].each_pair do |attribute, params|
value = self.instance_variable_get("@attribute_#{attribute}")
if params[:required]
unless value
- 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 attribute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.attribute(attribute_name, params = {})
attribute_name = attribute_name.to_s
variable_name = "@attribute_#{attribute_name}"
# Initialize place inside LibEagle objects
- 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 new_with_xml
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.new_with_xml(xml)
@base_class = self.new
if @lib_eagle_objects[:text_content]
@base_class.instance_variable_set("@content", xml.content)
- 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 is_valid?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def is_valid?(attribute,value)
params = self.class.lib_eagle_objects[:attributes][attribute]
if params[:required]
unless value
raise AttributeRequired.new("#{self.class.name}: #{attribute} is required")
- 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 lib_eagle_objects
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.lib_eagle_objects
@lib_eagle_objects ||= Hash.new
@lib_eagle_objects[:attributes] ||= {}
@lib_eagle_objects[:objects] ||= {}
@lib_eagle_objects[:empty_element] ||= false
- 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"