Showing 339 of 435 total issues
Method set_show_requests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_show_requests
# Use search query for this so can collapse and paginate easily
# TODO: really should just use SQL query here rather than Xapian.
@request_states = assign_request_states(@display_user)
- 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 run_job
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.run_job(job, flush, verbose)
if verbose
STDOUT.puts("ActsAsXapian.update_index #{job.action} #{job.model} #{job.model_id} #{Time.now}")
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 destroy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def destroy
begin
@customer = current_user.pro_account.try(:stripe_customer)
raise ActiveRecord::RecordNotFound unless @customer
- 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_about_me?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def show_about_me?
return true if @is_you
return false unless @display_user.get_about_me_for_html_display.present?
return false unless @display_user.active?
return true if @display_user.confirmed_not_spam?
- 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 results
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def results
# If they've already pulled out the results, just return them.
return cached_results unless cached_results.nil?
docs = []
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def update
if params[:change_request_id]
@change_request = PublicBodyChangeRequest.find(params[:change_request_id])
end
AlaveteliLocalization.with_locale(AlaveteliLocalization.default_locale) 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 check_for_env_vars
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_for_env_vars(env_vars, example)
missing = []
env_vars.each do |env_var|
missing << env_var unless ENV[env_var]
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 csv_export
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.csv_export(model, to_run, query=nil, header=nil, override={}, header_map={})
return unless is_required?(model.name, to_run)
# set query and header to default values unless supplied
query ||= model
- 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
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
return false if empty_return_path?
Avoid too many return
statements within this method. Open
return false if auto_submitted?
Avoid too many return
statements within this method. Open
return 2 if MailHandler::ReplyHandler.is_oof?(message)
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return false if data[:hidden_rows] == total_count && total_count <= 50
Avoid too many return
statements within this method. Open
return render_new_preview if params[:preview].to_i == 1
Avoid too many return
statements within this method. Open
handle_blocked_ip(@info_request) && return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return