CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

    public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
        if ( $src_abs ) {
            $src_w -= $src_x;
            $src_h -= $src_y;
        }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor-imagick.php - 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 _wp_put_post_revision has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_put_post_revision( $post = null, $autosave = false ) {
    if ( is_object($post) )
        $post = get_object_vars( $post );
    elseif ( !is_array($post) )
        $post = get_post($post, ARRAY_A);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.php - 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 (isset($category['attribs']['']['label']))
                                    {
                                        $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
                                    }
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 45 mins to fix

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

        public static function percent_encoding_normalization($match)
        {
            $integer = hexdec($match[1]);
            if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
            {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php - 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 standalone_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function standalone_value()
        {
            if ($standalone = $this->get_value())
            {
                switch ($standalone)

    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 (isset($category['data']))
                                        {
                                            $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                                        }
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          if (isset($category['data']))
                                          {
                                              $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                                          }
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        if (isset($category['attribs']['']['label']))
                                        {
                                            $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
                                        }
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (count($attribs[$j]) === 2)
                                  {
                                      $attribs[$j][2] = $attribs[$j][1];
                                  }
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php - About 45 mins to fix

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

                public function get_title()
                {
                    if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
                    {
                        return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - 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 (isset($category['attribs']['']['label']))
                                                {
                                                    $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
                                                }
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (isset($category['data']))
                                              {
                                                  $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                                              }
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 45 mins to fix

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

                function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
                    $chain = '';
                    $parent = &get_category( $id );
                    if ( is_wp_error( $parent ) )
                        return $parent;
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/category-template.php - 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 _escape has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    function _escape($data) {
                        if ( is_array($data) ) {
                            foreach ( (array) $data as $k => $v ) {
                                if ( is_array($v) )
                                    $data[$k] = $this->_escape( $v );
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/wp-db.php - 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

                Method wp_setcookie has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/pluggable-deprecated.php - About 45 mins to fix

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

                      function block_request($uri) {
                          // We don't need to block requests, because nothing is blocked.
                          if ( ! defined('WP_HTTP_BLOCK_EXTERNAL') || ( defined('WP_HTTP_BLOCK_EXTERNAL') && WP_HTTP_BLOCK_EXTERNAL == false ) )
                              return false;
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/http.php - 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 print_admin_styles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function print_admin_styles() {
                      global $wp_styles, $concatenate_scripts, $compress_css;
                  
                      if ( !is_a($wp_styles, 'WP_Styles') )
                          $wp_styles = new WP_Styles();
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/script-loader.php - 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 escape has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function escape($data) {
                          if ( is_array($data) ) {
                              foreach ( (array) $data as $k => $v ) {
                                  if ( is_array($v) )
                                      $data[$k] = $this->escape( $v );
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/wp-db.php - 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function __construct( $manager, $id, $args = array() ) {
                          $keys = array_keys( get_object_vars( $this ) );
                          foreach ( $keys as $key ) {
                              if ( isset( $args[ $key ] ) )
                                  $this->$key = $args[ $key ];
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - 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 get_the_title has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function get_the_title( $id = 0 ) {
                      $post = &get_post($id);
                  
                      $title = $post->post_title;
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/post-template.php - 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