Showing 167 of 167 total issues
Method matching_impound_records
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def matching_impound_records
impound_records = ImpoundRecord
if params[:search_status] == "all"
@search_status = "all"
- 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 find_mail_snippets
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def find_mail_snippets
@organization = current_organization
@kind = if MailSnippet.organization_emails_with_snippets.include?(params[:id]) || params[:id] == "organization_stolen_message"
params[:id]
else
- 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 creation_user_id
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def creation_user_id
if permanent_token? || doorkeeper_authorized_no_user?
# current_organization requires token user to be authorized - V2_ACCESSOR is not
organization = Organization.friendly_find(params[:organization_slug])
if organization.present? && current_token&.application&.owner&.admin_of?(organization)
- 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 update
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def update
# Needs to update approved before saving so set_locations_shown is applied on save
# Also, special handling because we need to be able to unset manual_pos_kind
manual_pos_kind = params.dig(:organization, :manual_pos_kind)
- 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 create
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def create
@b_param = find_or_new_b_param
iframe_redirect_params = {organization_id: current_organization.to_param}
if @b_param.created_bike.present?
flash[:success] = "#{@bike.created_bike.type} Created"
- 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 write_excel
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def write_excel(file)
axlsx_package = Axlsx::Package.new
axlsx_package.workbook.add_worksheet(name: "Basic Worksheet") do |sheet|
sheet.add_row(export_headers)
row_index = 0
- 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 perform
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def perform(ownership_id)
ownership = Ownership.find_by_id(ownership_id)
return true unless ownership.present? && ownership.bike.present?
# recalculate spaminess, to verify that bike should be emailed
if SpamEstimator.estimate_bike(ownership.bike) > SpamEstimator::MARK_SPAM_PERCENT
- 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"