Method deserialize_from_file
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def deserialize_from_file(file_name = nil, directory = nil)
if schema_version != '1.0.0'
migrate
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"
Further reading
Method deserialize_from_file
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def deserialize_from_file(file_name = nil, directory = nil)
if schema_version != '1.0.0'
migrate
end
Method encodeWithCoder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def encodeWithCoder(coder)
columns.each do |attr|
# Serialize attributes except the proxy has_many and belongs_to ones.
unless [:belongs_to, :has_many, :has_one].include? column(attr).type
value = self.send(attr)
- 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 initWithCoder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initWithCoder(coder)
self.init
new_tag_id = 1
columns.each do |attr|
- 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"