Showing 63 of 84 total issues
Method graveyard_to_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def graveyard_to_array(g)
return nil unless g.lat.to_f.abs > 0.01 || g.lng.to_f.abs > 0.01
return nil unless g.lat.to_f.abs < 89
name = g.name.to_s
- 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 caption
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def caption
if status == TODO
"This is on your To-Do List"
elsif status == VISITED
text = "You visited this location"
- 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_domain_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_domain_url(val)
return val if val.blank?
if val && !val.index('://')
val = "/#{val}" unless val[0] == '/'
val = "#{@protocol}://#{@site_name}#{val}"
- 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"