Showing 131 of 347 total issues
Method matches?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def matches?(record)
needed_matches = [record.to_prefix, record.to_name, record.to_suffix, record.to_city].select(&:present?).size
matches = 0
matches += 1 if record.to_prefix.present? && address.street_prefix == record.to_prefix
matches += 1 if record.to_name.present? && address.street_name == record.to_name
- 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 disable_and_reset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def disable_and_reset
@user = User.find(params[:id])
if @user.provider?
flash[:error] = 'Sorry, users from other providers are not able to be reset'
return redirect_to action: 'show'
- 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 items
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def items
@items || begin
@items = model.items.map { |item|
item.theme_callback ||= :menu_list_item
item.active_callback ||= :current_page?
- 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 translate_income
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def translate_income
return if wages_or_salary.present? || income.blank?
self.wages_or_salary = if income == 999
'Un'
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render
if style.present?
if style == 'raw'
RawImgTagRenderer.new(self).render
elsif style == 'parallax'
- 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 with_extra_items
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def with_extra_items(items)
keys = items.map(&:last)
items.unshift ['Left blank', nil]
other_item = ['{{OTHER}}', (keys.include?(value) || value.blank? ? 'other' : value)]
if options[:other_index]
- 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
Function getFieldConfigFromScope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getFieldConfigFromScope(scope: string): AttributeFilterConfig {
for (let attribute in this.attributeFilters) {
const value = this.attributeFilters[attribute];
if ((value.scopes != null ? value.scopes[scope] : void 0) != null) {
return 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 column_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def column_config(column)
options = {
headerName: Translator.label(Building, column),
field: column,
resizable: true
- 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
Function getBuildingList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getBuildingList() {
let house = $('#census_record_street_house_number').val()
if (house === '') house = null
let locality_id = jQuery('#census_record_locality_id').val()
let street = jQuery('#street_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"
Further reading
Method render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render
html_options = { class: 'cms-slide cms-embed ' }
html_options[:class] << embed.css_class if embed.css_class?
html_options[:id] = embed.css_id if embed.css_id
html_options[:style] = 'padding-top:56.2%;width:100%;position:relative;'
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render
html = content_tag :source, '', { src: audio.url }
html = content_tag :audio, html, { controls: 'controls' }
- 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"