CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php

Summary

Maintainability
F
2 mos
Test Coverage

File class-wp-xmlrpc-server.php has 3179 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * XML-RPC protocol support for WordPress
 *
 * @package WordPress
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 wk to fix

    Function _insert_post has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _insert_post( $user, $content_struct ) {
            $defaults = array( 'post_status' => 'draft', 'post_type' => 'post', 'post_author' => 0,
                'post_password' => '', 'post_excerpt' => '', 'post_content' => '', 'post_title' => '' );
    
            $post_data = wp_parse_args( $content_struct, $defaults );
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 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

    Function mw_newPost has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
    Open

        function mw_newPost($args) {
            $this->escape($args);
    
            $blog_ID     = (int) $args[0];
            $username  = $args[1];
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 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

    wp_xmlrpc_server has 100 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class wp_xmlrpc_server extends IXR_Server {
    
        /**
         * Register all of the XMLRPC methods that XMLRPC server understands.
         *
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 day to fix

      Function mw_editPost has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
      Open

          function mw_editPost($args) {
      
              $this->escape($args);
      
              $post_ID        = (int) $args[0];
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 mw_newPost has 216 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function mw_newPost($args) {
              $this->escape($args);
      
              $blog_ID     = (int) $args[0];
              $username  = $args[1];
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 day to fix

        Method mw_editPost has 196 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function mw_editPost($args) {
        
                $this->escape($args);
        
                $post_ID        = (int) $args[0];
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 7 hrs to fix

          Method _insert_post has 162 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _insert_post( $user, $content_struct ) {
                  $defaults = array( 'post_status' => 'draft', 'post_type' => 'post', 'post_author' => 0,
                      'post_password' => '', 'post_excerpt' => '', 'post_content' => '', 'post_title' => '' );
          
                  $post_data = wp_parse_args( $content_struct, $defaults );
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 6 hrs to fix

            Method initialise_blog_option_info has 139 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function initialise_blog_option_info() {
                    global $wp_version;
            
                    $this->blog_options = array(
                        // Read only options
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 5 hrs to fix

              Function pingback_ping has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  function pingback_ping($args) {
                      global $wpdb;
              
                      /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
                      do_action( 'xmlrpc_call', 'pingback.ping' );
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 pingback_ping has 116 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function pingback_ping($args) {
                      global $wpdb;
              
                      /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
                      do_action( 'xmlrpc_call', 'pingback.ping' );
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 4 hrs to fix

                Function mw_getPost has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    function mw_getPost($args) {
                
                        $this->escape($args);
                
                        $post_ID     = (int) $args[0];
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_newComment has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                    function wp_newComment($args) {
                        global $wpdb;
                
                        $this->escape($args);
                
                
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 mw_getPost has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function mw_getPost($args) {
                
                        $this->escape($args);
                
                        $post_ID     = (int) $args[0];
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 3 hrs to fix

                  Method mw_getRecentPosts has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function mw_getRecentPosts($args) {
                  
                          $this->escape($args);
                  
                          $blog_ID     = (int) $args[0];
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 3 hrs to fix

                    Function mw_getRecentPosts has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function mw_getRecentPosts($args) {
                    
                            $this->escape($args);
                    
                            $blog_ID     = (int) $args[0];
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 3 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 __construct has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function __construct() {
                            $this->methods = array(
                                // WordPress API
                                'wp.getUsersBlogs'        => 'this:wp_getUsersBlogs',
                                'wp.newPost'            => 'this:wp_newPost',
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 3 hrs to fix

                      Function wp_getPosts has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function wp_getPosts( $args ) {
                              if ( ! $this->minimum_args( $args, 3 ) )
                                  return $this->error;
                      
                              $this->escape( $args );
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 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 wp_editTerm has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function wp_editTerm( $args ) {
                              if ( ! $this->minimum_args( $args, 5 ) )
                                  return $this->error;
                      
                              $this->escape( $args );
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 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 _prepare_post has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function _prepare_post( $post, $fields ) {
                              // holds the data for this post. built up based on $fields
                              $_post = array( 'post_id' => strval( $post['ID'] ) );
                      
                              // prepare common post fields
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 hrs to fix

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

                            function mw_newMediaObject($args) {
                                global $wpdb;
                        
                                $blog_ID     = (int) $args[0];
                                $username  = $this->escape($args[1]);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 hrs to fix

                          Function set_custom_fields has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function set_custom_fields($post_id, $fields) {
                                  $post_id = (int) $post_id;
                          
                                  foreach ( (array) $fields as $meta ) {
                                      if ( isset($meta['id']) ) {
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 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_newComment has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function wp_newComment($args) {
                                  global $wpdb;
                          
                                  $this->escape($args);
                          
                          
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 hrs to fix

                            Function wp_newTerm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                                function wp_newTerm( $args ) {
                                    if ( ! $this->minimum_args( $args, 4 ) )
                                        return $this->error;
                            
                                    $this->escape( $args );
                            Severity: Minor
                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 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_getPosts has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function wp_getPosts( $args ) {
                                    if ( ! $this->minimum_args( $args, 3 ) )
                                        return $this->error;
                            
                                    $this->escape( $args );
                            Severity: Minor
                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 2 hrs to fix

                              Method wp_editTerm has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function wp_editTerm( $args ) {
                                      if ( ! $this->minimum_args( $args, 5 ) )
                                          return $this->error;
                              
                                      $this->escape( $args );
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                Function wp_getUsers has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    function wp_getUsers( $args ) {
                                        if ( ! $this->minimum_args( $args, 3 ) )
                                            return $this->error;
                                
                                        $this->escape( $args );
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_getRevisions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    function wp_getRevisions( $args ) {
                                        if ( ! $this->minimum_args( $args, 4 ) )
                                            return $this->error;
                                
                                        $this->escape( $args );
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 _prepare_page has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function _prepare_page( $page ) {
                                        // Get all of the page content and link.
                                        $full_page = get_extended( $page->post_content );
                                        $link = post_permalink( $page->ID );
                                
                                
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                  Function add_enclosure_if_new has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      function add_enclosure_if_new( $post_ID, $enclosure ) {
                                          if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
                                              $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n";
                                              $found = false;
                                              if ( $enclosures = get_post_meta( $post_ID, 'enclosure' ) ) {
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 _prepare_post has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function _prepare_post( $post, $fields ) {
                                          // holds the data for this post. built up based on $fields
                                          $_post = array( 'post_id' => strval( $post['ID'] ) );
                                  
                                          // prepare common post fields
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_editComment has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      function wp_editComment($args) {
                                          $this->escape($args);
                                  
                                          $blog_id    = (int) $args[0];
                                          $username    = $args[1];
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_getTerms has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      function wp_getTerms( $args ) {
                                          if ( ! $this->minimum_args( $args, 4 ) )
                                              return $this->error;
                                  
                                          $this->escape( $args );
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_editComment has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function wp_editComment($args) {
                                          $this->escape($args);
                                  
                                          $blog_id    = (int) $args[0];
                                          $username    = $args[1];
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                    Method wp_newTerm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function wp_newTerm( $args ) {
                                            if ( ! $this->minimum_args( $args, 4 ) )
                                                return $this->error;
                                    
                                            $this->escape( $args );
                                    Severity: Minor
                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                      Method wp_getUsers has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function wp_getUsers( $args ) {
                                              if ( ! $this->minimum_args( $args, 3 ) )
                                                  return $this->error;
                                      
                                              $this->escape( $args );
                                      Severity: Minor
                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                        Method wp_getTerms has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function wp_getTerms( $args ) {
                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                    return $this->error;
                                        
                                                $this->escape( $args );
                                        Severity: Minor
                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                          Method blogger_getRecentPosts has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              function blogger_getRecentPosts($args) {
                                          
                                                  $this->escape($args);
                                          
                                                  // $args[0] = appkey - ignored
                                          Severity: Minor
                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                            Method mt_getRecentPostTitles has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                function mt_getRecentPostTitles($args) {
                                            
                                                    $this->escape($args);
                                            
                                                    $blog_ID     = (int) $args[0];
                                            Severity: Minor
                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

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

                                                  function wp_editProfile( $args ) {
                                                      if ( ! $this->minimum_args( $args, 4 ) )
                                                          return $this->error;
                                              
                                                      $this->escape( $args );
                                              Severity: Minor
                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_editProfile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  function wp_editProfile( $args ) {
                                                      if ( ! $this->minimum_args( $args, 4 ) )
                                                          return $this->error;
                                              
                                                      $this->escape( $args );
                                              Severity: Minor
                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                Method wp_newCategory has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    function wp_newCategory($args) {
                                                        $this->escape($args);
                                                
                                                        $blog_id                = (int) $args[0];
                                                        $username                = $args[1];
                                                Severity: Minor
                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                  Method wp_getRevisions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      function wp_getRevisions( $args ) {
                                                          if ( ! $this->minimum_args( $args, 4 ) )
                                                              return $this->error;
                                                  
                                                          $this->escape( $args );
                                                  Severity: Minor
                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                    Method wp_getPageList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        function wp_getPageList($args) {
                                                            global $wpdb;
                                                    
                                                            $this->escape($args);
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                      Method wp_editPost has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          function wp_editPost( $args ) {
                                                              if ( ! $this->minimum_args( $args, 5 ) )
                                                                  return $this->error;
                                                      
                                                              $this->escape( $args );
                                                      Severity: Minor
                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                        Method wp_getComments has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            function wp_getComments($args) {
                                                                $this->escape($args);
                                                        
                                                                $blog_id    = (int) $args[0];
                                                                $username    = $args[1];
                                                        Severity: Minor
                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                          Method wp_getUsersBlogs has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              function wp_getUsersBlogs( $args ) {
                                                                  // If this isn't on WPMU then just use blogger_getUsersBlogs
                                                                  if ( !is_multisite() ) {
                                                                      array_unshift( $args, 1 );
                                                                      return $this->blogger_getUsersBlogs( $args );
                                                          Severity: Minor
                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                            Method blogger_editPost has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                function blogger_editPost($args) {
                                                            
                                                                    $this->escape($args);
                                                            
                                                                    $post_ID     = (int) $args[1];
                                                            Severity: Minor
                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                              Function blogger_getRecentPosts has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  function blogger_getRecentPosts($args) {
                                                              
                                                                      $this->escape($args);
                                                              
                                                                      // $args[0] = appkey - ignored
                                                              Severity: Minor
                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_editPost has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  function wp_editPost( $args ) {
                                                                      if ( ! $this->minimum_args( $args, 5 ) )
                                                                          return $this->error;
                                                              
                                                                      $this->escape( $args );
                                                              Severity: Minor
                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_newCategory has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  function wp_newCategory($args) {
                                                                      $this->escape($args);
                                                              
                                                                      $blog_id                = (int) $args[0];
                                                                      $username                = $args[1];
                                                              Severity: Minor
                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 _prepare_comment has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                  protected function _prepare_comment( $comment ) {
                                                                      // Format page date.
                                                                      $comment_date = $this->_convert_date( $comment->comment_date );
                                                                      $comment_date_gmt = $this->_convert_date_gmt( $comment->comment_date_gmt, $comment->comment_date );
                                                              
                                                              
                                                              Severity: Minor
                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                                Method wp_deleteTerm has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                    function wp_deleteTerm( $args ) {
                                                                        if ( ! $this->minimum_args( $args, 5 ) )
                                                                            return $this->error;
                                                                
                                                                        $this->escape( $args );
                                                                Severity: Minor
                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                                  Method blogger_newPost has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                      function blogger_newPost($args) {
                                                                  
                                                                          $this->escape($args);
                                                                  
                                                                          $blog_ID    = (int) $args[1]; /* though we don't use it yet */
                                                                  Severity: Minor
                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 1 hr to fix

                                                                    Function mt_getRecentPostTitles has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function mt_getRecentPostTitles($args) {
                                                                    
                                                                            $this->escape($args);
                                                                    
                                                                            $blog_ID     = (int) $args[0];
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 _prepare_comment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        protected function _prepare_comment( $comment ) {
                                                                            // Format page date.
                                                                            $comment_date = $this->_convert_date( $comment->comment_date );
                                                                            $comment_date_gmt = $this->_convert_date_gmt( $comment->comment_date_gmt, $comment->comment_date );
                                                                    
                                                                    
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 _multisite_getUsersBlogs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function _multisite_getUsersBlogs($args) {
                                                                            $current_blog = get_blog_details();
                                                                    
                                                                            $domain = $current_blog->domain;
                                                                            $path = $current_blog->path . 'xmlrpc.php';
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 mw_newMediaObject has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function mw_newMediaObject($args) {
                                                                            global $wpdb;
                                                                    
                                                                            $blog_ID     = (int) $args[0];
                                                                            $username  = $this->escape($args[1]);
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

                                                                    Function wp_getPages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function wp_getPages($args) {
                                                                            $this->escape($args);
                                                                    
                                                                            $blog_id    = (int) $args[0];
                                                                            $username    = $args[1];
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

                                                                    Function wp_getPostFormats has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function wp_getPostFormats( $args ) {
                                                                            $this->escape( $args );
                                                                    
                                                                            $blog_id = (int) $args[0];
                                                                            $username = $args[1];
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 _getOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function _getOptions($options) {
                                                                            $data = array();
                                                                            $can_manage = current_user_can( 'manage_options' );
                                                                            foreach ( $options as $option ) {
                                                                                if ( array_key_exists( $option, $this->blog_options ) ) {
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

                                                                    Function wp_setOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function wp_setOptions( $args ) {
                                                                            $this->escape( $args );
                                                                    
                                                                            $blog_id    = (int) $args[0];
                                                                            $username    = $args[1];
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

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

                                                                        function wp_getPostTypes( $args ) {
                                                                            if ( ! $this->minimum_args( $args, 3 ) )
                                                                                return $this->error;
                                                                    
                                                                            $this->escape( $args );
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

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

                                                                        function wp_getTaxonomies( $args ) {
                                                                            if ( ! $this->minimum_args( $args, 3 ) )
                                                                                return $this->error;
                                                                    
                                                                            $this->escape( $args );
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

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

                                                                        function wp_getComments($args) {
                                                                            $this->escape($args);
                                                                    
                                                                            $blog_id    = (int) $args[0];
                                                                            $username    = $args[1];
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

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

                                                                        function wp_deleteTerm( $args ) {
                                                                            if ( ! $this->minimum_args( $args, 5 ) )
                                                                                return $this->error;
                                                                    
                                                                            $this->escape( $args );
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins to fix

                                                                    Cognitive Complexity

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

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

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

                                                                    Further reading

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

                                                                        function blogger_editPost($args) {
                                                                    
                                                                            $this->escape($args);
                                                                    
                                                                            $post_ID     = (int) $args[1];
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 attach_uploads has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function attach_uploads( $post_ID, $post_content ) {
                                                                            global $wpdb;
                                                                    
                                                                            // find any unattached files
                                                                            $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 wp_restoreRevision has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function wp_restoreRevision( $args ) {
                                                                            if ( ! $this->minimum_args( $args, 3 ) )
                                                                                return $this->error;
                                                                    
                                                                            $this->escape( $args );
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 new IXR_Error( 403, __( 'Invalid term ID' ) );
                                                                    Severity: Major
                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                              return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
                                                                      Severity: Major
                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                    return new IXR_Error( 500, $term->get_error_message() );
                                                                        Severity: Major
                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return new IXR_Error( 500, __( 'The post cannot be deleted.' ) );
                                                                          Severity: Major
                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                            return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) );
                                                                            Severity: Major
                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                                          return new IXR_Error( 401, __( 'Ambiguous term name used in a hierarchical taxonomy. Please use term ID instead.' ) );
                                                                              Severity: Major
                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                            return new IXR_Error( 500, __( 'Sorry, editing the term failed.' ) );
                                                                                Severity: Major
                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                          return $result;
                                                                                  Severity: Major
                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                            return $struct;
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                              return $cat_id;
                                                                                      Severity: Major
                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
                                                                                        Severity: Major
                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                              return new IXR_Error( 403, __( 'Comment author name and email are required' ) );
                                                                                          Severity: Major
                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );
                                                                                            Severity: Major
                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                      return $this->_prepare_post_type( $post_type, $fields );
                                                                                              Severity: Major
                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                            return new IXR_Error( 401, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );
                                                                                                Severity: Major
                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                              return new IXR_Error( 500, __( 'Sorry, your term could not be created. Something wrong happened.' ) );
                                                                                                  Severity: Major
                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                            return (bool) $post;
                                                                                                    Severity: Major
                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

                                                                                                                            return( new IXR_Error( 401, __( 'Invalid post type' ) ) );
                                                                                                        Severity: Major
                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                          Avoid too many return statements within this method.
                                                                                                          Open

                                                                                                                      return $this->pingback_error( 0, __( 'The source URL and the target URL cannot both point to the same resource.' ) );
                                                                                                          Severity: Major
                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                            Avoid too many return statements within this method.
                                                                                                            Open

                                                                                                                            return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
                                                                                                            Severity: Major
                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                              Avoid too many return statements within this method.
                                                                                                              Open

                                                                                                                      return apply_filters( 'wp_handle_upload', $struct, 'upload' );
                                                                                                              Severity: Major
                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                Avoid too many return statements within this method.
                                                                                                                Open

                                                                                                                                    return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ) );
                                                                                                                Severity: Major
                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this method.
                                                                                                                  Open

                                                                                                                              return new IXR_Error( 401, __( 'Sorry, you are not allowed to create password protected posts in this post type' ) );
                                                                                                                  Severity: Major
                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this method.
                                                                                                                    Open

                                                                                                                                    return new IXR_Error( 403, __( 'The term name cannot be empty.' ) );
                                                                                                                    Severity: Major
                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this method.
                                                                                                                      Open

                                                                                                                                      return new IXR_Error( 403, __( "This taxonomy is not hierarchical so you can't set a parent." ) );
                                                                                                                      Severity: Major
                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this method.
                                                                                                                        Open

                                                                                                                                    return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.'));
                                                                                                                        Severity: Major
                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this method.
                                                                                                                          Open

                                                                                                                                          return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
                                                                                                                          Severity: Major
                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this method.
                                                                                                                            Open

                                                                                                                                            return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
                                                                                                                            Severity: Major
                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this method.
                                                                                                                              Open

                                                                                                                                              return new IXR_Error( 404, __( 'Invalid author ID.' ) );
                                                                                                                              Severity: Major
                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                  Open

                                                                                                                                              return new IXR_Error( 500, $term->get_error_message() );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                    Open

                                                                                                                                                return new IXR_Error( 500, $term->get_error_message() );
                                                                                                                                    Severity: Major
                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                      Open

                                                                                                                                              return $this->_prepare_user( $user_data, $fields );
                                                                                                                                      Severity: Major
                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                        Open

                                                                                                                                                return $comment_ID;
                                                                                                                                        Severity: Major
                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                          Open

                                                                                                                                                          return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
                                                                                                                                          Severity: Major
                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                            Open

                                                                                                                                                            return new IXR_Error( 404, __( 'Invalid post format' ) );
                                                                                                                                            Severity: Major
                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                              Open

                                                                                                                                                          return $this->pingback_error( 16, __( 'The source URL does not exist.' ) );
                                                                                                                                              Severity: Major
                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                Open

                                                                                                                                                                        return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
                                                                                                                                                Severity: Major
                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                  Open

                                                                                                                                                                                  return new IXR_Error( 500, $term_info->get_error_message() );
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                    Open

                                                                                                                                                                            return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                      Open

                                                                                                                                                                              return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                        Open

                                                                                                                                                                        return new IXR_Error( 500, $format->get_error_message() );
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                          Open

                                                                                                                                                                      return new IXR_Error( 500, $term->get_error_message() );
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                            Open

                                                                                                                                                                    return strval( $post_ID );
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                              Open

                                                                                                                                                                          return new IXR_Error( 404, __( 'Invalid term ID' ) );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                Open

                                                                                                                                                                            return new IXR_Error( 500, $term->get_error_message() );
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                  Open

                                                                                                                                                                          return $struct;
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                    Open

                                                                                                                                                                                return new IXR_Error( 404, __( 'Invalid post ID' ) );
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                      Open

                                                                                                                                                                                              return(new IXR_Error(401, __('You are not allowed to change the post author as this user.')));
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                          Open

                                                                                                                                                                                      return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                            Open

                                                                                                                                                                                          return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                              Open

                                                                                                                                                                                                  return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ) );
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                Open

                                                                                                                                                                                                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                  Open

                                                                                                                                                                                                  return new IXR_Error( 500, $parent_term->get_error_message() );
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                    Open

                                                                                                                                                                                                            return( new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) ) );
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                      Open

                                                                                                                                                                                                              return( new IXR_Error( 401, __( 'You are not allowed to create pages as this user.' ) ) );
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                                                        Open

                                                                                                                                                                                                        return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                          Open

                                                                                                                                                                                                      return new IXR_Error(500, $result->get_error_message());
                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                            Open

                                                                                                                                                                                                        return new IXR_Error(500, __('Sorry, your entry could not be edited. Something wrong happened.'));
                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                                              Open

                                                                                                                                                                                                          return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                                Open

                                                                                                                                                                                                        return $post_ID;
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                                  Open

                                                                                                                                                                                                                  return new IXR_Error( 404, __( 'Invalid author ID.' ) );
                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                                return $this->pingback_error( 48, __( 'The pingback has already been registered.' ) );
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                                      Open

                                                                                                                                                                                                                  return new IXR_Error(500, $result->get_error_message());
                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                                                                        Open

                                                                                                                                                                                                                    return array();
                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                                          Open

                                                                                                                                                                                                                  return $struct;
                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                                            Open

                                                                                                                                                                                                                    return $_users;
                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                                                              Open

                                                                                                                                                                                                                              return new IXR_Error( 401, __( 'Invalid comment status.' ) );
                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                      return new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) );
                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                            return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto);
                                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                                                      Open

                                                                                                                                                                                                                              return $this->_prepare_term( $term );
                                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                    return(new IXR_Error(500, __('Sorry, the new category failed.')));
                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                                                          Open

                                                                                                                                                                                                                                  return strval($post_ID);
                                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                                                            Open

                                                                                                                                                                                                                                        return new IXR_Error(404, __('Sorry, no such post.'));
                                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                                                                              Open

                                                                                                                                                                                                                                          return new IXR_Error( 404, __( 'Invalid term ID' ) );
                                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                            return new IXR_Error( 500, __( 'Sorry, the user cannot be updated.' ) );
                                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                                                return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));
                                                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                                                                      Open

                                                                                                                                                                                                                                                  return $this->pingback_error( 17, __( 'The source URL does not contain a link to the target URL, and so cannot be used as a source.' ) );
                                                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                                        return new IXR_Error( 500, $parent_term->get_error_message() );
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                                                                          Open

                                                                                                                                                                                                                                                          return new IXR_Error( 403, __( 'Parent term does not exist.' ) );
                                                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                                                                            Open

                                                                                                                                                                                                                                                            return new IXR_Error( 403, __( 'Parent term does not exist.' ) );
                                                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                                            return(new IXR_Error(404, __('Sorry, no such page.')));
                                                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                                              return new IXR_Error( 500, $post_ID->get_error_message() );
                                                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                                                                return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be edited.'));
                                                                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                                                                                      Open

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

                                                                                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                                                                                          Open

                                                                                                                                                                                                                                                                      return new IXR_Error( 403, __( 'The term name cannot be empty.' ) );
                                                                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                                                                                            Open

                                                                                                                                                                                                                                                                    return $this->_prepare_taxonomy( $taxonomy, $fields );
                                                                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                                                                                                              Open

                                                                                                                                                                                                                                                                          return new IXR_Error( 404, __( 'Invalid term ID' ) );
                                                                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                                                        return $this->_prepare_post( $post, $fields );
                                                                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                                                              return new IXR_Error( 500, $term->get_error_message() );
                                                                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                                                                                    return new IXR_Error( 403, __( 'This taxonomy is not hierarchical.' ) );
                                                                                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                                                                return strval( $term['term_id'] );
                                                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                          Open

                                                                                                                                                                                                                                                                                      return new IXR_Error( 500, __( 'Sorry, deleting the term failed.' ) );
                                                                                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                            Open

                                                                                                                                                                                                                                                                                        return array();
                                                                                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                              Open

                                                                                                                                                                                                                                                                                      return $status;
                                                                                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                                                                                    return(new IXR_Error(401, __('Invalid post type')));
                                                                                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                                                                              return new IXR_Error( 500, $terms->get_error_message() );
                                                                                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                      Open

                                                                                                                                                                                                                                                                                                          return new IXR_Error( 403, __( 'A valid email address is required' ) );
                                                                                                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                                                                                    return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
                                                                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                          Open

                                                                                                                                                                                                                                                                                                      return new IXR_Error(500, $post_ID->get_error_message());
                                                                                                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                                                                                                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                            Open

                                                                                                                                                                                                                                                                                                                    return(new IXR_Error(401, __('You are not allowed to change the page author as this user.')));
                                                                                                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                                                                                                            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                              Open

                                                                                                                                                                                                                                                                                                                  return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
                                                                                                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                                                                                                              Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                                                                                            return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
                                                                                                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                                                                                                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                                                                                              return $this->pingback_error( 32, __('We cannot find a title on that page.' ) );
                                                                                                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                                                                                                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                                                                                                                    return new IXR_Error( 404, __( 'Invalid post format' ) );
                                                                                                                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                                                                                                                    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

                                                                                                                                                                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                                                                                                                                                                      Open

                                                                                                                                                                                                                                                                                                                    return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );
                                                                                                                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                                                                                                                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 30 mins to fix

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

                                                                                                                                                                                                                                                                                                            function pingback_extensions_getPingbacks($args) {
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                global $wpdb;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getPost( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getPostType( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getTerm( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 5 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getTaxonomy( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getUsersBlogs( $args ) {
                                                                                                                                                                                                                                                                                                                // If this isn't on WPMU then just use blogger_getUsersBlogs
                                                                                                                                                                                                                                                                                                                if ( !is_multisite() ) {
                                                                                                                                                                                                                                                                                                                    array_unshift( $args, 1 );
                                                                                                                                                                                                                                                                                                                    return $this->blogger_getUsersBlogs( $args );
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getUser( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

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

                                                                                                                                                                                                                                                                                                            function wp_getPage($args) {
                                                                                                                                                                                                                                                                                                                $this->escape($args);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $page_id    = (int) $args[1];
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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

                                                                                                                                                                                                                                                                                                                if ( $logged_in ) {
                                                                                                                                                                                                                                                                                                                    $comment['comment_author'] = $this->escape( $user->display_name );
                                                                                                                                                                                                                                                                                                                    $comment['comment_author_email'] = $this->escape( $user->user_email );
                                                                                                                                                                                                                                                                                                                    $comment['comment_author_url'] = $this->escape( $user->user_url );
                                                                                                                                                                                                                                                                                                                    $comment['user_ID'] = $user->ID;
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1307..1333

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

                                                                                                                                                                                                                                                                                                        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 wp_getTaxonomy( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3676..3716

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

                                                                                                                                                                                                                                                                                                        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 wp_getPostType( $args ) {
                                                                                                                                                                                                                                                                                                                if ( ! $this->minimum_args( $args, 4 ) )
                                                                                                                                                                                                                                                                                                                    return $this->error;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 2053..2093

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

                                                                                                                                                                                                                                                                                                        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 wp_editPage($args) {
                                                                                                                                                                                                                                                                                                                // Items not escaped here will be escaped in editPost.
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $page_id    = (int) $this->escape($args[1]);
                                                                                                                                                                                                                                                                                                                $username    = $this->escape($args[2]);
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 724..767

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

                                                                                                                                                                                                                                                                                                        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 wp_getTags( $args ) {
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id        = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username        = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 877..910

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

                                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                                                foreach ( $p as $para ) {
                                                                                                                                                                                                                                                                                                                    if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
                                                                                                                                                                                                                                                                                                                        preg_match("|<a[^>]+?".$preg_target."[^>]*>([^>]+?)</a>|", $para, $context);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        // If the URL isn't in a link context, keep looking
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 3326..3351

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

                                                                                                                                                                                                                                                                                                        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

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

                                                                                                                                                                                                                                                                                                            function mt_getTrackbackPings($args) {
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                global $wpdb;
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $post_ID = intval($args);
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 3129..3163

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

                                                                                                                                                                                                                                                                                                        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 wp_suggestCategories($args) {
                                                                                                                                                                                                                                                                                                                $this->escape($args);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id                = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username                = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1007..1035

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

                                                                                                                                                                                                                                                                                                        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 wp_getMediaItem($args) {
                                                                                                                                                                                                                                                                                                                $this->escape($args);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id        = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username        = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 2929..2950

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

                                                                                                                                                                                                                                                                                                        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 wp_getComment($args) {
                                                                                                                                                                                                                                                                                                                $this->escape($args);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username    = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3529..3550

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

                                                                                                                                                                                                                                                                                                        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 wp_getCommentCount( $args ) {
                                                                                                                                                                                                                                                                                                                $this->escape($args);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username    = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1379..1404

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

                                                                                                                                                                                                                                                                                                        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 blogger_getUserInfo($args) {
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $this->escape($args);
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $username = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1633..1658

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

                                                                                                                                                                                                                                                                                                        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 ( isset($content_struct['mt_allow_comments']) ) {
                                                                                                                                                                                                                                                                                                                    if ( !is_numeric($content_struct['mt_allow_comments']) ) {
                                                                                                                                                                                                                                                                                                                        switch ( $content_struct['mt_allow_comments'] ) {
                                                                                                                                                                                                                                                                                                                            case 'closed':
                                                                                                                                                                                                                                                                                                                                $comment_status = 'closed';
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2123..2154

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

                                                                                                                                                                                                                                                                                                        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 ( isset($content_struct['mt_allow_pings']) ) {
                                                                                                                                                                                                                                                                                                                    if ( !is_numeric($content_struct['mt_allow_pings']) ) {
                                                                                                                                                                                                                                                                                                                        switch ( $content_struct['mt_allow_pings'] ) {
                                                                                                                                                                                                                                                                                                                            case 'closed':
                                                                                                                                                                                                                                                                                                                                $ping_status = 'closed';
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2156..2186

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

                                                                                                                                                                                                                                                                                                        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 ( isset( $content_struct['parent'] ) ) {
                                                                                                                                                                                                                                                                                                                    if ( ! $taxonomy['hierarchical'] )
                                                                                                                                                                                                                                                                                                                        return new IXR_Error( 403, __( "This taxonomy is not hierarchical so you can't set a parent." ) );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                    $parent_term_id = (int) $content_struct['parent'];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 1708..1722

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

                                                                                                                                                                                                                                                                                                        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 ( isset( $content_struct['parent'] ) ) {
                                                                                                                                                                                                                                                                                                                    if ( ! $taxonomy['hierarchical'] )
                                                                                                                                                                                                                                                                                                                        return new IXR_Error( 403, __( 'This taxonomy is not hierarchical.' ) );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                    $parent_term_id = (int) $content_struct['parent'];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 1808..1822

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

                                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                                                if ( isset($content_struct['wp_author_id']) && ($user->ID != $content_struct['wp_author_id']) ) {
                                                                                                                                                                                                                                                                                                                    switch ( $post_type ) {
                                                                                                                                                                                                                                                                                                                        case 'post':
                                                                                                                                                                                                                                                                                                                            if ( !current_user_can('edit_others_posts') )
                                                                                                                                                                                                                                                                                                                                return(new IXR_Error(401, __('You are not allowed to change the post author as this user.')));
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2072..2092
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2380..2400

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

                                                                                                                                                                                                                                                                                                        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

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

                                                                                                                                                                                                                                                                                                                if ( $cats = get_categories(array('get' => 'all')) ) {
                                                                                                                                                                                                                                                                                                                    foreach ( $cats as $cat ) {
                                                                                                                                                                                                                                                                                                                        $struct['categoryId'] = $cat->term_id;
                                                                                                                                                                                                                                                                                                                        $struct['parentId'] = $cat->parent;
                                                                                                                                                                                                                                                                                                                        $struct['description'] = $cat->name;
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2809..2821

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

                                                                                                                                                                                                                                                                                                        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 ( isset($content_struct['mt_allow_comments']) ) {
                                                                                                                                                                                                                                                                                                                    if ( !is_numeric($content_struct['mt_allow_comments']) ) {
                                                                                                                                                                                                                                                                                                                        switch ( $content_struct['mt_allow_comments'] ) {
                                                                                                                                                                                                                                                                                                                            case 'closed':
                                                                                                                                                                                                                                                                                                                                $comment_status = 'closed';
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2402..2430

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

                                                                                                                                                                                                                                                                                                        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 wp_getPageTemplates( $args ) {
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username    = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1470..1489

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

                                                                                                                                                                                                                                                                                                        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 ( isset($content_struct['mt_allow_pings']) ) {
                                                                                                                                                                                                                                                                                                                    if ( !is_numeric($content_struct['mt_allow_pings']) ) {
                                                                                                                                                                                                                                                                                                                        switch ( $content_struct['mt_allow_pings'] ) {
                                                                                                                                                                                                                                                                                                                            case 'closed':
                                                                                                                                                                                                                                                                                                                                $ping_status = 'closed';
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2432..2459

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

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

                                                                                                                                                                                                                                                                                                            function wp_getPageStatusList( $args ) {
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username    = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3284..3301
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3345..3362
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1352..1369
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1414..1432
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1442..1460

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

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

                                                                                                                                                                                                                                                                                                            function wp_getPostStatusList( $args ) {
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username    = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3284..3301
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3372..3389
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1352..1369
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1414..1432
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1442..1460

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

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

                                                                                                                                                                                                                                                                                                            function wp_getCommentStatusList($args) {
                                                                                                                                                                                                                                                                                                                $this->escape( $args );
                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                $blog_id    = (int) $args[0];
                                                                                                                                                                                                                                                                                                                $username    = $args[1];
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3345..3362
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3372..3389
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1352..1369
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1414..1432
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 1442..1460

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

                                                                                                                                                                                                                                                                                                        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($data['overwrite']) && ($data['overwrite'] == true) ) {
                                                                                                                                                                                                                                                                                                                    // Get postmeta info on the object.
                                                                                                                                                                                                                                                                                                                    $old_file = $wpdb->get_row("
                                                                                                                                                                                                                                                                                                                        SELECT ID
                                                                                                                                                                                                                                                                                                                        FROM {$wpdb->posts}
                                                                                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                                                                                        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                                                                                        Web.Admin/2014/wordpress/xmlrpc.php on lines 2867..2883

                                                                                                                                                                                                                                                                                                        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