Showing 338 of 434 total issues
Method authenticate_attachment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def authenticate_attachment
# Test for hidden
if cannot?(:read, @info_request)
request.format = :html
return render_hidden
- 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 lookup_query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lookup_query
@locale = AlaveteliLocalization.locale
AlaveteliLocalization.with_locale(@locale) do
@query = params[:query]
@query = nil if @query == ""
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(model_classes, query_string, options = {}, user_query = nil)
# Check parameters, convert to actual array of model classes
new_model_classes = []
model_classes = [model_classes] if model_classes.class != Array
model_classes.each do |model_class|
- 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 true
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 0
Avoid too many return
statements within this method. Open
return false if empty_return_path?
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 true if @user
Avoid too many return
statements within this method. Open
handle_spam_subject(@info_request.user) && 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
Avoid too many return
statements within this method. Open
return false if data[:hidden_rows] == total_count && total_count <= 50