CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Consider simplifying this complex logical expression.
Open

            if ( is_bool($v) ) {
                $val = $v ? 'true' : 'false';
                $options .= $k . ':' . $val . ',';
                continue;
            } elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                <?php if ( is_404() || is_category() || is_day() || is_month() ||
                            is_year() || is_search() || is_paged() ) {
                ?> <li>
    
                <?php /* If this is a 404 page */ if (is_404()) { ?>
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/theme-compat/sidebar.php - About 1 hr to fix

      Function viewportOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        viewportOffset: function(forElement) {
          var valueT = 0, valueL = 0;
      
          var element = forElement;
          do {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 55 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 PopupWindow has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function PopupWindow() {
          if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
          if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
          if (!window.listenerAttached) {
              window.listenerAttached = true;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 55 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 getPermission has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          getPermission : function() {
              var perm = true;
      
              if ( 'undefined' != typeof google && google.gears ) {
                  if ( ! google.gears.factory.hasPermission )
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/js/wp-gears.dev.js - About 55 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 positionedOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        positionedOffset: function(element) {
          var valueT = 0, valueL = 0;
          do {
            valueT += element.offsetTop  || 0;
            valueL += element.offsetLeft || 0;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 55 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 replace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        Element.Methods.replace = function(element, content) {
          element = $(element);
      
          if (content && content.toElement) content = content.toElement();
          if (Object.isElement(content)) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 55 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 writeAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        writeAttribute: function(element, name, value) {
          element = $(element);
          var attributes = { }, t = Element._attributeTranslations.write;
      
          if (typeof name == 'object') attributes = name;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 55 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 setOpacity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        Element.Methods.setOpacity = function(element, value) {
          element = $(element);
          element.style.opacity = (value == 1) ? 0.999999 :
            (value === '') ? '' : (value < 0.00001) ? 0 : value;
          return element;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 55 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 renderCharMapHTML has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function renderCharMapHTML() {
          var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
          var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
          var cols=-1;
      
      

      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 positionedOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        positionedOffset: function(element) {
          var valueT = 0, valueL = 0;
          do {
            valueT += element.offsetTop  || 0;
            valueL += element.offsetLeft || 0;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 55 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 setOpacity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        Element.Methods.setOpacity = function(element, value) {
          element = $(element);
          element.style.opacity = (value == 1) ? 0.999999 :
            (value === '') ? '' : (value < 0.00001) ? 0 : value;
          return element;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 55 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 writeAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        writeAttribute: function(element, name, value) {
          element = $(element);
          var attributes = { }, t = Element._attributeTranslations.write;
      
          if (typeof name == 'object') attributes = name;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 55 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 replace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        Element.Methods.replace = function(element, content) {
          element = $(element);
      
          if (content && content.toElement) content = content.toElement();
          if (Object.isElement(content)) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 55 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        render: function() {
          if(this.entryCount > 0) {
            for (var i = 0; i < this.entryCount; i++)
              this.index==i ? 
                Element.addClassName(this.getEntry(i),"selected") : 
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/controls.js - About 55 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 handleKeys has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      },handleKeys:function(e){
      var dir={x:0,y:0};
      if(!this.dragging){
      switch(e.keyCode){
      case (37):
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/crop/cropper.js - About 55 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 viewportOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        viewportOffset: function(forElement) {
          var valueT = 0, valueL = 0;
      
          var element = forElement;
          do {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 55 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 initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        initialize: function(element) {
          var defaults = {
            handle: false,
            reverteffect: function(element, top_offset, left_offset) {
              var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - About 55 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 themes_api has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function themes_api($action, $args = null) {
      
          if ( is_array($args) )
              $args = (object)$args;
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/theme-install.php - About 55 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 privAddList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        function privAddList($p_filedescr_list, &$p_result_list, &$p_options)
        {
          $v_result=1;
      
          // ----- Add the files
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 55 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