Showing 133 of 203 total issues
Avoid too many return
statements within this function. Open
return "Very strong"
Avoid too many return
statements within this function. Open
if (strength < 10000) {return "#55ff55" }
Avoid too many return
statements within this method. Open
return ordinalized_date(time, '%H:%M on %-d %B %Y')
Avoid too many return
statements within this method. Open
return {success: false, errors: ['Could not retrieve Staged badges from OSM.']}
Avoid too many return
statements within this method. Open
return ordinalized_date(time, '%H:%M on %A %-d %B')
Avoid too many return
statements within this function. Open
return "#22ff22"
Method scheduled_jobs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def scheduled_jobs
return @scheduled_jobs unless @scheduled_jobs.nil?
job_status = lambda do |job|
return :running if job.locked_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 get_calendar_items_for_section
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_calendar_items_for_section(api, section, options)
[:start, :finish, :include_meetings, :include_events].each do |attr|
fail ArgumentError, "options doesn't contain a value for :#{attr}" unless options.has_key?(attr)
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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
@token = params[:token]
@user = User.load_from_reset_password_token(@token)
if @user && @user.change_password!(params[:password], params[:password_confirmation])
- 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 sortable_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sortable_link(column, title=nil)
css_class = 'sortable'
title ||= column.titleize
css_class += (column == sort_column) ? " sortable_current sortable_#{sort_direction}" : ''
direction = ((column == sort_column) && sort_direction == "asc") ? "desc" : "asc"
- 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_automation_tasks_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_automation_tasks_data(date)
Rails.application.eager_load! unless Rails.application.config.cache_classes # cache_clases is off in dev and on in prod
types = Module.constants.map{ |i| i=eval(i.to_s) }
types.select!{ |i| !i.nil? && i.is_a?(Class) && i.superclass.eql?(AutomationTask) }
- 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 delete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete
# Check the confirmation code from the confirm_delete page
unless session[:delete_my_account_confrmation_code].eql?(params[:confirmation_code])
redirect_to confirm_delete_my_account_path
return
- 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 hide
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def hide
request.format = :js if params[:format].nil?
@announcement = current_user.current_announcements.are_hideable.find(params[:id])
unless @announcement.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"