Showing 49 of 70 total issues
Function setConfigs
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
setConfigs: function () {
'use strict';
this.setConfig('nothing',
{
toolbar: []
Method set_l10n_attributes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def set_l10n_attributes(base_params, resource)
l10ns_attributes = base_params.delete(:localizations)
base_params[:localizations_attributes] = []
l10ns_attributes.each do |language_iso_code, l10n_params|
language = Language.find_by(iso_code: language_iso_code)
- 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
Class Origins
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Osuny::Media::Picker::Origins
attr_reader :picker
delegate :params, :university, :about, :image, :image_property, :alt, :credit,
to: :picker
Method upsert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upsert
organizations_params = params[:organizations] || []
every_organization_has_migration_identifier = organizations_params.all? { |organization_params|
organization_params[:migration_identifier].present?
}
- 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 upsert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upsert
categories_params = params[:categories] || []
every_category_has_migration_identifier = categories_params.all? { |category_params|
category_params[:migration_identifier].present?
}
- 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 upsert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upsert
pages_params = params[:pages] || []
every_page_has_migration_identifier = pages_params.all? { |page_params|
page_params[:migration_identifier].present?
}
- 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 upsert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upsert
categories_params = params[:categories] || []
every_category_has_migration_identifier = categories_params.all? { |category_params|
category_params[:migration_identifier].present?
}
- 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 upsert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upsert
posts_params = params[:posts] || []
every_post_has_migration_identifier = posts_params.all? { |post_params|
post_params[:migration_identifier].present?
}
- 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 upsert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upsert
events_params = params[:events] || []
every_event_has_migration_identifier = events_params.all? { |event_params|
event_params[:migration_identifier].present?
}
- 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 set_time_slots_attributes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def set_time_slots_attributes(permitted_params, event)
time_slots_attributes = permitted_params.delete(:time_slots)
time_slots_attributes.each do |time_slot_attributes|
# Set the id of the time slot if it already exists
- 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 initSortable
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSortable: function () {
'use strict';
var nestedSortables,
i;
Method upsert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upsert
categories_params = params[:categories] || []
every_category_has_migration_identifier = categories_params.all? { |category_params|
category_params[:migration_identifier].present?
}
Method upsert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upsert
organizations_params = params[:organizations] || []
every_organization_has_migration_identifier = organizations_params.all? { |organization_params|
organization_params[:migration_identifier].present?
}
Method upsert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upsert
pages_params = params[:pages] || []
every_page_has_migration_identifier = pages_params.all? { |page_params|
page_params[:migration_identifier].present?
}
Method upsert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upsert
posts_params = params[:posts] || []
every_post_has_migration_identifier = posts_params.all? { |post_params|
post_params[:migration_identifier].present?
}
Method upsert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upsert
events_params = params[:events] || []
every_event_has_migration_identifier = events_params.all? { |event_params|
event_params[:migration_identifier].present?
}
Method upsert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upsert
categories_params = params[:categories] || []
every_category_has_migration_identifier = categories_params.all? { |category_params|
category_params[:migration_identifier].present?
}
Method set_featured_image_to_l10n_params
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_featured_image_to_l10n_params(l10n_params, l10n: nil)
featured_image_data = l10n_params.delete(:featured_image)
return unless featured_image_data.present?
l10n_params[:featured_image_alt] = featured_image_data[:alt] if featured_image_data.has_key?(:alt)
l10n_params[:featured_image_credit] = featured_image_data[:credit] if featured_image_data.has_key?(:credit)
- 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 build_person
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_person
if @email.present?
person = find_person_with_email
elsif @first_name.present? && @last_name.present?
person = find_person_with_name_in_current_language
Method organization
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def organization
unless @organization
if @siren.present? && @nic.present?
@organization = find_organization_with_siren_and_nic
elsif @siren.present?