Showing 157 of 179 total issues
Method get_name_and_type_from_param
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_name_and_type_from_param( record, type = nil )
name, type =
case record
when Record
[ record.name, record.class.to_s ]
- 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_convenience_accessors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_convenience_accessors
# Setup our convenience values
@primary_ns, @contact, @serial, @refresh, @retry, @expire, @minimum =
self[:content].split(/\s+/) unless self[:content].blank?
%w{ serial refresh retry expire minimum }.each do |i|
- 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_convenience_accessors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_convenience_accessors
return unless self.record_type == 'SOA'
# Setup our convenience values
@primary_ns, @contact, @serial, @refresh, @retry, @expire, @minimum =
- 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 display_hash
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def display_hash( hash )
hash ||= {}
hash.map do |k,v|
if v.nil?
nil # strip out non-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 apply_to
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_to( domain )
Record.batch do
macro_steps.each do |step|
if step.action == 'create'
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
@record = parent.send( "#{params[:record][:type].downcase}_records".to_sym ).new( params[:record] )
if current_token && !current_token.allow_new_records? &&
!current_token.can_add?( @record )
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
# Check for any previous macro steps
if parent.macro_steps.any?
# Check for the parameter
unless params[:macro_step][:position].blank?
- 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 hijack_method
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hijack_method(klass, method_name, eval_string = nil, arg_names = [], &block)
method_name = method_name.to_s
# You have got love ruby! What other language allows you to pillage and plunder a class like this?
(@method_stores[klass]||=[]) << [
- 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 function. Open
return ( diff % first === 0 && diff / first >= 0 );
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 value;
Avoid too many return
statements within this function. Open
return elem[ name ];
Avoid too many return
statements within this function. Open
return 1;
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 makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
Avoid too many return
statements within this function. Open
return (context || rootjQuery).find( selector );
Avoid too many return
statements within this function. Open
return this;
Avoid too many return
statements within this function. Open
return this.constructor( context ).find( selector );
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );