krafthaus/bauhaus

View on GitHub
bower_components/jquery/src/manipulation.js

Summary

Maintainability
F
1 mo
Test Coverage

File manipulation.js has 521 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    "./core",
    "./var/strundefined",
    "./var/concat",
    "./var/push",
Severity: Major
Found in bower_components/jquery/src/manipulation.js - About 1 day to fix

    Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        buildFragment: function( elems, context, scripts, selection ) {
            var j, elem, contains,
                tmp, tag, tbody, wrap,
                l = elems.length,
    
    
    Severity: Major
    Found in bower_components/jquery/src/manipulation.js - About 2 hrs to fix

      Function domManip has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          domManip: function( args, callback ) {
      
              // Flatten any nested arrays
              args = concat.apply( [], args );
      
      
      Severity: Major
      Found in bower_components/jquery/src/manipulation.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                    if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                        ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                        ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                        !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
        
        
        Severity: Critical
        Found in bower_components/jquery/src/manipulation.js - About 1 hr to fix

          Function clone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                  var destElements, node, clone, i, srcElements,
                      inPage = jQuery.contains( elem.ownerDocument, elem );
          
                  if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
          Severity: Minor
          Found in bower_components/jquery/src/manipulation.js - About 1 hr to fix

            Function cleanData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                cleanData: function( elems, /* internal */ acceptData ) {
                    var elem, type, id, data,
                        i = 0,
                        internalKey = jQuery.expando,
                        cache = jQuery.cache,
            Severity: Minor
            Found in bower_components/jquery/src/manipulation.js - About 1 hr to fix

              Function fixCloneNodeIssues has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function fixCloneNodeIssues( src, dest ) {
                  var nodeName, e, data;
              
                  // We do not need to do anything for non-Elements
                  if ( dest.nodeType !== 1 ) {
              Severity: Minor
              Found in bower_components/jquery/src/manipulation.js - About 1 hr to fix

                Function html has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    html: function( value ) {
                        return access( this, function( value ) {
                            var elem = this[ 0 ] || {},
                                i = 0,
                                l = this.length;
                Severity: Minor
                Found in bower_components/jquery/src/manipulation.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          while ( j-- ) {
                                              if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
                                                  elem.removeChild( tbody );
                                              }
                                          }
                  Severity: Major
                  Found in bower_components/jquery/src/manipulation.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for ( type in data.events ) {
                                                if ( special[ type ] ) {
                                                    jQuery.event.remove( elem, type );
                    
                                                // This is a shortcut to avoid jQuery.event.remove's overhead
                    Severity: Major
                    Found in bower_components/jquery/src/manipulation.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ( rscriptType.test( node.type || "" ) &&
                                                  !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
                      
                                                  if ( node.src ) {
                                                      // Optional AJAX dependency, but won't run scripts if not present
                      Severity: Major
                      Found in bower_components/jquery/src/manipulation.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ( hasScripts ) {
                                                    jQuery.merge( scripts, getAll( node, "script" ) );
                                                }
                        Severity: Major
                        Found in bower_components/jquery/src/manipulation.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ( deleteExpando ) {
                                                      delete elem[ internalKey ];
                          
                                                  } else if ( typeof elem.removeAttribute !== strundefined ) {
                                                      elem.removeAttribute( internalKey );
                          Severity: Major
                          Found in bower_components/jquery/src/manipulation.js - About 45 mins to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            jQuery.fn.extend({
                                text: function( value ) {
                                    return access( this, function( value ) {
                                        return value === undefined ?
                                            jQuery.text( this ) :
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 wk to fix
                            bower_components/jquery/dist/jquery.js on lines 5719..5969

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 1989.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            jQuery.extend({
                                clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                                    var destElements, node, clone, i, srcElements,
                                        inPage = jQuery.contains( elem.ownerDocument, elem );
                            
                            
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 wk to fix
                            bower_components/jquery/dist/jquery.js on lines 5483..5717

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 1712.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function fixCloneNodeIssues( src, dest ) {
                                var nodeName, e, data;
                            
                                // We do not need to do anything for non-Elements
                                if ( dest.nodeType !== 1 ) {
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 2 days to fix
                            bower_components/jquery/dist/jquery.js on lines 5416..5481

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 483.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function getAll( context, tag ) {
                                var elems, elem,
                                    i = 0,
                                    found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
                                        typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 day to fix
                            bower_components/jquery/dist/jquery.js on lines 5324..5344

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 235.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function cloneCopyEvent( src, dest ) {
                            
                                if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
                                    return;
                                }
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 day to fix
                            bower_components/jquery/dist/jquery.js on lines 5388..5414

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 225.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
                                    "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
                                rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
                                rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
                                rleadingWhitespace = /^\s+/,
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 day to fix
                            bower_components/jquery/dist/jquery.js on lines 5286..5318

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 222.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            jQuery.each({
                                appendTo: "append",
                                prependTo: "prepend",
                                insertBefore: "before",
                                insertAfter: "after",
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 day to fix
                            bower_components/jquery/dist/jquery.js on lines 5971..5995

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 197.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function manipulationTarget( elem, content ) {
                                return jQuery.nodeName( elem, "table" ) &&
                                    jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
                            
                                    elem.getElementsByTagName("tbody")[0] ||
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 3 hrs to fix
                            bower_components/jquery/dist/jquery.js on lines 5355..5362

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 100.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function createSafeFragment( document ) {
                                var list = nodeNames.split( "|" ),
                                    safeFrag = document.createDocumentFragment();
                            
                                if ( safeFrag.createElement ) {
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 2 hrs to fix
                            bower_components/jquery/dist/jquery.js on lines 5272..5284

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 79.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function setGlobalEval( elems, refElements ) {
                                var elem,
                                    i = 0;
                                for ( ; (elem = elems[i]) != null; i++ ) {
                                    jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 2 hrs to fix
                            bower_components/jquery/dist/jquery.js on lines 5380..5386

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 77.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function restoreScript( elem ) {
                                var match = rscriptTypeMasked.exec( elem.type );
                                if ( match ) {
                                    elem.type = match[1];
                                } else {
                            Severity: Major
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 1 hr to fix
                            bower_components/jquery/dist/jquery.js on lines 5369..5377

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 70.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function disableScript( elem ) {
                                elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
                                return elem;
                            }
                            Severity: Minor
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 55 mins to fix
                            bower_components/jquery/dist/jquery.js on lines 5365..5368

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 54.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                            function fixDefaultChecked( elem ) {
                                if ( rcheckableType.test( elem.type ) ) {
                                    elem.defaultChecked = elem.checked;
                                }
                            }
                            Severity: Minor
                            Found in bower_components/jquery/src/manipulation.js and 1 other location - About 40 mins to fix
                            bower_components/jquery/dist/jquery.js on lines 5347..5351

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            There are no issues that match your filters.

                            Category
                            Status