Showing 277 of 350 total issues
Avoid deeply nested control flow statements. Open
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
setClass += " " + classNames[c];
}
}
Avoid deeply nested control flow statements. Open
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
Avoid deeply nested control flow statements. Open
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
Function dirNodeCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Avoid deeply nested control flow statements. Open
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
Avoid deeply nested control flow statements. Open
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
Function dirCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Avoid deeply nested control flow statements. Open
if ( pos == null ) {
eventType.splice( j--, 1 );
}
Avoid deeply nested control flow statements. Open
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
} else {
jQuery.removeEvent( elem, type, data.handle );
Method visible_field_descriptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def visible_field_descriptions(type = nil, limit = nil)
type ||= :listing
where = "is_visible_in_#{type.to_s}".to_sym
@field_descriptions_cache = {} unless @field_descriptions_cache
if @field_descriptions_cache[type]
- 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 deeply nested control flow statements. Open
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
Avoid deeply nested control flow statements. Open
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
logout_keeping_session!
user = User.authenticate(params[:login], params[:password])
if user
# Protects against session fixation attacks, causes request forgery
- 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 log_changes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def log_changes
change_details = []
changed_attributes.each do |attribute, old_value|
next if attribute == "updated_at"
next if old_value == self[attribute]
- 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 deeply nested control flow statements. Open
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery(option).val();
Function access
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
access: function( elems, key, value, exec, fn, pass ) {
Avoid deeply nested control flow statements. Open
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Function CLASS
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
Function ATTR
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
Avoid deeply nested control flow statements. Open
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}