Showing 289 of 375 total issues
Avoid too many return
statements within this function. Open
return ret;
Avoid too many return
statements within this function. Open
return select( selector.replace( rtrim, "$1" ), context, results, seed );
Avoid too many return
statements within this function. Open
return results;
Avoid too many return
statements within this function. Open
return ret == null ? undefined : ret;
Avoid too many return
statements within this function. Open
return compare & 4 ? -1 : 1;
Method generate_graph_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_graph_data(root_entity, relations)
nodes = {}
links = {}
child_links = {}
- 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 add_node_if_needed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_node_if_needed(nodes, entity, root: false)
if nodes[entity.id].nil?
nodes[entity.id] = {
name: entity.short_or_long_name,
description: entity.description,
- 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 match_properties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def match_properties(properties)
# Check whether we've seen this datum before
role_name = properties[@role_field]
if @matched_relation_types[role_name]
@matched_relation_types[role_name][:count] += 1
- 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 upload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upload
# We can't rely on the file encoding being correct, so find out which one we got...
content = File.read(params[:file].path)
detection = CharlockHolmes::EncodingDetector.detect(content)
utf8_encoded_content = CharlockHolmes::Converter.convert content, detection[:encoding], 'UTF-8'
- 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"