woocommerce/woocommerce

View on GitHub
includes/admin/class-wc-admin-setup-wizard.php

Summary

Maintainability
F
2 wks
Test Coverage

File class-wc-admin-setup-wizard.php has 1682 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Setup Wizard Class
 *
 * Takes new users through some basic steps to setup their store.
Severity: Major
Found in includes/admin/class-wc-admin-setup-wizard.php - About 4 days to fix

    WC_Admin_Setup_Wizard has 64 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class WC_Admin_Setup_Wizard {
    
        /**
         * Current step
         *
    Severity: Major
    Found in includes/admin/class-wc-admin-setup-wizard.php - About 1 day to fix

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

          public function wc_setup_shipping() {
              _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
              $country_code          = WC()->countries->get_base_country();
              $country_name          = WC()->countries->countries[ $country_code ];
              $prefixed_country_name = WC()->countries->estimated_for_prefix( $country_code ) . $country_name;
      Severity: Major
      Found in includes/admin/class-wc-admin-setup-wizard.php - About 6 hrs to fix

        Function wc_setup_activate_get_feature_list_str has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function wc_setup_activate_get_feature_list_str() {
                _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                $features = $this->wc_setup_activate_get_feature_list();
                if ( $features['payment'] && $features['taxes'] && $features['labels'] ) {
                    return __( 'payment setup, automated taxes and discounted shipping labels', 'woocommerce' );
        Severity: Minor
        Found in includes/admin/class-wc-admin-setup-wizard.php - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method get_wizard_available_in_cart_payment_gateways has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function get_wizard_available_in_cart_payment_gateways() {
                _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                $user_email = $this->get_current_user_email();
        
                $stripe_description = '<p>' . sprintf(
        Severity: Major
        Found in includes/admin/class-wc-admin-setup-wizard.php - About 5 hrs to fix

          Method wc_setup_activate has 127 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function wc_setup_activate() {
                  _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                  $this->wc_setup_activate_actions();
          
                  $jetpack_connected = class_exists( 'Jetpack' ) && Jetpack::is_active();
          Severity: Major
          Found in includes/admin/class-wc-admin-setup-wizard.php - About 5 hrs to fix

            Method wc_setup_store_setup has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function wc_setup_store_setup() {
                    _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                    $address        = WC()->countries->get_base_address();
                    $address_2      = WC()->countries->get_base_address_2();
                    $city           = WC()->countries->get_base_city();
            Severity: Major
            Found in includes/admin/class-wc-admin-setup-wizard.php - About 4 hrs to fix

              Method display_service_item has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function display_service_item( $item_id, $item_info ) {
                      _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                      $item_class = 'wc-wizard-service-item';
                      if ( isset( $item_info['class'] ) ) {
                          $item_class .= ' ' . $item_info['class'];
              Severity: Major
              Found in includes/admin/class-wc-admin-setup-wizard.php - About 3 hrs to fix

                Function display_service_item has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function display_service_item( $item_id, $item_info ) {
                        _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                        $item_class = 'wc-wizard-service-item';
                        if ( isset( $item_info['class'] ) ) {
                            $item_class .= ' ' . $item_info['class'];
                Severity: Minor
                Found in includes/admin/class-wc-admin-setup-wizard.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 wc_setup_ready has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function wc_setup_ready() {
                        _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                        // We've made it! Don't prompt the user to run the wizard again.
                        WC_Admin_Notices::remove_notice( 'install', true );
                
                
                Severity: Major
                Found in includes/admin/class-wc-admin-setup-wizard.php - About 3 hrs to fix

                  Method wc_setup_recommended has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function wc_setup_recommended() {
                          _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                          ?>
                          <h1><?php esc_html_e( 'Recommended for All WooCommerce Stores', 'woocommerce' ); ?></h1>
                          <p>
                  Severity: Major
                  Found in includes/admin/class-wc-admin-setup-wizard.php - About 2 hrs to fix

                    Method wc_setup_payment has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function wc_setup_payment() {
                            _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                            $featured_gateways = array_filter( $this->get_wizard_in_cart_payment_gateways(), array( $this, 'is_featured_service' ) );
                            $in_cart_gateways  = array_filter( $this->get_wizard_in_cart_payment_gateways(), array( $this, 'is_not_featured_service' ) );
                            $manual_gateways   = $this->get_wizard_manual_payment_gateways();
                    Severity: Major
                    Found in includes/admin/class-wc-admin-setup-wizard.php - About 2 hrs to fix

                      Function wc_setup_activate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function wc_setup_activate() {
                              _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                              $this->wc_setup_activate_actions();
                      
                              $jetpack_connected = class_exists( 'Jetpack' ) && Jetpack::is_active();
                      Severity: Minor
                      Found in includes/admin/class-wc-admin-setup-wizard.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 setup_wizard has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function setup_wizard() {
                              _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                              if ( empty( $_GET['page'] ) || 'wc-setup' !== $_GET['page'] ) { // WPCS: CSRF ok, input var ok.
                                  return;
                              }
                      Severity: Major
                      Found in includes/admin/class-wc-admin-setup-wizard.php - About 2 hrs to fix

                        Method shipping_method_selection_form has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function shipping_method_selection_form( $country_code, $currency_code, $input_prefix ) {
                                _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                $selected         = 'flat_rate';
                                $shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code );
                                ?>
                        Severity: Major
                        Found in includes/admin/class-wc-admin-setup-wizard.php - About 2 hrs to fix

                          Method get_wizard_in_cart_payment_gateways has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function get_wizard_in_cart_payment_gateways() {
                                  _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                  $gateways = $this->get_wizard_available_in_cart_payment_gateways();
                                  $country  = WC()->countries->get_base_country();
                                  $currency = get_woocommerce_currency();
                          Severity: Minor
                          Found in includes/admin/class-wc-admin-setup-wizard.php - About 2 hrs to fix

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

                                public function get_wizard_in_cart_payment_gateways() {
                                    _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                    $gateways = $this->get_wizard_available_in_cart_payment_gateways();
                                    $country  = WC()->countries->get_base_country();
                                    $currency = get_woocommerce_currency();
                            Severity: Minor
                            Found in includes/admin/class-wc-admin-setup-wizard.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 tracking_modal has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function tracking_modal() {
                                    _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                    ?>
                                    <script type="text/template" id="tmpl-wc-modal-tracking-setup">
                                        <div class="wc-backbone-modal woocommerce-tracker">
                            Severity: Minor
                            Found in includes/admin/class-wc-admin-setup-wizard.php - About 1 hr to fix

                              Method display_recommended_item has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function display_recommended_item( $item_info ) {
                                      _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                      $type        = $item_info['type'];
                                      $title       = $item_info['title'];
                                      $description = $item_info['description'];
                              Severity: Minor
                              Found in includes/admin/class-wc-admin-setup-wizard.php - About 1 hr to fix

                                Method setup_wizard_steps has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function setup_wizard_steps() {
                                        _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                        $output_steps      = $this->steps;
                                        $selected_features = array_filter( $this->wc_setup_activate_get_feature_list() );
                                
                                
                                Severity: Minor
                                Found in includes/admin/class-wc-admin-setup-wizard.php - About 1 hr to fix

                                  Method is_paypal_supported_currency has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function is_paypal_supported_currency( $currency ) {
                                          _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                          $supported_currencies = array(
                                              'AUD',
                                              'BRL',
                                  Severity: Minor
                                  Found in includes/admin/class-wc-admin-setup-wizard.php - About 1 hr to fix

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

                                        protected function shipping_method_selection_form( $country_code, $currency_code, $input_prefix ) {
                                            _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                            $selected         = 'flat_rate';
                                            $shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code );
                                            ?>
                                    Severity: Minor
                                    Found in includes/admin/class-wc-admin-setup-wizard.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 setup_wizard has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function setup_wizard() {
                                            _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                            if ( empty( $_GET['page'] ) || 'wc-setup' !== $_GET['page'] ) { // WPCS: CSRF ok, input var ok.
                                                return;
                                            }
                                    Severity: Minor
                                    Found in includes/admin/class-wc-admin-setup-wizard.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 wc_setup_shipping has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function wc_setup_shipping() {
                                            _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                            $country_code          = WC()->countries->get_base_country();
                                            $country_name          = WC()->countries->countries[ $country_code ];
                                            $prefixed_country_name = WC()->countries->estimated_for_prefix( $country_code ) . $country_name;
                                    Severity: Minor
                                    Found in includes/admin/class-wc-admin-setup-wizard.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 setup_wizard_steps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function setup_wizard_steps() {
                                            _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                            $output_steps      = $this->steps;
                                            $selected_features = array_filter( $this->wc_setup_activate_get_feature_list() );
                                    
                                    
                                    Severity: Minor
                                    Found in includes/admin/class-wc-admin-setup-wizard.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 wc_setup_payment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function wc_setup_payment() {
                                            _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                            $featured_gateways = array_filter( $this->get_wizard_in_cart_payment_gateways(), array( $this, 'is_featured_service' ) );
                                            $in_cart_gateways  = array_filter( $this->get_wizard_in_cart_payment_gateways(), array( $this, 'is_not_featured_service' ) );
                                            $manual_gateways   = $this->get_wizard_manual_payment_gateways();
                                    Severity: Minor
                                    Found in includes/admin/class-wc-admin-setup-wizard.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 __( 'discounted shipping labels', 'woocommerce' );
                                    Severity: Major
                                    Found in includes/admin/class-wc-admin-setup-wizard.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return __( 'automated taxes and discounted shipping labels', 'woocommerce' );
                                      Severity: Major
                                      Found in includes/admin/class-wc-admin-setup-wizard.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return __( 'automated taxes', 'woocommerce' );
                                        Severity: Major
                                        Found in includes/admin/class-wc-admin-setup-wizard.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return false;
                                          Severity: Major
                                          Found in includes/admin/class-wc-admin-setup-wizard.php - About 30 mins to fix

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

                                                public function wc_setup_store_setup() {
                                                    _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
                                                    $address        = WC()->countries->get_base_address();
                                                    $address_2      = WC()->countries->get_base_address_2();
                                                    $city           = WC()->countries->get_base_city();
                                            Severity: Minor
                                            Found in includes/admin/class-wc-admin-setup-wizard.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

                                                            'settings'    => array(
                                                                'reroute_requests' => array(
                                                                    'label'       => __( 'Set up PayPal for me using this email:', 'woocommerce' ),
                                                                    'type'        => 'checkbox',
                                                                    'value'       => 'yes',
                                            Severity: Major
                                            Found in includes/admin/class-wc-admin-setup-wizard.php and 1 other location - About 1 hr to fix
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1410..1427

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

                                            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

                                                            'settings'    => array(
                                                                'create_account' => array(
                                                                    'label'       => __( 'Set up Stripe for me using this email:', 'woocommerce' ),
                                                                    'type'        => 'checkbox',
                                                                    'value'       => 'yes',
                                            Severity: Major
                                            Found in includes/admin/class-wc-admin-setup-wizard.php and 1 other location - About 1 hr to fix
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1436..1453

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

                                            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->should_show_mailchimp() ) :
                                                                $this->display_recommended_item( array(
                                                                    'type'        => 'mailchimp',
                                                                    'title'       => __( 'Mailchimp', 'woocommerce' ),
                                                                    'description' => __( 'Join the 16 million customers who use Mailchimp. Sync list and store data to send automated emails, and targeted campaigns.', 'woocommerce' ),
                                            Severity: Major
                                            Found in includes/admin/class-wc-admin-setup-wizard.php and 2 other locations - About 1 hr to fix
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1913..1922
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1935..1944

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

                                            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->should_show_facebook() ) :
                                                                $this->display_recommended_item( array(
                                                                    'type'        => 'facebook',
                                                                    'title'       => __( 'Facebook', 'woocommerce' ),
                                                                    'description' => __( 'Enjoy all Facebook products combined in one extension: pixel tracking, catalog sync, messenger chat, shop functionality and Instagram shopping (coming soon)!', 'woocommerce' ),
                                            Severity: Major
                                            Found in includes/admin/class-wc-admin-setup-wizard.php and 2 other locations - About 1 hr to fix
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1913..1922
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1924..1933

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

                                            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->should_show_wc_admin() ) :
                                                                $this->display_recommended_item( array(
                                                                    'type'        => 'wc_admin',
                                                                    'title'       => __( 'WooCommerce Admin', 'woocommerce' ),
                                                                    'description' => __( 'Manage your store\'s reports and monitor key metrics with a new and improved interface and dashboard.', 'woocommerce' ),
                                            Severity: Major
                                            Found in includes/admin/class-wc-admin-setup-wizard.php and 2 other locations - About 1 hr to fix
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1924..1933
                                            includes/admin/class-wc-admin-setup-wizard.php on lines 1935..1944

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

                                            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