Showing 157 of 179 total issues
Avoid too many return
statements within this function. Open
return jQuery.isNaN( ret ) ? orig : ret;
Avoid too many return
statements within this function. Open
return this;
Avoid too many return
statements within this function. Open
return elem[ name ];
Avoid too many return
statements within this function. Open
return this.css( type, typeof size === "string" ? size : size + "px" );
Avoid too many return
statements within this function. Open
return jQuery.makeArray( selector, this );
Avoid too many return
statements within this function. Open
return diff === 0;
Avoid too many return
statements within this method. Open
return self.permissions['policy'] == 'allow'
Avoid too many return
statements within this function. Open
return (context || rootjQuery).find( selector );
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return siblingCheck( ap[i], bp[i] );
Avoid too many return
statements within this function. Open
return ( diff % first === 0 && diff / first >= 0 );
Avoid too many return
statements within this function. Open
return makeArray( context.querySelectorAll(query), extra );
Avoid too many return
statements within this function. Open
return rootjQuery.find( selector );
Avoid too many return
statements within this function. Open
return ret;
Method macro_change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def macro_change( domain, step )
changed = false
domain.records.all( :conditions => { :type => step.record_type }).each do |record|
next unless record.shortname == step.name
- 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 link_to_record_audit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def link_to_record_audit( audit )
caption = audit.audited_changes['type']
caption ||= (audit.auditable.nil? ? '[UNKNOWN]' : audit.auditable.class.to_s )
unless audit.audited_changes['name'].nil?
name = audit.audited_changes['name'].is_a?( Array ) ? audit.audited_changes['name'].pop : audit.audited_changes['name']
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def results
if params[:q].chomp.blank?
respond_to do |format|
format.html { redirect_to root_path }
format.json { render :status => 404, :json => { :error => "Missing 'q' parameter" } }
- 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"