Showing 8 of 8 total issues
Method insert
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def insert(content = nil, attrs = nil, &blk)
raise Error, "This tag is already closed" if @done
if content.is_a?(Hash)
attrs = 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 insert
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def insert(content = nil, attrs = nil, &blk)
raise Error, "This tag is already closed" if @done
if content.is_a?(Hash)
attrs = content
Method attrs_to_s
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def attrs_to_s
attributes.inject("") do |res, (name, value)|
next res unless value
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 rumble_tag
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rumble_tag(name, sc, content = nil, attrs = nil, &blk)
Method compile!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compile!(view)
return if @compiled
@compile_mutex.synchronize do
return if @compiled
- 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 present
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def present(view, *objects)
if objects[0].is_a?(Symbol) || objects[0].is_a?(String)
name = objects.shift
else
name = presenter_name_from_object(objects[0])
- 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 flatten_attr_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def flatten_attr_hash(attrs, name)
if attrs && attrs[name].is_a?(Hash)
attrs = attrs.dup
attrs.delete(name).each do |key, value|
next if value.nil?
- 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 compile!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compile!(view)
return if @compiled
@compile_mutex.synchronize do
return if @compiled
- 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"