Showing 277 of 434 total issues
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
AlaveteliLocalization.with_locale(AlaveteliLocalization.default_locale) do
if params[:change_request_id]
@change_request = PublicBodyChangeRequest.find(params[:change_request_id])
end
- 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 index
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def index
@title ||= 'Listing users'
@query = params[:query].try(:strip)
- 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 show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def show
respond_to do |format|
format.html do
@holding_pen = in_holding_pen?(@raw_email) ? true : false
- 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 contact
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def contact
return unless params[:submitted_contact_form]
if @recaptcha_required && !verify_recaptcha
flash.now[:error] = _('There was an error with the reCAPTCHA. ' \
- 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 destroy_and_rebuild_index
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.destroy_and_rebuild_index(model_classes, verbose = false, terms = true, values = true, texts = true, safe_rebuild = true)
Method bulk_destroy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def bulk_destroy
if params[:commit] == "No"
redirect_to(admin_request_url(params[:request_id]))
end
- 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_bodies
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_bodies
@draft = current_user.draft_info_request_batches.
find_by(id: update_bodies_params[:draft_id])
case update_bodies_params[:action]
when 'add-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 perform_search
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform_search(models, query, sortby, collapse, per_page = 25, this_page = nil)
Method update_index
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.update_index(flush = false, verbose = false)
# STDOUT.puts("start of ActsAsXapian.update_index") if verbose
# Before calling writable_init we have to make sure every model class has been initialized.
# i.e. has had its class code loaded, so acts_as_xapian has been called inside it, and
- 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 redeliver
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def redeliver
message_ids = params[:url_title].split(',').map(&:strip)
previous_request = @incoming_message.info_request
destination_request = nil
- 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 alert_not_clarified_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.alert_not_clarified_request
info_requests = InfoRequest.
where("awaiting_description = ?
AND described_state = 'waiting_clarification'
AND info_requests.updated_at < ?
- 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 ensure_masked
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ensure_masked
if @attachment.masked?
yield
else
FoiAttachmentMaskJob.perform_later(@attachment)
- 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 get_tag_values
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_tag_values(tag_as_string)
found = false
results = []
tags.each do |tag|
if tag.name == tag_as_string
- 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 csv_export
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.csv_export(model, to_run, query=nil, header=nil, override={}, header_map={})
Method poll_for_incoming_loop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.poll_for_incoming_loop
if AlaveteliConfiguration.production_mailer_retriever_method == 'pop'
poller = new
Rails.logger.info "Starting #{ poller } polling loop"
loop do
- 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 user_message
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def user_message(from_user, recipient_user, from_user_url, subject, message)
Method _destroy_and_rebuild_index_safely
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self._destroy_and_rebuild_index_safely(model_classes, verbose, terms, values, texts)
Method fake_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fake_response(info_request, from_user, message_body, attachment_name, attachment_content)
Method process_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.process_data(filename, display_header, column_data, overrides, query)
Method ensure_filename!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ensure_filename!
if filename.blank?
calc_ext = AlaveteliFileTypes.mimetype_to_extension(content_type)
calc_ext = "bin" unless calc_ext
if !within_rfc822_subject.nil?
- 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"