CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/http.php

Summary

Maintainability
F
1 wk
Test Coverage

File http.php has 963 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Simple and uniform HTTP request API.
 *
 * Will eventually replace and standardize the WordPress HTTP requests made.
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 2 days to fix

    Function request has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        function request($url, $args = array()) {
            $defaults = array(
                'method' => 'GET', 'timeout' => 5,
                'redirection' => 5, 'httpversion' => '1.0',
                'blocking' => true,
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 6 hrs 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 request has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        function request($url, $args = array()) {
            $defaults = array(
                'method' => 'GET', 'timeout' => 5,
                'redirection' => 5, 'httpversion' => '1.0',
                'blocking' => true,
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 5 hrs 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 _getTransport has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        function &_getTransport( $args = array() ) {
            static $working_transport, $blocking_transport, $nonblocking_transport;
    
            if ( is_null($working_transport) ) {
                if ( true === WP_Http_ExtHttp::test($args) ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 4 hrs 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 request has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function request($url, $args = array()) {
            $defaults = array(
                'method' => 'GET', 'timeout' => 5,
                'redirection' => 5, 'httpversion' => '1.0',
                'blocking' => true,
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 4 hrs to fix

      Method request has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function request($url, $args = array()) {
              $defaults = array(
                  'method' => 'GET', 'timeout' => 5,
                  'redirection' => 5, 'httpversion' => '1.0',
                  'blocking' => true,
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 4 hrs to fix

        Function request has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            function request($url, $args = array()) {
                $defaults = array(
                    'method' => 'GET', 'timeout' => 5,
                    'redirection' => 5, 'httpversion' => '1.0',
                    'blocking' => true,
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs 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 request has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            function request($url, $args = array()) {
                $defaults = array(
                    'method' => 'GET', 'timeout' => 5,
                    'redirection' => 5, 'httpversion' => '1.0',
                    'blocking' => true,
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs 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 _postTransport has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            function &_postTransport( $args = array() ) {
                static $working_transport, $blocking_transport, $nonblocking_transport;
        
                if ( is_null($working_transport) ) {
                    if ( true === WP_Http_ExtHttp::test($args) ) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs 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 request has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            function request( $url, $args = array() ) {
                global $wp_version;
        
                $defaults = array(
                    'method' => 'GET',
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs 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 request has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function request($url, $args = array()) {
                $defaults = array(
                    'method' => 'GET', 'timeout' => 5,
                    'redirection' => 5, 'httpversion' => '1.0',
                    'blocking' => true,
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs to fix

          Method request has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function request($url, $args = array()) {
                  $defaults = array(
                      'method' => 'GET', 'timeout' => 5,
                      'redirection' => 5, 'httpversion' => '1.0',
                      'blocking' => true,
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs to fix

            Method request has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function request( $url, $args = array() ) {
                    global $wp_version;
            
                    $defaults = array(
                        'method' => 'GET',
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 2 hrs to fix

              Function processHeaders has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  function processHeaders($headers) {
                      // split headers, one per array element
                      if ( is_string($headers) ) {
                          // tolerate line terminator: CRLF = LF (RFC 2616 19.3)
                          $headers = str_replace("\r\n", "\n", $headers);
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 2 hrs 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 compatible_gzinflate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  function compatible_gzinflate($gzData) {
                      if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
                          $i = 10;
                          $flg = ord( substr($gzData, 3, 1) );
                          if ( $flg > 0 ) {
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  function __construct( $data ) {
                      if ( is_string( $data ) ) {
                          // Assume it's a header string direct from a previous request
                          $pairs = explode( ';', $data );
              
              
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 2 hrs 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 request has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  function request($url, $args = array()) {
                      $defaults = array(
                          'method' => 'GET', 'timeout' => 5,
                          'redirection' => 5, 'httpversion' => '1.0',
                          'blocking' => true,
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 1 hr 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 request has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function request($url, $args = array()) {
                      $defaults = array(
                          'method' => 'GET', 'timeout' => 5,
                          'redirection' => 5, 'httpversion' => '1.0',
                          'blocking' => true,
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 1 hr to fix

                Function chunkTransferDecode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    function chunkTransferDecode($body) {
                        $body = str_replace(array("\r\n", "\r"), "\n", $body);
                        // The body is not chunked encoding or is malformed.
                        if ( ! preg_match( '/^[0-9a-f]+(\s|\n)+/mi', trim($body) ) )
                            return $body;
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 1 hr 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 processHeaders has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function processHeaders($headers) {
                        // split headers, one per array element
                        if ( is_string($headers) ) {
                            // tolerate line terminator: CRLF = LF (RFC 2616 19.3)
                            $headers = str_replace("\r\n", "\n", $headers);
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 1 hr to fix

                  Method __construct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function __construct( $data ) {
                          if ( is_string( $data ) ) {
                              // Assume it's a header string direct from a previous request
                              $pairs = explode( ';', $data );
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 1 hr to fix

                    Method _getTransport has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function &_getTransport( $args = array() ) {
                            static $working_transport, $blocking_transport, $nonblocking_transport;
                    
                            if ( is_null($working_transport) ) {
                                if ( true === WP_Http_ExtHttp::test($args) ) {
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 1 hr to fix

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

                          function test($args = array()) {
                              if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) )
                                  return false;
                      
                              $use = true;
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/http.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 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 should_decode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function should_decode($headers) {
                              if ( is_array( $headers ) ) {
                                  if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
                                      return true;
                              } else if ( is_string( $headers ) ) {
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 35 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 test has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function test($args = array()) {
                              if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) )
                                  return false;
                      
                              if ( version_compare(PHP_VERSION, '5.0', '<') )
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 35 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 too many return statements within this method.
                      Open

                                      return new WP_Error('http_request_failed', __('Too many redirects.'));
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return true;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $compressed;
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return array('headers' => $arrHeaders['headers'], 'body' => $process['body'], 'response' => $arrHeaders['response'], 'cookies' => $arrHeaders['cookies']);
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If its in the array, then we can't access it.
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 30 mins to fix

                                Function decompress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    function decompress( $compressed, $length = null ) {
                                
                                        if ( false !== ( $decompressed = @gzinflate( $compressed ) ) )
                                            return $decompressed;
                                
                                
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 25 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

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

                                            } else if ( true === WP_Http_Curl::test($args) ) {
                                                $working_transport['curl'] = new WP_Http_Curl();
                                                $blocking_transport[] = &$working_transport['curl'];
                                            } else if ( true === WP_Http_Streams::test($args) ) {
                                                $working_transport['streams'] = new WP_Http_Streams();
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 1 other location - About 5 hrs to fix
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 148..160

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

                                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

                                            if ( true === WP_Http_ExtHttp::test($args) ) {
                                                $working_transport['exthttp'] = new WP_Http_ExtHttp();
                                                $blocking_transport[] = &$working_transport['exthttp'];
                                            } else if ( true === WP_Http_Curl::test($args) ) {
                                                $working_transport['curl'] = new WP_Http_Curl();
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 1 other location - About 5 hrs to fix
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 101..113

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

                                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

                                            if ( $flg > 0 ) {
                                                if ( $flg & 4 ) {
                                                    list($xlen) = unpack('v', substr($gzData, $i, 2) );
                                                    $i = $i + 2 + $xlen;
                                                }
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 1 other location - About 3 hrs to fix
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 2008..2019

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

                                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

                                    function should_decode($headers) {
                                        if ( is_array( $headers ) ) {
                                            if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
                                                return true;
                                        } else if ( is_string( $headers ) ) {
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 1 other location - About 40 mins to fix
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 2096..2105

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

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

                                        if ( isset($r['headers']['User-Agent']) ) {
                                            $r['user-agent'] = $r['headers']['User-Agent'];
                                            unset($r['headers']['User-Agent']);
                                        } else if( isset($r['headers']['user-agent']) ) {
                                            $r['user-agent'] = $r['headers']['user-agent'];
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 5 other locations - About 40 mins to fix
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 796..802
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 1231..1237
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 614..620
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 941..947
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 1110..1116

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

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

                                        if ( isset($r['headers']['User-Agent']) ) {
                                            $r['user-agent'] = $r['headers']['User-Agent'];
                                            unset($r['headers']['User-Agent']);
                                        } else if( isset($r['headers']['user-agent']) ) {
                                            $r['user-agent'] = $r['headers']['user-agent'];
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 5 other locations - About 40 mins to fix
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 796..802
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 1231..1237
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 614..620
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 941..947
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 1253..1259

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

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

                                        if ( isset($r['headers']['User-Agent']) ) {
                                            $r['user-agent'] = $r['headers']['User-Agent'];
                                            unset($r['headers']['User-Agent']);
                                        } else if( isset($r['headers']['user-agent']) ) {
                                            $r['user-agent'] = $r['headers']['user-agent'];
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 5 other locations - About 40 mins to fix
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 796..802
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 1231..1237
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 614..620
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 1110..1116
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 1253..1259

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

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

                                        if ( isset($r['headers']['User-Agent']) ) {
                                            $r['user-agent'] = $r['headers']['User-Agent'];
                                            unset($r['headers']['User-Agent']);
                                        } else if( isset($r['headers']['user-agent']) ) {
                                            $r['user-agent'] = $r['headers']['user-agent'];
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/http.php and 5 other locations - About 40 mins to fix
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 796..802
                                Web.Admin/2014/wordpress/wp-includes/class-http.php on lines 1231..1237
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 941..947
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 1110..1116
                                Web.Admin/2014/wordpress/wp-includes/http.php on lines 1253..1259

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

                                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