CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

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

function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) {
    global $wpdb;

    wp_protect_special_option( $name );
    $safe_name = esc_sql( $name );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

function get_file_data( $file, $default_headers, $context = '' ) {
    // We don't need to write to the file, so just open for reading.
    $fp = fopen( $file, 'r' );

    // Pull only the first 8kiB of the file in.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

Avoid deeply nested control flow statements.
Open

                                if ( 'en' != $mce_locale && empty( $strings ) ) {
                                    if ( @is_file( $path . 'en.js' ) ) {
                                        $str1 = @file_get_contents( $path . 'en.js' );
                                        $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";
                                    }
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 45 mins to fix

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

    function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 45 mins to fix

      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

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

      function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() )  {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ms-functions.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        if ( @is_file( $path ) && @is_readable( $path ) ) {
                                            include_once( $path );
                                            $ext_plugins .= $strings . "\n";
                                            $loaded_langs[] = $name;
                                        }
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 45 mins to fix

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

              function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-walker.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if ($handlesize > 0)
                                    $size += $handlesize;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/ms-functions.php - About 45 mins to fix

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

                  final protected function _render( $root ) {
                      global $is_IE;
              
                      // Add browser classes.
                      // We have to do this here since admin bar shows on the front end.
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-admin-bar.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_debug_mode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function wp_debug_mode() {
                  if ( WP_DEBUG ) {
                      error_reporting( E_ALL );
              
                      if ( WP_DEBUG_DISPLAY )
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/load.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 do_action_ref_array has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function do_action_ref_array($tag, $args) {
                  global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
              
                  if ( !is_array($wp_actions) )
                      $wp_actions = array($tag);
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/plugin.php - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Avoid deeply nested control flow statements.
              Open

                                              if ( @is_file( $path . $mce_locale . '.js' ) )
                                                  $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ( $file && file_exists( "$template_dir/$file" ) )
                                                $mce_css[] = "$template_uri/$file";
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 45 mins to fix

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

                  function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 45 mins to fix

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

                    function get_blogaddress_by_domain( $domain, $path ) {
                        _deprecated_function( __FUNCTION__, '3.7' );
                    
                        if ( is_subdomain_install() ) {
                            $url = "http://" . $domain.$path;
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                    function get_tag_feed_link($tag_id, $feed = '') {
                        $tag_id = (int) $tag_id;
                    
                        $tag = get_tag($tag_id);
                    
                    
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/link-template.php - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Avoid deeply nested control flow statements.
                    Open

                                                if (reset($stk) == SERVICES_JSON_IN_ARR) {
                                                    // we are in an array, so just push an element onto the stack
                                                    array_push($arr, $this->decode($slice));
                    
                                                } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/class-json.php - About 45 mins to fix

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

                          public static function buildCookieHeader( &$r ) {
                              if ( ! empty($r['cookies']) ) {
                                  // Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances
                                  foreach ( $r['cookies'] as $name => $value ) {
                                      if ( ! is_object( $value ) )
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/class-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

                      Severity
                      Category
                      Status
                      Source
                      Language