CaffGeek/MBACNationals

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

Summary

Maintainability
F
1 wk
Test Coverage

File general-template.php has 1091 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * General template tags that can go anywhere in a template.
 *
 * @package WordPress
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 2 days to fix

    Function wp_get_archives has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
    Open

    function wp_get_archives($args = '') {
        global $wpdb, $wp_locale;
    
        $defaults = array(
            'type' => 'monthly', 'limit' => '',
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 1 day 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_calendar has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

    function get_calendar($initial = true) {
        global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
    
        $cache = array();
        $key = md5( $m . $monthnum . $year );
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 1 day 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 get_calendar has 157 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function get_calendar($initial = true) {
        global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
    
        $cache = array();
        $key = md5( $m . $monthnum . $year );
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 6 hrs to fix

      Method wp_get_archives has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function wp_get_archives($args = '') {
          global $wpdb, $wp_locale;
      
          $defaults = array(
              'type' => 'monthly', 'limit' => '',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 6 hrs to fix

        Function wp_title has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_title($sep = '&raquo;', $display = true, $seplocation = '') {
            global $wpdb, $wp_locale, $wp_query;
        
            $cat = get_query_var('cat');
            $tag = get_query_var('tag_id');
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function paginate_links has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        function paginate_links( $args = '' ) {
            $defaults = array(
                'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
                'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number
                'total' => 1,
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function get_bloginfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        function get_bloginfo($show = '', $filter = 'raw') {
        
            switch($show) {
                case 'url' :
                case 'home' : // DEPRECATED
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method wp_title has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function wp_title($sep = '&raquo;', $display = true, $seplocation = '') {
            global $wpdb, $wp_locale, $wp_query;
        
            $cat = get_query_var('cat');
            $tag = get_query_var('tag_id');
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 3 hrs to fix

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

          function get_bloginfo($show = '', $filter = 'raw') {
          
              switch($show) {
                  case 'url' :
                  case 'home' : // DEPRECATED
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 3 hrs to fix

            Method paginate_links has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function paginate_links( $args = '' ) {
                $defaults = array(
                    'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
                    'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number
                    'total' => 1,
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 3 hrs to fix

              Method the_editor has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) {
                  $rows = get_option('default_post_edit_rows');
                  if (($rows < 3) || ($rows > 100))
                      $rows = 12;
              
              
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 1 hr to fix

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

                function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) {
                    $rows = get_option('default_post_edit_rows');
                    if (($rows < 3) || ($rows > 100))
                        $rows = 12;
                
                
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 feed_links_extra has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function feed_links_extra( $args ) {
                    $defaults = array(
                        /* translators: Separator between blog name and feed type in feed links */
                        'separator'   => _x('&raquo;', 'feed link'),
                        /* translators: 1: blog name, 2: separator(raquo), 3: post title */
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 1 hr to fix

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

                  function single_cat_title($prefix = '', $display = true ) {
                      $cat = intval( get_query_var('cat') );
                      if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) {
                          $my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat));
                          if ( !empty($my_cat_name) ) {
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 feed_links_extra has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function feed_links_extra( $args ) {
                      $defaults = array(
                          /* translators: Separator between blog name and feed type in feed links */
                          'separator'   => _x('&raquo;', 'feed link'),
                          /* translators: 1: blog name, 2: separator(raquo), 3: post title */
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 single_tag_title has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function single_tag_title($prefix = '', $display = true ) {
                      if ( !is_tag() )
                          return;
                  
                      $tag_id = intval( get_query_var('tag_id') );
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/general-template.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

                  Consider simplifying this complex logical expression.
                  Open

                              if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
                                  $link = str_replace('%_%', 1 == $n ? '' : $format, $base);
                                  $link = str_replace('%#%', $n, $link);
                                  if ( $add_args )
                                      $link = add_query_arg( $add_args, $link );
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 1 hr to fix

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

                    function get_the_generator( $type ) {
                        switch ($type) {
                            case 'html':
                                $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
                                break;
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/general-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

                    Method get_archives_link has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 35 mins to fix

                      Method the_editor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) {
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 35 mins to fix

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

                        function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
                            global $wp_styles;
                            if ( !is_a($wp_styles, 'WP_Styles') )
                                $wp_styles = new WP_Styles();
                        
                        
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 the_date has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function the_date($d='', $before='', $after='', $echo = true) {
                            global $post, $day, $previousday;
                            $the_date = '';
                            if ( $day != $previousday ) {
                                $the_date .= $before;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 user_can_richedit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function user_can_richedit() {
                            global $wp_rich_edit, $pagenow;
                        
                            if ( !isset( $wp_rich_edit) ) {
                                if ( get_user_option( 'rich_editing' ) == 'true' &&
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 language_attributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function language_attributes($doctype = 'html') {
                            $attributes = array();
                            $output = '';
                        
                            if ( $dir = get_bloginfo('text_direction') )
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 single_post_title has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function single_post_title($prefix = '', $display = true) {
                            global $wpdb;
                            $p = get_query_var('p');
                            $name = get_query_var('name');
                        
                        
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.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 allowed_tags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function allowed_tags() {
                            global $allowedtags;
                            $allowed = '';
                            foreach ( (array) $allowedtags as $tag => $attributes ) {
                                $allowed .= '<'.$tag;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

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

                        function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp
                            $post = get_post($post);
                        
                            if ( $gmt )
                                $time = $post->post_date_gmt;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 1 other location - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 1362..1372

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
                            $post = get_post($post);
                        
                            if ( $gmt )
                                $time = $post->post_modified_gmt;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 1 other location - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 1312..1322

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        function get_the_modified_time($d = '') {
                            if ( '' == $d )
                                $the_time = get_post_modified_time(get_option('time_format'), null, null, true);
                            else
                                $the_time = get_post_modified_time($d, null, null, true);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 1 other location - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 1263..1269

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        function get_the_modified_date($d = '') {
                            if ( '' == $d )
                                $the_time = get_post_modified_time(get_option('date_format'), null, null, true);
                            else
                                $the_time = get_post_modified_time($d, null, null, true);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 1 other location - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 1343..1349

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

                        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 get_footer( $name = null ) {
                            do_action( 'get_footer', $name );
                        
                            $templates = array();
                            if ( isset($name) )
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 2 other locations - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 25..36
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 83..94

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

                        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 get_header( $name = null ) {
                            do_action( 'get_header', $name );
                        
                            $templates = array();
                            if ( isset($name) )
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 2 other locations - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 54..65
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 83..94

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

                        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 get_sidebar( $name = null ) {
                            do_action( 'get_sidebar', $name );
                        
                            $templates = array();
                            if ( isset($name) )
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php and 2 other locations - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 25..36
                        Web.Admin/2014/wordpress/wp-includes/general-template.php on lines 54..65

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

                        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