CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

function get_page_template() {
    $id = get_queried_object_id();
    $template = get_page_template_slug();
    $pagename = get_query_var('pagename');

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/template.php - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function 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

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

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

    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 ) && @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 next_post has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=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

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

        function get_transient($transient) {
            global $_wp_using_ext_object_cache, $wpdb;
        
            $pre = apply_filters( 'pre_transient_' . $transient, false );
            if ( false !== $pre )
        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

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

        function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
        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 ($handlesize > 0)
                                  $size += $handlesize;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ms-functions.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if ( function_exists('realpath') )
                                                $path = trailingslashit( realpath($path) );
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.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

              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

                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

                  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

                  Avoid deeply nested control flow statements.
                  Open

                                                  if ( ! empty( $strings ) )
                                                      $ext_plugins .= "\n" . $strings . "\n";
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 45 mins to fix

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

                    function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 45 mins to fix

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

                        function Send() {
                          $header = '';
                          $body = '';
                          $result = true;
                      
                      
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.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