Showing 267 of 327 total issues
Avoid too many return
statements within this function. Open
if (240 == so && 240 == wo) return 'Asia/Dubai';
Avoid too many return
statements within this function. Open
if (390 == so && 390 == wo) return 'Asia/Rangoon';
Avoid too many return
statements within this function. Open
if (600 == so && 600 == wo) return 'Australia/Brisbane';
Avoid too many return
statements within this function. Open
if (60 == so && 0 == wo) return 'Europe/London';
Avoid too many return
statements within this function. Open
if (345 == so && 345 == wo) return 'Asia/Katmandu';
Avoid too many return
statements within this function. Open
if (570 == so && 570 == wo) return 'Australia/Darwin';
Avoid too many return
statements within this function. Open
if (720 == so && 780 == wo) return 'Pacific/Auckland';
Avoid too many return
statements within this method. Open
return 'tasks.milestone_id'
Avoid too many return
statements within this method. Open
return "#{ class_type.downcase }_id"
Avoid too many return
statements within this method. Open
return render :json => {:billable => false}
Method compose_sql
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compose_sql(arg1, arg2)
if arg1.blank?
if arg2.blank?
''
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 changes_as_html
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def changes_as_html
res = []
type = resource_type_attribute
self.changes.each do |name, values|
- 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 set_custom_attribute_values=
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_custom_attribute_values=(params)
updated = []
existing = custom_attribute_values.clone.to_a
params.each do |values|
- 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 clean_body
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.clean_body(body)
new_body_end = body.to_s.index(Mailman::BODY_SPLIT) || body.to_s.length
body = body.to_s[0, new_body_end].strip
lines = body.to_s.split("\n")
- 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
@resource = current_user.company.resources.find(params[:id])
@resource.attributes = resource_attributes
@resource.company = current_user.company
log = log_resource_changes(@resource)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def destroy
filter = current_user.company.task_filters.find(params[:id])
if (filter.user == current_user) ||
(filter.shared? and current_user.admin?)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(controller, params)
tasks = []
if params[:filter_project].to_i > 0
tasks = Project.find(params[:filter_project]).tasks
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 users_to_notify_popup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def users_to_notify_popup
# anyone already attached to the task should be removed
excluded_ids = params[:watcher_ids].blank? ? 0 : params[:watcher_ids]
@users = current_user.customer ? current_user.customer.users.active.where("id NOT IN (#{excluded_ids})").order('name').limit(50) : []
@task = AbstractTask.accessed_by(current_user).find_by(:id => params[:id])
- 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
update_existing_property_values(@property)
not_empty_property_value = new_property_values_attributes[0]['value'] if new_property_values_attributes.present?
@property.property_values.build(new_property_values_attributes) if not_empty_property_value.present?
- 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 name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def name
n = "#{self.scm_project.scm_type.upcase} Commit"
if self.scm_project.scm_type == 'svn'
n << " (r#{self.changeset_rev})"
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"