bronycub/sugarcub

View on GitHub
core/static/vendor/jquery/src/manipulation.js

Summary

Maintainability
F
2 wks
Test Coverage

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

define( [
    "./core",
    "./var/concat",
    "./var/push",
    "./core/access",
Severity: Minor
Found in core/static/vendor/jquery/src/manipulation.js - About 4 hrs to fix

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

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

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

          clone: function( elem, dataAndEvents, deepDataAndEvents ) {
              var i, l, srcElements, destElements,
                  clone = elem.cloneNode( true ),
                  inPage = jQuery.contains( elem.ownerDocument, elem );
      
      
      Severity: Minor
      Found in core/static/vendor/jquery/src/manipulation.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                            if ( hasScripts ) {
        
                                // Support: Android <=4.0 only, PhantomJS 1 only
                                // push.apply(_, arraylike) throws on ancient WebKit
                                jQuery.merge( scripts, getAll( node, "script" ) );
        Severity: Major
        Found in core/static/vendor/jquery/src/manipulation.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ( rscriptType.test( node.type || "" ) &&
                                  !dataPriv.access( node, "globalEval" ) &&
                                  jQuery.contains( doc, node ) ) {
          
                                  if ( node.src ) {
          Severity: Major
          Found in core/static/vendor/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 core/static/vendor/jquery/src/manipulation.js - About 45 mins to fix

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

              jQuery.fn.extend( {
                  detach: function( selector ) {
                      return remove( this, selector, true );
                  },
              
              
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 6 days to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5896..6034
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5896..6034

              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 1038.

              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 3 locations. Consider refactoring.
              Open

              function domManip( collection, args, callback, ignored ) {
              
                  // Flatten any nested arrays
                  args = concat.apply( [], args );
              
              
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 3 days to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5703..5791
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5703..5791

              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 644.

              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 3 locations. Consider refactoring.
              Open

              jQuery.extend( {
                  htmlPrefilter: function( html ) {
                      return html.replace( rxhtmlTag, "<$1></$2>" );
                  },
              
              
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 3 days to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5814..5894
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5814..5894

              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 606.

              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 3 locations. Consider refactoring.
              Open

              function cloneCopyEvent( src, dest ) {
                  var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
              
                  if ( dest.nodeType !== 1 ) {
                      return;
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 1 day to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5655..5687
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5655..5687

              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 276.

              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 3 locations. Consider refactoring.
              Open

              jQuery.each( {
                  appendTo: "append",
                  prependTo: "prepend",
                  insertBefore: "before",
                  insertAfter: "after",
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 1 day to fix
              core/static/vendor/jquery/dist/jquery.js on lines 6036..6061
              core/static/vendor/jquery/dist/jquery.slim.js on lines 6036..6061

              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 199.

              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 3 locations. Consider refactoring.
              Open

              function remove( elem, selector, keepData ) {
                  var node,
                      nodes = selector ? jQuery.filter( selector, elem ) : elem,
                      i = 0;
              
              
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 6 hrs to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5793..5812
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5793..5812

              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 165.

              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 3 locations. Consider refactoring.
              Open

              function fixInput( src, dest ) {
                  var nodeName = dest.nodeName.toLowerCase();
              
                  // Fails to persist the checked state of a cloned checkbox or radio button.
                  if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 3 hrs to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5690..5701
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5690..5701

              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 113.

              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 3 locations. Consider refactoring.
              Open

              function manipulationTarget( elem, content ) {
                  if ( jQuery.nodeName( elem, "table" ) &&
                      jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
              
                      return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 2 hrs to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5628..5636
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5628..5636

              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 81.

              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 3 locations. Consider refactoring.
              Open

              function restoreScript( elem ) {
                  var match = rscriptTypeMasked.exec( elem.type );
              
                  if ( match ) {
                      elem.type = match[ 1 ];
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 1 hr to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5643..5653
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5643..5653

              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 68.

              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 3 locations. Consider refactoring.
              Open

              function disableScript( elem ) {
                  elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
                  return elem;
              }
              Severity: Major
              Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 40 mins to fix
              core/static/vendor/jquery/dist/jquery.js on lines 5639..5642
              core/static/vendor/jquery/dist/jquery.slim.js on lines 5639..5642

              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 49.

              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