woothemes/woocommerce

View on GitHub
includes/admin/class-wc-admin-pointers.php

Summary

Maintainability
D
1 day
Test Coverage

Method create_product_tutorial has 168 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create_product_tutorial() {
        if ( ! isset( $_GET['tutorial'] ) || ! current_user_can( 'manage_options' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
            return;
        }

Severity: Major
Found in includes/admin/class-wc-admin-pointers.php - About 6 hrs to fix

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

        public function enqueue_pointers( $pointers ) {
            $pointers = rawurlencode( wp_json_encode( $pointers ) );
            wp_enqueue_style( 'wp-pointer' );
            wp_enqueue_script( 'wp-pointer' );
            wc_enqueue_js(
    Severity: Major
    Found in includes/admin/class-wc-admin-pointers.php - About 2 hrs to fix

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

                              'content'  => '<h3>' . esc_html__( 'Choose product type', 'woocommerce' ) . '</h3>' .
                                              '<p>' . esc_html__( 'Choose a type for this product. Simple is suitable for most physical goods and services (we recommend setting up a simple product for now).', 'woocommerce' ) . '</p>' .
                                              '<p>' . esc_html__( 'Variable is for more complex products such as t-shirts with multiple sizes.', 'woocommerce' ) . '</p>' .
                                              '<p>' . esc_html__( 'Grouped products are for grouping several simple products into one.', 'woocommerce' ) . '</p>' .
                                              '<p>' . esc_html__( 'Finally, external products are for linking off-site.', 'woocommerce' ) . '</p>',
      Severity: Major
      Found in includes/admin/class-wc-admin-pointers.php and 1 other location - About 1 hr to fix
      includes/admin/class-wc-admin-help.php on lines 75..79

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

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

                      'virtual'        => array(
                          'target'       => '#_virtual',
                          'next'         => 'downloadable',
                          'next_trigger' => array(
                              'target' => '#_virtual',
      Severity: Major
      Found in includes/admin/class-wc-admin-pointers.php and 4 other locations - About 55 mins to fix
      includes/admin/class-wc-admin-pointers.php on lines 53..68
      includes/admin/class-wc-admin-pointers.php on lines 117..132
      includes/admin/class-wc-admin-pointers.php on lines 133..148
      includes/admin/class-wc-admin-pointers.php on lines 149..164

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

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

                      'title'          => array(
                          'target'       => '#title',
                          'next'         => 'content',
                          'next_trigger' => array(
                              'target' => '#title',
      Severity: Major
      Found in includes/admin/class-wc-admin-pointers.php and 4 other locations - About 55 mins to fix
      includes/admin/class-wc-admin-pointers.php on lines 101..116
      includes/admin/class-wc-admin-pointers.php on lines 117..132
      includes/admin/class-wc-admin-pointers.php on lines 133..148
      includes/admin/class-wc-admin-pointers.php on lines 149..164

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

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

                      'postexcerpt'    => array(
                          'target'       => '#postexcerpt',
                          'next'         => 'postimagediv',
                          'next_trigger' => array(
                              'target' => '#postexcerpt',
      Severity: Major
      Found in includes/admin/class-wc-admin-pointers.php and 4 other locations - About 55 mins to fix
      includes/admin/class-wc-admin-pointers.php on lines 53..68
      includes/admin/class-wc-admin-pointers.php on lines 101..116
      includes/admin/class-wc-admin-pointers.php on lines 117..132
      includes/admin/class-wc-admin-pointers.php on lines 133..148

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

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

                      'regular_price'  => array(
                          'target'       => '#_regular_price',
                          'next'         => 'postexcerpt',
                          'next_trigger' => array(
                              'target' => '#_regular_price',
      Severity: Major
      Found in includes/admin/class-wc-admin-pointers.php and 4 other locations - About 55 mins to fix
      includes/admin/class-wc-admin-pointers.php on lines 53..68
      includes/admin/class-wc-admin-pointers.php on lines 101..116
      includes/admin/class-wc-admin-pointers.php on lines 117..132
      includes/admin/class-wc-admin-pointers.php on lines 149..164

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

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

                      'downloadable'   => array(
                          'target'       => '#_downloadable',
                          'next'         => 'regular_price',
                          'next_trigger' => array(
                              'target' => '#_downloadable',
      Severity: Major
      Found in includes/admin/class-wc-admin-pointers.php and 4 other locations - About 55 mins to fix
      includes/admin/class-wc-admin-pointers.php on lines 53..68
      includes/admin/class-wc-admin-pointers.php on lines 101..116
      includes/admin/class-wc-admin-pointers.php on lines 133..148
      includes/admin/class-wc-admin-pointers.php on lines 149..164

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

      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