CaffGeek/MBACNationals

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

Summary

Maintainability
F
6 days
Test Coverage

File deprecated.php has 620 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Deprecated functions from past WordPress versions. You shouldn't use these
 * globals and functions and look for the alternatives instead. The functions
 * and globals will be removed in a later version.
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 day to fix

    Function get_links has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

    function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
                $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
        _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
    
        $order = 'ASC';
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.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

    Method get_links has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
                $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
        _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
    
        $order = 'ASC';
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 2 hrs to fix

      Method list_cats has 18 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
                         $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
                         $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 2 hrs to fix

        Method get_links has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
                    $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 hr to fix

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

          function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
              _deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' );
              $content = get_the_content($more_link_text, $stripteaser, $more_file);
              $content = apply_filters('the_content_rss', $content);
              if ( $cut && !$encode_html )
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/deprecated.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 dropdown_cats has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
                  $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,
                  $selected = 0, $exclude = 0) {
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 hr to fix

            Method get_linksbyname has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
                                     $show_description = true, $show_rating = false,
                                     $limit = -1, $show_updated = 0) {
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 hr to fix

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

              function get_category_children( $id, $before = '/', $after = '', $visited = array() ) {
                  _deprecated_function(__FUNCTION__, '2.8', 'get_term_children()');
                  if ( 0 == $id )
                      return '';
              
              
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/deprecated.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 the_content_rss has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
                  _deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' );
                  $content = get_the_content($more_link_text, $stripteaser, $more_file);
                  $content = apply_filters('the_content_rss', $content);
                  if ( $cut && !$encode_html )
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 hr to fix

                Method get_links_withrating has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true,
                                              $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 hr to fix

                  Method get_linksbyname_withrating has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
                                                      $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 hr to fix

                    Method link_pages has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',
                                        $pagelink='%', $more_file='') {
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 50 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

                        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

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

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

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

                              function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 35 mins to fix

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

                                function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 35 mins to fix

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

                                  function wp_list_cats($args = '') {
                                      _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()');
                                  
                                      $r = wp_parse_args( $args );
                                  
                                  
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/deprecated.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

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

                                  function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
                                  
                                      _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()');
                                  
                                      if ( empty($in_same_cat) || 'no' == $in_same_cat )
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php and 1 other location - About 6 hrs to fix
                                  Web.Admin/2014/wordpress/wp-includes/deprecated.php on lines 233..252

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

                                  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 next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
                                      _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()');
                                  
                                      if ( empty($in_same_cat) || 'no' == $in_same_cat )
                                          $in_same_cat = false;
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php and 1 other location - About 6 hrs to fix
                                  Web.Admin/2014/wordpress/wp-includes/deprecated.php on lines 197..217

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

                                  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