Showing 284 of 1,313 total issues
Method exp_find_by_token
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def exp_find_by_token(exp, token, parent_is_not = false)
if exp.kind_of?(Array) # Is this and AND or OR
result = nil
exp.find do |e|
result = exp_find_by_token(e, token) # Look for token
- 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 exp_replace_qs_tokens
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def exp_replace_qs_tokens(exp, tokens)
key = exp.keys.first
if %w[and or].include?(key)
exp[key].each { |e| exp_replace_qs_tokens(e, tokens) }
elsif key == "not"
- 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 build_document_header
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def build_document_header
mri = options.mri
raise "No settings configured for Table" if mri.table.nil?
calculate_max_col_widths
- 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 import_customization_template
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def import_customization_template(custom_template_hash)
CustomizationTemplate.transaction do
unless valid_type?(custom_template_hash[:type])
raise CustomizationTemplateYamlError.new("Customization Template error",
["Invalid type: #{custom_template_hash[:type]}"])
- 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"