CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php

Summary

Maintainability
F
1 wk
Test Coverage

File class-wp-upgrader.php has 776 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * A File upgrader class for WordPress.
 *
 * This set of classes are designed to be used to upgrade/install a local set of files on the filesystem via the Filesystem Abstraction classes.
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 1 day to fix

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

        function install_package($args = array()) {
            global $wp_filesystem;
            $defaults = array( 'source' => '', 'destination' => '', //Please always pass these
                            'clear_destination' => false, 'clear_working' => false,
                            'hook_extra' => array());
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 fs_connect has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        function fs_connect( $directories = array() ) {
            global $wp_filesystem;
    
            if ( false === ($credentials = $this->skin->request_filesystem_credentials()) )
                return false;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 install_package has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function install_package($args = array()) {
            global $wp_filesystem;
            $defaults = array( 'source' => '', 'destination' => '', //Please always pass these
                            'clear_destination' => false, 'clear_working' => false,
                            'hook_extra' => array());
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 2 hrs to fix

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

          function run($options) {
      
              $defaults = array(     'package' => '', //Please always pass this.
                                  'destination' => '', //And this
                                  'clear_destination' => false,
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 1 hr to fix

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

            function bulk_upgrade($plugins) {
        
                $this->init();
                $this->bulk = true;
                $this->upgrade_strings();
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 1 hr to fix

          Method fs_connect has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function fs_connect( $directories = array() ) {
                  global $wp_filesystem;
          
                  if ( false === ($credentials = $this->skin->request_filesystem_credentials()) )
                      return false;
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 1 hr to fix

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

                function __construct($form, $urlholder) {
                    if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
                        wp_die($uploads['error']);
            
                    if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) )
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 error has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                function error($errors) {
                    if ( ! $this->done_header )
                        $this->header();
                    if ( is_string($errors) ) {
                        $this->feedback($errors);
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 upgrade has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function upgrade($theme) {
            
                    $this->init();
                    $this->upgrade_strings();
            
            
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 1 hr to fix

              Method upgrade has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function upgrade($plugin) {
              
                      $this->init();
                      $this->upgrade_strings();
              
              
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 1 hr to fix

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

                    function run($options) {
                
                        $defaults = array(     'package' => '', //Please always pass this.
                                            'destination' => '', //And this
                                            'clear_destination' => false,
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 bulk_upgrade has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    function bulk_upgrade($plugins) {
                
                        $this->init();
                        $this->bulk = true;
                        $this->upgrade_strings();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 after has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    function after() {
                        if ( $this->upgrader->bulk )
                            return;
                
                        $this->plugin = $this->upgrader->plugin_info();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 after has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    function after() {
                        if ( empty($this->upgrader->result['destination_name']) )
                            return;
                
                        $theme_info = $this->upgrader->theme_info();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 upgrade has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    function upgrade($current) {
                        global $wp_filesystem;
                
                        $this->init();
                        $this->upgrade_strings();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 delete_old_plugin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
                        global $wp_filesystem;
                
                        if ( is_wp_error($removed) )
                            return $removed; //Pass errors through.
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination );
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

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

                        Avoid too many return statements within this method.
                        Open

                                return update_core($working_dir, $wp_dir);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return new WP_Error('mkdir_failed', $this->strings['mkdir_failed'], $remote_destination);
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

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

                              Avoid too many return statements within this method.
                              Open

                                                  return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                          return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return new WP_Error('copy_failed', $this->strings['copy_failed']);
                                    Severity: Major
                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                              return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                                return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
                                        Severity: Major
                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

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

                                              Avoid too many return statements within this method.
                                              Open

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

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

                                                      function after() {
                                                  
                                                          if ( !empty($this->upgrader->result['destination_name']) &&
                                                              ($theme_info = $this->upgrader->theme_info()) &&
                                                              !empty($theme_info) ) {
                                                  Severity: Minor
                                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 unpack_package has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                      function unpack_package($package, $delete_package = true) {
                                                          global $wp_filesystem;
                                                  
                                                          $this->skin->feedback('unpack_package');
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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

                                                              $update_actions =  array(
                                                                  'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>',
                                                                  'activate' => '<a href="' . $activate_link .  '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>',
                                                              );
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 1045..1048

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

                                                  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

                                                          $install_actions = array(
                                                              'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>',
                                                              'activate' => '<a href="' . $activate_link .  '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>'
                                                                              );
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 1102..1105

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

                                                  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 ( $this->type == 'web' )
                                                              $install_actions['themes_page'] = '<a href="' . admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
                                                          else
                                                              $install_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 442..445
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 982..985

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

                                                  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 ( $this->type == 'web' )
                                                              $install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
                                                          else
                                                              $install_actions['plugins_page'] = '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 442..445
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 1050..1053

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

                                                  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 install_strings() {
                                                          $this->strings['no_package'] = __('Install package not available.');
                                                          $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>.');
                                                          $this->strings['unpack_package'] = __('Unpacking the package.');
                                                          $this->strings['installing_package'] = __('Installing the theme.');
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 378..385

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

                                                  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 install_strings() {
                                                          $this->strings['no_package'] = __('Install package not available.');
                                                          $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>.');
                                                          $this->strings['unpack_package'] = __('Unpacking the package.');
                                                          $this->strings['installing_package'] = __('Installing the plugin.');
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 603..610

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

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

                                                      function __construct($args = array()) {
                                                          $defaults = array( 'type' => 'web', 'url' => '', 'theme' => '', 'nonce' => '', 'title' => '' );
                                                          $args = wp_parse_args($args, $defaults);
                                                  
                                                          $this->type = $args['type'];
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 407..415
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 482..490
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 959..967

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

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

                                                      function __construct($args = array()) {
                                                          $defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
                                                          $args = wp_parse_args($args, $defaults);
                                                  
                                                          $this->type = $args['type'];
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 407..415
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 482..490
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php on lines 1014..1022

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

                                                  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 request_filesystem_credentials($error = false) {
                                                          $url = $this->options['url'];
                                                          $context = $this->options['context'];
                                                          if ( !empty($this->options['nonce']) )
                                                              $url = wp_nonce_url($url, $this->options['nonce']);
                                                  Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.php on lines 41..47

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

                                                  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