CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Avoid deeply nested control flow statements.
Open

            if (node.nodeIndex == indices[j]) results.push(node);
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 45 mins to fix

    Function getTokenBounds has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      getTokenBounds: function() {
        if (null != this.tokenBounds) return this.tokenBounds;
        var value = this.element.value;
        if (value.strip().empty()) return [-1, 0];
        var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/controls.js - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid deeply nested control flow statements.
    Open

    if(_50.x<this.startCoords.x2){
    _52.x=-1;
    }
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/crop/cropper.js - About 45 mins to fix

      Function Methods has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      Event.Methods = (function() {
        var isButton;
      
        if (Prototype.Browser.IE) {
          var buttonMap = { 0: 1, 1: 4, 2: 2 };
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Avoid deeply nested control flow statements.
      Open

      if(_50.y<this.startCoords.y1){
      _52.y=-1;
      }
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/crop/cropper.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

              if (element.offsetParent == document.body)
                if (Element.getStyle(element, 'position') == 'absolute') break;
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                  if (value[1]) return parseFloat(value[1]) / 100;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 45 mins to fix

            Function createControl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              createControl: function(mode, handler, extraClasses) {
                var control = this.options[mode + 'Control'];
                var text = this.options[mode + 'Text'];
                if ('button' == control) {
                  var btn = document.createElement('input');
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/controls.js - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Avoid deeply nested control flow statements.
            Open

            if(el.childNodes.length){
            el.removeChild(el.childNodes[0]);
            }
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/js/crop/cropper.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          for (var i = 0, node; node = nodes[i]; i++)
                            if (Element.descendantOf(targetNode, node)) return [targetNode];
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 45 mins to fix

                Function schedule has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                function schedule() {
                    var now = new Date();
                    var date = now.getDate();
                    var month = now.getMonth();
                    var month = month + 1;
                Severity: Minor
                Found in Web.Admin/2022/js/schedule.js - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Avoid deeply nested control flow statements.
                Open

                              for(attr in arguments[1]) 
                                element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/builder.js - About 45 mins to fix

                  Function edButton has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function edButton(id, display, tagStart, tagEnd, access, open) {
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js - About 45 mins to fix

                    Function loop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      loop: function(timePos) {
                        if (timePos >= this.startOn) {
                          if (timePos >= this.finishOn) {
                            this.render(1.0);
                            this.cancel();
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function _tree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _tree: function(element, options, parent) {
                        var children = Sortable.findElements(element, options) || [];
                      
                        for (var i = 0; i < children.length; ++i) {
                          var match = children[i].id.match(options.format);
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      show: function(point, element) {
                        if(!this.drops.length) return;
                        var drop, affected = [];
                        
                        this.drops.each( function(drop) {
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create: function(element) {
                        element = $(element);
                        var options = Object.extend({ 
                          element:     element,
                          tag:         'li',       // assumes li children, override with tag: 'tagname'
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function loadGallery has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function loadGallery(folioGallerydir,targetdiv,album,numperpage,pagenum,fullalbum) {                    
                    Severity: Minor
                    Found in Web.Admin/2014/foliogallery/foliogallery.js - About 45 mins to fix

                      Function loadFlash has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          SWFUpload.prototype.loadFlash = function (oldLoadFlash) {
                              return function () {
                                  var hasFlash = swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);
                                  
                                  if (hasFlash) {

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function schedule has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function schedule() {
                          var now = new Date();
                          var date = now.getDate();
                          var month = now.getMonth();
                          var month = month + 1;
                      Severity: Minor
                      Found in Web.Admin/2018/js/schedule.js - About 45 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language