CaffGeek/MBACNationals

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

Summary

Maintainability
F
3 wks
Test Coverage

Function get_posts has a Cognitive Complexity of 396 (exceeds 5 allowed). Consider refactoring.
Open

    function &get_posts() {
        global $wpdb, $user_ID;

        do_action_ref_array('pre_get_posts', array(&$this));

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 wk 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

File query.php has 1447 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * WordPress Query API
 *
 * The query API attempts to get which part of WordPress to the user is on. It
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 3 days to fix

    Method get_posts has 678 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function &get_posts() {
            global $wpdb, $user_ID;
    
            do_action_ref_array('pre_get_posts', array(&$this));
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 3 days to fix

      Function parse_query has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
      Open

          function parse_query ($query) {
              if ( !empty($query) || !isset($this->query) ) {
                  $this->init();
                  if ( is_array($query) )
                      $this->query_vars = $query;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 3 days 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 parse_query has 238 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function parse_query ($query) {
              if ( !empty($query) || !isset($this->query) ) {
                  $this->init();
                  if ( is_array($query) )
                      $this->query_vars = $query;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 day to fix

        Function get_queried_object has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_queried_object() {
                if (isset($this->queried_object)) {
                    return $this->queried_object;
                }
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/query.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

        WP_Query has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class WP_Query {
        
            /**
             * Query string
             *
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 2 hrs to fix

          Method fill_query_vars has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function fill_query_vars($array) {
                  $keys = array(
                      'error'
                      , 'm'
                      , 'p'
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 hr to fix

            Method get_queried_object has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function get_queried_object() {
                    if (isset($this->queried_object)) {
                        return $this->queried_object;
                    }
            
            
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
                          $this->is_single = true;
                          $this->is_attachment = true;
                      } elseif ( '' != $qv['name'] ) {
                          $this->is_single = true;
              Severity: Critical
              Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                        if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup || $this->is_robots ) )
                            $this->is_home = true;
                Severity: Critical
                Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 hr to fix

                  Function wp_old_slug_redirect has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function wp_old_slug_redirect () {
                      global $wp_query;
                      if ( is_404() && '' != $wp_query->query_vars['name'] ) :
                          global $wpdb;
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/query.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 setup_postdata has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function setup_postdata($post) {
                      global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
                  
                      $id = (int) $post->ID;
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 1 hr to fix

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

                    function is_page ($page = '') {
                        global $wp_query;
                    
                        if ( !$wp_query->is_page )
                            return false;
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/query.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 setup_postdata has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function setup_postdata($post) {
                        global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
                    
                        $id = (int) $post->ID;
                    
                    
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/query.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 false;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $this->queried_object;
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

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

                          Avoid too many return statements within this method.
                          Open

                              return false;
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/query.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/query.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                  return false;
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-includes/query.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/query.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/query.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/query.php - About 30 mins to fix

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

                                          function fill_query_vars($array) {
                                              $keys = array(
                                                  'error'
                                                  , 'm'
                                                  , 'p'
                                      Severity: Minor
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.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 3 locations. Consider refactoring.
                                      Open

                                      function is_author ($author = '') {
                                          global $wp_query;
                                      
                                          if ( !$wp_query->is_author )
                                              return false;
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 2 other locations - About 2 hrs to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 172..193
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 478..499

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

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

                                      function is_single ($post = '') {
                                          global $wp_query;
                                      
                                          if ( !$wp_query->is_single )
                                              return false;
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 2 other locations - About 2 hrs to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 137..158
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 172..193

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

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

                                      function is_category ($category = '') {
                                          global $wp_query;
                                      
                                          if ( !$wp_query->is_category )
                                              return false;
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 2 other locations - About 2 hrs to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 137..158
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 478..499

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

                                      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 ( !$q['suppress_filters'] ) {
                                                  $where = apply_filters('posts_where_paged', $where);
                                                  $groupby = apply_filters('posts_groupby', $groupby);
                                                  $join = apply_filters('posts_join_paged', $join);
                                                  $orderby = apply_filters('posts_orderby', $orderby);
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 1 other location - About 2 hrs to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 2227..2235

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

                                      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 ( !$q['suppress_filters'] ) {
                                                  $where = apply_filters('posts_where_request', $where);
                                                  $groupby = apply_filters('posts_groupby_request', $groupby);
                                                  $join = apply_filters('posts_join_request', $join);
                                                  $orderby = apply_filters('posts_orderby_request', $orderby);
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 1 other location - About 2 hrs to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 2212..2221

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

                                      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 ( !empty($p_status) ) {
                                                      if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type_cap}s") )
                                                          $statuswheres[] = "($wpdb->posts.post_author = $user_ID " .  "AND (" . join( ' OR ', $p_status ) . "))";
                                                      else
                                                          $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")";
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 1 other location - About 1 hr to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 2101..2106

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

                                      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 ( !empty($r_status) ) {
                                                      if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type_cap}s") )
                                                          $statuswheres[] = "($wpdb->posts.post_author = $user_ID " .  "AND (" . join( ' OR ', $r_status ) . "))";
                                                      else
                                                          $statuswheres[] = "(" . join( ' OR ', $r_status ) . ")";
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 1 other location - About 1 hr to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 2107..2112

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

                                      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 ( $this->is_home && ( empty($this->query) || $qv['preview'] == 'true' ) && 'page' == get_option('show_on_front') && get_option('page_on_front') ) {
                                                  $this->is_page = true;
                                                  $this->is_home = false;
                                                  $qv['page_id'] = get_option('page_on_front');
                                              }
                                      Severity: Minor
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 1 other location - About 45 mins to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 1611..1615

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

                                      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 ( $this->is_home && (empty($this->query) || $q['preview'] == 'true') && ( 'page' == get_option('show_on_front') ) && get_option('page_on_front') ) {
                                                  $this->is_page = true;
                                                  $this->is_home = false;
                                                  $q['page_id'] = get_option('page_on_front');
                                              }
                                      Severity: Minor
                                      Found in Web.Admin/2014/wordpress/wp-includes/query.php and 1 other location - About 45 mins to fix
                                      Web.Admin/2014/wordpress/wp-includes/query.php on lines 1438..1442

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

                                      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