woothemes/woocommerce

View on GitHub

Showing 4,341 of 4,341 total issues

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

S2.define('select2/selection/single',[
  'jquery',
  './base',
  '../utils',
  '../keys'
Severity: Major
Found in assets/js/select2/select2.js and 1 other location - About 4 days to fix
assets/js/select2/select2.full.js on lines 1469..1567

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

S2.define('select2/selection/single',[
  'jquery',
  './base',
  '../utils',
  '../keys'
Severity: Major
Found in assets/js/select2/select2.full.js and 1 other location - About 4 days to fix
assets/js/select2/select2.js on lines 1469..1567

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

S2.define('select2/selection/multiple',[
  'jquery',
  './base',
  '../utils'
], function ($, BaseSelection, Utils) {
Severity: Major
Found in assets/js/select2/select2.full.js and 1 other location - About 4 days to fix
assets/js/select2/select2.js on lines 1569..1677

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

S2.define('select2/selection/multiple',[
  'jquery',
  './base',
  '../utils'
], function ($, BaseSelection, Utils) {
Severity: Major
Found in assets/js/select2/select2.js and 1 other location - About 4 days to fix
assets/js/select2/select2.full.js on lines 1569..1677

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

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

Method get_item_schema has 844 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get_item_schema() {
        $schema = array(
            '$schema'    => 'http://json-schema.org/draft-04/schema#',
            'title'      => $this->post_type,
            'type'       => 'object',

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

        public $GEOIP_COUNTRY_NAMES = array(
            '',
            'Asia/Pacific Region',
            'Europe',
            'Andorra',
    Severity: Major
    Found in includes/class-wc-geo-ip.php and 3 other locations - About 4 days to fix
    includes/class-wc-geo-ip.php on lines 112..369
    includes/class-wc-geo-ip.php on lines 376..633
    includes/class-wc-geo-ip.php on lines 904..1161

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

    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

        public $GEOIP_COUNTRY_CODES3 = array(
            '',
            'AP',
            'EU',
            'AND',
    Severity: Major
    Found in includes/class-wc-geo-ip.php and 3 other locations - About 4 days to fix
    includes/class-wc-geo-ip.php on lines 112..369
    includes/class-wc-geo-ip.php on lines 640..897
    includes/class-wc-geo-ip.php on lines 904..1161

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

    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

        public $GEOIP_CONTINENT_CODES = array(
            '--',
            'AS',
            'EU',
            'EU',
    Severity: Major
    Found in includes/class-wc-geo-ip.php and 3 other locations - About 4 days to fix
    includes/class-wc-geo-ip.php on lines 112..369
    includes/class-wc-geo-ip.php on lines 376..633
    includes/class-wc-geo-ip.php on lines 640..897

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

    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

        public $GEOIP_COUNTRY_CODES = array(
            '',
            'AP',
            'EU',
            'AD',
    Severity: Major
    Found in includes/class-wc-geo-ip.php and 3 other locations - About 4 days to fix
    includes/class-wc-geo-ip.php on lines 376..633
    includes/class-wc-geo-ip.php on lines 640..897
    includes/class-wc-geo-ip.php on lines 904..1161

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    S2.define('select2/dropdown/search',[
      'jquery',
      '../utils'
    ], function ($, Utils) {
      function Search () { }
    Severity: Major
    Found in assets/js/select2/select2.full.js and 1 other location - About 4 days to fix
    assets/js/select2/select2.js on lines 3879..3979

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    S2.define('select2/dropdown/search',[
      'jquery',
      '../utils'
    ], function ($, Utils) {
      function Search () { }
    Severity: Major
    Found in assets/js/select2/select2.js and 1 other location - About 4 days to fix
    assets/js/select2/select2.full.js on lines 3879..3979

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

    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

    Method get_item_schema has 832 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_item_schema() {
            $weight_unit    = get_option( 'woocommerce_weight_unit' );
            $dimension_unit = get_option( 'woocommerce_dimension_unit' );
            $schema         = array(
                '$schema'    => 'http://json-schema.org/draft-04/schema#',

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

      S2.define('select2/dropdown/infiniteScroll',[
        'jquery'
      ], function ($) {
        function InfiniteScroll (decorated, $element, options, dataAdapter) {
          this.lastParams = {};
      Severity: Major
      Found in assets/js/selectWoo/selectWoo.full.js and 3 other locations - About 4 days to fix
      assets/js/select2/select2.full.js on lines 4024..4112
      assets/js/select2/select2.js on lines 4024..4112
      assets/js/selectWoo/selectWoo.js on lines 4142..4230

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

      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

      S2.define('select2/dropdown/infiniteScroll',[
        'jquery'
      ], function ($) {
        function InfiniteScroll (decorated, $element, options, dataAdapter) {
          this.lastParams = {};
      Severity: Major
      Found in assets/js/select2/select2.full.js and 3 other locations - About 4 days to fix
      assets/js/select2/select2.js on lines 4024..4112
      assets/js/selectWoo/selectWoo.full.js on lines 4142..4230
      assets/js/selectWoo/selectWoo.js on lines 4142..4230

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

      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

      S2.define('select2/dropdown/infiniteScroll',[
        'jquery'
      ], function ($) {
        function InfiniteScroll (decorated, $element, options, dataAdapter) {
          this.lastParams = {};
      Severity: Major
      Found in assets/js/select2/select2.js and 3 other locations - About 4 days to fix
      assets/js/select2/select2.full.js on lines 4024..4112
      assets/js/selectWoo/selectWoo.full.js on lines 4142..4230
      assets/js/selectWoo/selectWoo.js on lines 4142..4230

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

      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

      S2.define('select2/dropdown/infiniteScroll',[
        'jquery'
      ], function ($) {
        function InfiniteScroll (decorated, $element, options, dataAdapter) {
          this.lastParams = {};
      Severity: Major
      Found in assets/js/selectWoo/selectWoo.js and 3 other locations - About 4 days to fix
      assets/js/select2/select2.full.js on lines 4024..4112
      assets/js/select2/select2.js on lines 4024..4112
      assets/js/selectWoo/selectWoo.full.js on lines 4142..4230

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

      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

      File wc-update-functions.php has 1486 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * WooCommerce Updates
       *
       * Functions for updating data, used by the background updater.
      Severity: Major
      Found in includes/wc-update-functions.php - About 3 days to fix

        File class-wc-geo-ip.php has 1478 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Geo IP class
         *
         * This class is a fork of GeoIP class from MaxMind LLC.
        Severity: Major
        Found in includes/class-wc-geo-ip.php - About 3 days to fix

          File wc-core-functions.php has 1477 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * WooCommerce Core Functions
           *
           * General core functions available on both the front-end and admin.
          Severity: Major
          Found in includes/wc-core-functions.php - About 3 days to fix

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

            S2.define('select2/selection/allowClear',[
              'jquery',
              '../keys'
            ], function ($, KEYS) {
              function AllowClear () { }
            Severity: Major
            Found in assets/js/selectWoo/selectWoo.js and 3 other locations - About 3 days to fix
            assets/js/select2/select2.full.js on lines 1729..1825
            assets/js/select2/select2.js on lines 1729..1825
            assets/js/selectWoo/selectWoo.full.js on lines 1824..1920

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

            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

            Severity
            Category
            Status
            Source
            Language