mar10/fancytree

View on GitHub
src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js

Summary

Maintainability
F
1 mo
Test Coverage

File jquery.fancytree.ui-deps.js has 1037 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery UI - v1.13.2 - 2022-08-16
* http://jqueryui.com
* Includes: widget.js, position.js, jquery-patch.js, keycode.js, scroll-parent.js, unique-id.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

Severity: Major
Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 2 days to fix

    Function position has 147 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    $.fn.position = function( options ) {
        if ( !options || !options.of ) {
            return _position.apply( this, arguments );
        }
    
    
    Severity: Major
    Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 5 hrs to fix

      Function widget has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      $.widget = $.widget || function( name, base, prototype ) {
          var existingConstructor, constructor, basePrototype;
      
          // ProxiedPrototype allows the provided prototype to remain unmodified
          // so that it can be used as a mixin for multiple widgets (#8876)
      Severity: Major
      Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 3 hrs to fix

        Function bridge has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.widget.bridge = function( name, object ) {
            var fullName = object.prototype.widgetFullName || name;
            $.fn[ name ] = function( options ) {
                var isMethodCall = typeof options === "string";
                var args = widgetSlice.call( arguments, 1 );
        Severity: Major
        Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 2 hrs to fix

          Function name has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn[ name ] = function( options ) {
                  var isMethodCall = typeof options === "string";
                  var args = widgetSlice.call( arguments, 1 );
                  var returnValue = this;
          
          
          Severity: Minor
          Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 2 hrs to fix

            Function _classes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _classes: function( options ) {
                    var full = [];
                    var that = this;
            
                    options = $.extend( {
            Severity: Minor
            Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

              Function _on has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _on: function( suppressDisabledCheck, element, handlers ) {
                      var delegateElement;
                      var instance = this;
              
                      // No suppressDisabledCheck flag, shuffle arguments
              Severity: Minor
              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

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

                        top: function( position, data ) {
                            var within = data.within,
                                withinOffset = within.offset.top + within.scrollTop,
                                outerHeight = within.height,
                                offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
                Severity: Minor
                Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

                  Function left has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          left: function( position, data ) {
                              var within = data.within,
                                  withinOffset = within.offset.left + within.scrollLeft,
                                  outerWidth = within.width,
                                  offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
                  Severity: Minor
                  Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

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

                        _createWidget: function( options, element ) {
                            element = $( element || this.defaultElement || this )[ 0 ];
                            this.element = $( element );
                            this.uuid = widgetUuid++;
                            this.eventNamespace = "." + this.widgetName + this.uuid;
                    Severity: Minor
                    Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

                      Function option has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          option: function( key, value ) {
                              var options = key;
                              var parts;
                              var curOption;
                              var i;
                      Severity: Minor
                      Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

                        Function top has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                top: function( position, data ) {
                                    var within = data.within,
                                        withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                                        outerHeight = data.within.height,
                                        collisionPosTop = position.top - data.collisionPosition.marginTop,
                        Severity: Minor
                        Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

                          Function left has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  left: function( position, data ) {
                                      var within = data.within,
                                          withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
                                          outerWidth = within.width,
                                          collisionPosLeft = position.left - data.collisionPosition.marginLeft,
                          Severity: Minor
                          Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

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

                            function getDimensions( elem ) {
                                var raw = elem[ 0 ];
                                if ( raw.nodeType === 9 ) {
                                    return {
                                        width: elem.width(),
                            Severity: Minor
                            Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 1 hr to fix

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

                              $.Widget.prototype = {
                                  widgetName: "widget",
                                  widgetEventPrefix: "",
                                  defaultElement: "<div>",
                              
                              
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 3 wks to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 284..711
                              src/jquery-ui-dependencies/jquery-ui.js on lines 293..720

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

                              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

                              $.widget.bridge = function( name, object ) {
                                  var fullName = object.prototype.widgetFullName || name;
                                  $.fn[ name ] = function( options ) {
                                      var isMethodCall = typeof options === "string";
                                      var args = widgetSlice.call( arguments, 1 );
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 3 days to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 212..279
                              src/jquery-ui-dependencies/jquery-ui.js on lines 221..288

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

                              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

                              $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
                                  $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
                                      if ( typeof options === "string" ) {
                                          options = { effect: options };
                                      }
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 2 days to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 713..754
                              src/jquery-ui-dependencies/jquery-ui.js on lines 722..763

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

                              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

                              $.widget.extend = function( target ) {
                                  var input = widgetSlice.call( arguments, 1 );
                                  var inputIndex = 0;
                                  var inputLength = input.length;
                                  var key;
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 1 day to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 182..210
                              src/jquery-ui-dependencies/jquery-ui.js on lines 191..219

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

                              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

                              var scrollParent = $.fn.scrollParent = function( includeHidden ) {
                                  var position = this.css( "position" ),
                                      excludeStaticParent = position === "absolute",
                                      overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
                                      scrollParent = this.parents().filter( function() {
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 1 day to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 1381..1397
                              src/jquery-ui-dependencies/jquery-ui.js on lines 1390..1406

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

                              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

                              if ( !$.escapeSelector ) {
                              
                                  // CSS string/identifier serialization
                                  // https://drafts.csswg.org/cssom/#common-serializing-idioms
                                  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 6 hrs to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 1286..1311
                              src/jquery-ui-dependencies/jquery-ui.js on lines 1295..1320

                              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

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

                              var uniqueId = $.fn.extend( {
                                  uniqueId: ( function() {
                                      var uuid = 0;
                              
                                      return function() {
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 1 other location - About 6 hrs to fix
                              src/jquery-ui-dependencies/jquery-ui.js on lines 1424..1444

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

                              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

                              if ( !$.fn.even || !$.fn.odd ) {
                                  $.fn.extend( {
                                      even: function() {
                                          return this.filter( function( i ) {
                                              return i % 2 === 0;
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 4 hrs to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 1315..1328
                              src/jquery-ui-dependencies/jquery-ui.js on lines 1324..1337

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

                              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

                              var keycode = $.ui.keyCode = {
                                  BACKSPACE: 8,
                                  COMMA: 188,
                                  DELETE: 46,
                                  DOWN: 40,
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 3 hrs to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 1346..1363
                              src/jquery-ui-dependencies/jquery-ui.js on lines 1355..1372

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

                              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( factory ) {
                                  "use strict";
                                  
                                  if ( typeof define === "function" && define.amd ) {
                              
                              
                              Severity: Minor
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 1 other location - About 55 mins to fix
                              src/jquery-ui-dependencies/jquery-ui.js on lines 6..1449

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

                              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

                              if ( !$.expr.pseudos ) {
                                  $.expr.pseudos = $.expr[ ":" ];
                              }
                              Severity: Major
                              Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js and 2 other locations - About 45 mins to fix
                              src/jquery-ui-dependencies/jquery-ui-iife.js on lines 1273..1275
                              src/jquery-ui-dependencies/jquery-ui.js on lines 1282..1284

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

                              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