Showing 146 of 242 total issues
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return defaultMatcher(f);
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return this.each(function() {
var $target = $(this);
// If plug-in hasn't been applied before - initialize, otherwise - skip
if (isPluginApplied(this)){
updateMap(getContextForElement(this), $(this), options);
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return {
map: gmapContext.map,
marker: gmapContext.marker,
location: locationObj
}
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return fuzzyMatcher(f, isObject);
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return this;
Avoid too many return
statements within this function. Open
return el[map];
Method event_links_for_resource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def event_links_for_resource(current_resource, type)
return [] unless current_resource.respond_to? :state_events
links = []
- 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 breadcrumbs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def breadcrumbs
result = render_navigation context: application_navigation, renderer: :breadcrumbs_without_method_links, join_with: ' > '
result = result && result.scan('<a').length > 1 ? result : ''
if respond_to?(:resource) && resource.respond_to?(:ancestors)
- 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 up
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def up
Product.each do |product|
next if product.klass_name.present?
if product.name == 'Product'
- 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.arguments.where('arguments.id = ?', params[:id]).first
errors = {}
if resource.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 up
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def up
add_column :vacancies, :resource_type, :string
add_column :vacancies, :resource_id, :integer
if (Product::Recruiting rescue 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 down
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def down
add_column :vacancies, :user_id, :integer
if (Product::Recruiting rescue nil)
Vacancy.where('resource_type = "User"').update_all('user_id = resource_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 name_valid?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def name_valid?
return unless name_changed?
if name.present?
if Task.where(name: name, story_id: story_id).any?
- 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 resource_exists?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resource_exists?(name)
if eval("@#{name}.nil?") || (eval("@#{name}.class.name") != name.classify && eval("@#{name}.class.superclass.name") != name.classify) || eval("@#{name}.id.nil?")
return false
else
return true
- 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"