Showing 4,217 of 4,217 total issues

yf_manage_shop__product_revisions has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_manage_shop__product_revisions
{
    public $temp_fields = [
        'product' => ['image', 'add_date', 'update_date', 'last_viewed_date', 'viewed', 'sold', 'status', 'origin_url', 'source', 'featured'],
        'orders' => [],

    class_db_real_migrator_mysql_test has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class class_db_real_migrator_mysql_test extends db_real_abstract
    {
        public static function db_name()
        {
            return self::$DB_NAME;
    Severity: Minor
    Found in .dev/tests/functional/db/class_db_real_migrator_mysql.Test__off__.php - About 2 hrs to fix

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

          public function date_box($selected = '', $years = '', $name_postfix = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
          {
              if (is_array($selected)) {
                  $extra = (array) $extra + $name;
                  $selected = $extra['selected'];
      Severity: Major
      Found in plugins/html/classes/html/yf_html_datetime.class.php - About 2 hrs to fix

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

            public function date_box2($name, $selected = '', $years = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
            {
                if (is_array($selected)) {
                    $extra = (array) $extra + $name;
                    $name = $extra['name'];
        Severity: Major
        Found in plugins/html/classes/html/yf_html_datetime.class.php - About 2 hrs to fix

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

              public function _form_options($options)
              {
                  if ( ! $this->ENABLE) {
                      return  null;
                  }

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

                protected function _payout_YandexMoney($title)
                {
                    $payment_api = _class('payment_api');
                    $provider_class = $payment_api->provider_class([
                        'provider_name' => 'yandexmoney',
            Severity: Major
            Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

                  public function load($options = null)
                  {
                      // import options
                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                      // var
              Severity: Major
              Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 2 hrs to fix

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

                    public function validate($validate_rules = [], $post = [], $extra = [])
                    {
                        $this->_validate_prepare($validate_rules, $extra);
                
                        $func = function ($validate_rules, $post, $extra, $form) {
                Severity: Major
                Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

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

                      public function _check_ip($ip, $ignore_ips = '', $check_type = 'force')
                      {
                          $masks = [
                              '0.0.0.0/8',        // Current network (only valid as source address)    RFC 1700
                              '10.0.0.0/8',        // Private network    RFC 1918
                  Severity: Major
                  Found in plugins/common/classes/common/yf_client_utils.class.php - About 2 hrs to fix

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

                        public function order_product_add_ajax()
                        {
                            if (empty($_POST['order_id']) || empty($_POST['product_id'])) {
                                return json_encode('ko');
                            }

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

                          public function show()
                          {
                              // Check if user exists
                              if (empty($this->_user_info)) {
                                  return _e('No such user!');
                      Severity: Major
                      Found in plugins/user/modules/yf_user_profile.class.php - About 2 hrs to fix

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

                            public function _save_log($params = [])
                            {
                                if ( ! $this->LOG_REDIRECTS) {
                                    return false;
                                }
                        Severity: Major
                        Found in plugins/logs/classes/logs/yf_logs_redirect.class.php - About 2 hrs to fix

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

                              public function _loop_detected($cur_url)
                              {
                                  if ( ! $this->LOOP_DEFENCE) {
                                      return false;
                                  }
                          Severity: Major
                          Found in classes/yf_redirect.class.php - About 2 hrs to fix

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

                                    return form($replace)
                                        ->text('code')
                                        ->integer('user_id')
                                        ->integer('sum')
                                        ->select_box('status', $this->_statuses)
                            plugins/shop/admin_modules/manage_shop/yf_manage_shop_coupons.class.php on lines 145..154

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

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

                                public function datetime($name = '', $desc = '', $extra = [], $replace = [])
                                {
                                    if ( ! is_array($extra)) {
                                        $extra = [];
                                    }
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php and 7 other locations - About 2 hrs to fix
                            plugins/form2/classes/yf_form2.class.php on lines 1568..1582
                            plugins/form2/classes/yf_form2.class.php on lines 1591..1605
                            plugins/form2/classes/yf_form2.class.php on lines 1637..1651
                            plugins/form2/classes/yf_form2.class.php on lines 1660..1674
                            plugins/form2/classes/yf_form2.class.php on lines 1683..1697
                            plugins/form2/classes/yf_form2.class.php on lines 1706..1720
                            plugins/form2/classes/yf_form2.class.php on lines 1729..1743

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

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

                                public function datetime_local($name = '', $desc = '', $extra = [], $replace = [])
                                {
                                    if ( ! is_array($extra)) {
                                        $extra = [];
                                    }
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php and 7 other locations - About 2 hrs to fix
                            plugins/form2/classes/yf_form2.class.php on lines 1568..1582
                            plugins/form2/classes/yf_form2.class.php on lines 1591..1605
                            plugins/form2/classes/yf_form2.class.php on lines 1614..1628
                            plugins/form2/classes/yf_form2.class.php on lines 1660..1674
                            plugins/form2/classes/yf_form2.class.php on lines 1683..1697
                            plugins/form2/classes/yf_form2.class.php on lines 1706..1720
                            plugins/form2/classes/yf_form2.class.php on lines 1729..1743

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

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

                                public function date($name = '', $desc = '', $extra = [], $replace = [])
                                {
                                    if ( ! is_array($extra)) {
                                        $extra = [];
                                    }
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php and 7 other locations - About 2 hrs to fix
                            plugins/form2/classes/yf_form2.class.php on lines 1568..1582
                            plugins/form2/classes/yf_form2.class.php on lines 1614..1628
                            plugins/form2/classes/yf_form2.class.php on lines 1637..1651
                            plugins/form2/classes/yf_form2.class.php on lines 1660..1674
                            plugins/form2/classes/yf_form2.class.php on lines 1683..1697
                            plugins/form2/classes/yf_form2.class.php on lines 1706..1720
                            plugins/form2/classes/yf_form2.class.php on lines 1729..1743

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

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

                                public function range($name = '', $desc = '', $extra = [], $replace = [])
                                {
                                    if ( ! is_array($extra)) {
                                        $extra = [];
                                    }
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php and 7 other locations - About 2 hrs to fix
                            plugins/form2/classes/yf_form2.class.php on lines 1568..1582
                            plugins/form2/classes/yf_form2.class.php on lines 1591..1605
                            plugins/form2/classes/yf_form2.class.php on lines 1614..1628
                            plugins/form2/classes/yf_form2.class.php on lines 1637..1651
                            plugins/form2/classes/yf_form2.class.php on lines 1660..1674
                            plugins/form2/classes/yf_form2.class.php on lines 1706..1720
                            plugins/form2/classes/yf_form2.class.php on lines 1729..1743

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

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

                                public function color($name = '', $desc = '', $extra = [], $replace = [])
                                {
                                    if ( ! is_array($extra)) {
                                        $extra = [];
                                    }
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php and 7 other locations - About 2 hrs to fix
                            plugins/form2/classes/yf_form2.class.php on lines 1591..1605
                            plugins/form2/classes/yf_form2.class.php on lines 1614..1628
                            plugins/form2/classes/yf_form2.class.php on lines 1637..1651
                            plugins/form2/classes/yf_form2.class.php on lines 1660..1674
                            plugins/form2/classes/yf_form2.class.php on lines 1683..1697
                            plugins/form2/classes/yf_form2.class.php on lines 1706..1720
                            plugins/form2/classes/yf_form2.class.php on lines 1729..1743

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

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

                                public function month($name = '', $desc = '', $extra = [], $replace = [])
                                {
                                    if ( ! is_array($extra)) {
                                        $extra = [];
                                    }
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php and 7 other locations - About 2 hrs to fix
                            plugins/form2/classes/yf_form2.class.php on lines 1568..1582
                            plugins/form2/classes/yf_form2.class.php on lines 1591..1605
                            plugins/form2/classes/yf_form2.class.php on lines 1614..1628
                            plugins/form2/classes/yf_form2.class.php on lines 1637..1651
                            plugins/form2/classes/yf_form2.class.php on lines 1683..1697
                            plugins/form2/classes/yf_form2.class.php on lines 1706..1720
                            plugins/form2/classes/yf_form2.class.php on lines 1729..1743

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

                            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