Showing 157 of 179 total issues
Function show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show: function( speed, easing, callback ) {
var elem, display;
if ( speed || speed === 0 ) {
return this.animate( genFx("show", 3), speed, easing, callback);
Function custom
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx,
raf;
Function type
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn[ type ] = function( size ) {
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
Function handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handle: function( event ) {
event = jQuery.event.fix( event || window.event );
// Snapshot the handlers list since a called handler may add/remove events.
var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
run_all = !event.exclusive && !event.namespace,
Function find
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Sizzle.find = function( expr, context, isXML ) {
var set;
if ( !expr ) {
return [];
Function cloneFixAttributes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cloneFixAttributes( src, dest ) {
var nodeName;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
Function >
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
Function toggleClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
Method can_change?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def can_change?( record, type = '*' )
name, type = get_name_and_type_from_param( record, type )
# NS records?
return false if type == 'NS' || type == 'SOA'
- 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 build
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def build( domain_name = nil )
# get the class of the record_type
record_class = self.record_type.constantize
# duplicate our own attributes, strip out the ones the destination doesn't
- 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
Open
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
Avoid deeply nested control flow statements. Open
Open
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
Avoid deeply nested control flow statements. Open
Open
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
Avoid deeply nested control flow statements. Open
Open
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
Avoid deeply nested control flow statements. Open
Open
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
Avoid deeply nested control flow statements. Open
Open
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
Avoid deeply nested control flow statements. Open
Open
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
Avoid deeply nested control flow statements. Open
Open
if ( related && jQuery.contains( elem, related ) ) {
related = elem;
}
Avoid deeply nested control flow statements. Open
Open
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
conv2 = converters[ tmp[1] + " " + current ];
if ( conv2 ) {
conv1 = converters[ conv1 ];
if ( conv1 === true ) {
Avoid deeply nested control flow statements. Open
Open
if ( !old ) {
context.setAttribute( "id", nid );
} else {
nid = nid.replace( /'/g, "\\$&" );
}