Showing 63 of 347 total issues
Method _match_arg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _match_arg(var, with_labels)
if @model && with_labels != false
labels = @model.respond_to?(:mapped_label_names) ? _model_label_string : @model
{var.to_sym => labels}
else
- Read upRead up
- Create a ticketCreate a ticket
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 from_key_and_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_key_and_value(key, value)
case value
when String, Symbol
self.class.from_key_and_single_value(key, value)
when Array
- Read upRead up
- Create a ticketCreate a ticket
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 match_nodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def match_nodes(hash, optional_match = false)
hash.inject(self) do |query, (variable, node_object)|
neo_id = (node_object.respond_to?(:neo_id) ? node_object.neo_id : node_object)
match_method = optional_match ? :optional_match : :match
- Read upRead up
- Create a ticketCreate a ticket
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"