CaffGeek/MBACNationals

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

Summary

Maintainability
F
1 wk
Test Coverage

File formatting.php has 1483 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Main WordPress Formatting API.
 *
 * Handles many functions for formatting output.
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 3 days to fix

    Method ent2ncr has 260 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ent2ncr($text) {
        $to_ncr = array(
            '&quot;' => '&#34;',
            '&amp;' => '&#38;',
            '&frasl;' => '&#47;',
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 day to fix

      Function force_balance_tags has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

      function force_balance_tags( $text ) {
          $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
          $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags
          $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 7 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 remove_accents has 117 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function remove_accents($string) {
          if ( !preg_match('/[\x80-\xff]/', $string) )
              return $string;
      
          if (seems_utf8($string)) {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 4 hrs to fix

        Function utf8_uri_encode has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        function utf8_uri_encode( $utf8_string, $length = 0 ) {
            $unicode = '';
            $values = array();
            $num_octets = 1;
            $unicode_length = 0;
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 sanitize_option has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function sanitize_option($option, $value) {
        
            switch ($option) {
                case 'admin_email':
                    $value = sanitize_email($value);
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 3 hrs to fix

          Method force_balance_tags has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function force_balance_tags( $text ) {
              $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
              $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags
              $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves
          
          
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 2 hrs to fix

            Function wp_sprintf has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            function wp_sprintf( $pattern ) {
                $args = func_get_args( );
                $len = strlen($pattern);
                $start = 0;
                $result = '';
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 sanitize_option has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function sanitize_option($option, $value) {
            
                switch ($option) {
                    case 'admin_email':
                        $value = sanitize_email($value);
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 human_time_diff has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            function human_time_diff( $from, $to = '' ) {
                if ( empty($to) )
                    $to = time();
                $diff = (int) abs($to - $from);
                if ($diff <= 3600) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/formatting.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

            Function seems_utf8 has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            function seems_utf8($str) {
                $length = strlen($str);
                for ($i=0; $i < $length; $i++) {
                    $c = ord($str[$i]);
                    if ($c < 0x80) $n = 0; # 0bbbbbbb
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/formatting.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

            Function sanitize_file_name has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            function sanitize_file_name( $filename ) {
                $filename_raw = $filename;
                $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
                $special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw);
                $filename = str_replace($special_chars, '', $filename);
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 wptexturize has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function wptexturize($text) {
                global $wp_cockneyreplace;
                static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
                $output = '';
                $curl = '';
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

              Function is_email has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              function is_email( $email, $check_dns = false ) {
                  // Test for the minimum length the email can be
                  if ( strlen( $email ) < 3 ) {
                      return apply_filters( 'is_email', false, $email, 'email_too_short' );
                  }
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 _wp_specialchars has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
                  $string = (string) $string;
              
                  if ( 0 === strlen( $string ) ) {
                      return '';
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                Method convert_chars has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function convert_chars($content, $deprecated = '') {
                    // Translation of invalid Unicode references range to valid range
                    $wp_htmltranswinuni = array(
                    '&#128;' => '&#8364;', // the Euro sign
                    '&#129;' => '',
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                  Function wptexturize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function wptexturize($text) {
                      global $wp_cockneyreplace;
                      static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
                      $output = '';
                      $curl = '';
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.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

                  Function _wp_specialchars has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
                      $string = (string) $string;
                  
                      if ( 0 === strlen( $string ) ) {
                          return '';
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 sanitize_email has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function sanitize_email( $email ) {
                      // Test for the minimum length the email can be
                      if ( strlen( $email ) < 3 ) {
                          return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
                      }
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                    Method wp_sprintf has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function wp_sprintf( $pattern ) {
                        $args = func_get_args( );
                        $len = strlen($pattern);
                        $start = 0;
                        $result = '';
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                      Method wpautop has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function wpautop($pee, $br = 1) {
                      
                          if ( trim($pee) === '' )
                              return '';
                          $pee = $pee . "\n"; // just to make things a little easier, pad the end
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                        Method wp_specialchars_decode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {
                            $string = (string) $string;
                        
                            if ( 0 === strlen( $string ) ) {
                                return '';
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                          Method is_email has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function is_email( $email, $check_dns = false ) {
                              // Test for the minimum length the email can be
                              if ( strlen( $email ) < 3 ) {
                                  return apply_filters( 'is_email', false, $email, 'email_too_short' );
                              }
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                            Method utf8_uri_encode has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function utf8_uri_encode( $utf8_string, $length = 0 ) {
                                $unicode = '';
                                $values = array();
                                $num_octets = 1;
                                $unicode_length = 0;
                            Severity: Minor
                            Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                              Method sanitize_file_name has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function sanitize_file_name( $filename ) {
                                  $filename_raw = $filename;
                                  $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
                                  $special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw);
                                  $filename = str_replace($special_chars, '', $filename);
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr to fix

                                Function sanitize_email has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function sanitize_email( $email ) {
                                    // Test for the minimum length the email can be
                                    if ( strlen( $email ) < 3 ) {
                                        return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
                                    }
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.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

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

                                function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {
                                    $string = (string) $string;
                                
                                    if ( 0 === strlen( $string ) ) {
                                        return '';
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 _wptexturize_pushpop_element has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
                                    // Check if it is a closing tag -- otherwise assume opening tag
                                    if (strncmp($opening . '/', $text, 2)) {
                                        // Opening? Check $text+1 against disabled elements
                                        if (preg_match('/^' . $disabled_elements . '\b/', substr($text, 1), $matches)) {
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 convert_smilies has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function convert_smilies($text) {
                                    global $wp_smiliessearch;
                                    $output = '';
                                    if ( get_option('use_smilies') && !empty($wp_smiliessearch) ) {
                                        // HTML loop taken from texturize function, could possible be consolidated
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.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_check_invalid_utf8 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function wp_check_invalid_utf8( $string, $strip = false ) {
                                    $string = (string) $string;
                                
                                    if ( 0 === strlen( $string ) ) {
                                        return '';
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 _wptexturize_pushpop_element has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 35 mins to fix

                                  Function wp_sprintf_l has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function wp_sprintf_l($pattern, $args) {
                                      // Not a match
                                      if ( substr($pattern, 0, 2) != '%l' )
                                          return $pattern;
                                  
                                  
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 iso8601_to_datetime has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function iso8601_to_datetime($date_string, $timezone = 'user') {
                                      $timezone = strtolower($timezone);
                                  
                                      if ($timezone == 'gmt') {
                                  
                                  
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 apply_filters( 'is_email', false, $email, 'domain_no_periods' );
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            return apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );
                                    Severity: Major
                                    Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              return apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                return apply_filters( 'is_email', false, $email, 'domain_period_limits' );
                                        Severity: Major
                                        Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

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

                                            Avoid too many return statements within this method.
                                            Open

                                                    return apply_filters( 'is_email', false, $email, 'dns_no_rr' );
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                  return apply_filters( 'is_email', $email, $email, null );
                                              Severity: Major
                                              Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                    return apply_filters( 'sanitize_email', $email, $email, null );
                                                Severity: Major
                                                Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                          return iconv( 'utf-8', 'utf-8', $string );
                                                  Severity: Major
                                                  Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                            return apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );
                                                    Severity: Major
                                                    Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
                                                      Severity: Major
                                                      Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return apply_filters( 'is_email', false, $email, 'sub_hyphen_limits' );
                                                        Severity: Major
                                                        Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 30 mins to fix

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

                                                          function clean_url( $url, $protocols = null, $context = 'display' ) {
                                                              $original_url = $url;
                                                          
                                                              if ('' == $url) return $url;
                                                              $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
                                                          Severity: Minor
                                                          Found in Web.Admin/2014/wordpress/wp-includes/formatting.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

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

                                                          function _deep_replace($search, $subject){
                                                              $found = true;
                                                              while($found) {
                                                                  $found = false;
                                                                  foreach( (array) $search as $val ) {
                                                          Severity: Minor
                                                          Found in Web.Admin/2014/wordpress/wp-includes/formatting.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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status