Showing 4,217 of 4,217 total issues

Method _user_message has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _user_message($options = null)
    {
        $url = &$this->url;
        // import operation
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 2 hrs to fix

    Method authorize has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function authorize()
        {
            $url = &$this->url;
            $url_authorize = $this->_url('authorize');
            // class
    Severity: Major
    Found in plugins/payment/admin_modules/yf_manage_payment_yandexmoney.class.php - About 2 hrs to fix

      Method _user_message has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _user_message($options = null)
          {
              $url = &$this->url;
              // import operation
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
      Severity: Major
      Found in plugins/payment/admin_modules/yf_manage_payment_yandexmoney.class.php - About 2 hrs to fix

        Method _paths has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _paths() {
                $paths = [
                    '.',
                    'plugins',
                ];
        Severity: Major
        Found in plugins/tpl/classes/tpl/yf_tpl_driver_twig.class.php - About 2 hrs to fix

          Method _init has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _init()
              {
                  // Needed to ensure backtracking still works on big templates (extended from 1 000 000 on 26kb stpl js() parsing)
                  ini_set('pcre.backtrack_limit', '10000000');
          
          
          Severity: Major
          Found in plugins/tpl/classes/yf_tpl.class.php - About 2 hrs to fix

            Method _prepare_cond_text has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _prepare_cond_text($cond = '', $replace = [], $stpl_name = '', $for_right = false)
                {
                    $prepared_array = [];
                    $cond = str_replace("\t", '', trim($cond));
                    foreach (explode(' ', $cond) as $val) {
            Severity: Major
            Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 2 hrs to fix

              Method _user_security_checks has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _user_security_checks($user_id)
                  {
                      $user_id = (int) $user_id;
                      if ( ! $this->USER_SECURITY_CHECKS || ! $user_id) {
                          return false;
              Severity: Major
              Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 2 hrs to fix

                Method _rss_general has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _rss_general()
                    {
                        foreach ((array) module('comments')->COMMENT_LINKS as $key => $value) {
                            $where .= 'object_name="' . $key . '"';
                            if ($value !== end(module('comments')->COMMENT_LINKS)) {
                Severity: Major
                Found in plugins/comments/modules/comments/yf_comments_integration.class.php - About 2 hrs to fix

                  Method send has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function send(array $params = [], &$error_message = '')
                      {
                          $CRLF = "\r\n";
                          $TAB = "\t";
                  
                  
                  Severity: Major
                  Found in plugins/email/classes/mail/yf_mail_driver_internal.class.php - About 2 hrs to fix

                    Method get_access_token has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function get_access_token()
                        {
                            $access_token = $this->_storage_get('access_token');
                            if ($access_token) {
                                return $access_token;
                    Severity: Major
                    Found in plugins/oauth/classes/oauth/yf_oauth_driver1.class.php - About 2 hrs to fix

                      Method _currency_convert has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _currency_convert($number = 0, $c_from = '', $c_to = '')
                          {
                              if ( ! $number || ! $c_from || ! $c_to) {
                                  return $number;
                              }
                      Severity: Major
                      Found in plugins/common/classes/common/yf_other_common.class.php - About 2 hrs to fix

                        Method _is_spider has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _is_spider($ip = '', $ua = '')
                            {
                                $CHECK_IP = false;
                                $CHECK_UA = false;
                                if ($ip && preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip)) {
                        Severity: Major
                        Found in plugins/common/classes/common/yf_spider_detection.class.php - About 2 hrs to fix

                          Method coupon_edit has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function coupon_edit()
                              {
                                  $_GET['id'] = (int) ($_GET['id']);
                                  if (empty($_GET['id'])) {
                                      return _e('Empty ID!');

                            Method express has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function express()
                                {
                                    $date = date('Y-m-d');
                                    $orders_info = db()->query_fetch_all('SELECT * FROM ' . db('shop_orders') . " WHERE delivery_time LIKE '" . $date . "%' AND status = 1");
                                    if ( ! empty($orders_info)) {

                              Method _do_check_data_is_valid has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function _do_check_data_is_valid($rules = [], &$data)
                                  {
                                      $validate_ok = true;
                                      $_all = '__all__';
                                      if (isset($rules[$_all])) {
                              Severity: Major
                              Found in classes/yf_validate.class.php - About 2 hrs to fix

                                Method test_validate_multi_select has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function test_validate_multi_select()
                                    {
                                        $_SERVER['REQUEST_METHOD'] = 'POST';
                                        $params = ['do_not_remove_errors' => 1];
                                
                                
                                Severity: Major
                                Found in .dev/tests/functional/class_form_real_test.Test.php - About 2 hrs to fix

                                  Method test_sql_to_php_db_installer has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function test_sql_to_php_db_installer()
                                      {
                                          if ($this->_need_skip_test(__FUNCTION__)) {
                                              return;
                                          }
                                  Severity: Major
                                  Found in .dev/tests/unit/db/class_db_ddl_parser_mysql_test.Test.php - About 2 hrs to fix

                                    File yf_captcha.class.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    
                                    /**
                                     * Class to handle CAPTCHA images (to prevent auto-registering, flooding etc).
                                     *
                                    Severity: Minor
                                    Found in plugins/content/classes/yf_captcha.class.php - About 2 hrs to fix

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

                                              $expected = implode(PHP_EOL, [
                                                  '<script src="' . $url3 . '" type="text/javascript"></script>', // required js
                                                  '<script src="' . $jquery_url . '" type="text/javascript"></script>', // Appears as requirement for inlined script, after required js
                                                  '<script src="' . $url4 . '" type="text/javascript"></script>', // required asset appears after js and jquery
                                                  '<script src="' . $url1 . '" type="text/javascript"></script>', // main script
                                      Severity: Major
                                      Found in .dev/tests/unit/class_assets_test.Test.php and 3 other locations - About 2 hrs to fix
                                      .dev/tests/unit/class_assets_test.Test.php on lines 602..609
                                      .dev/tests/unit/class_assets_test.Test.php on lines 924..931
                                      .dev/tests/unit/class_assets_test.Test.php on lines 973..980

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

                                      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

                                              $expected = implode(PHP_EOL, [
                                                  '<script src="' . $jquery_url . '" type="text/javascript"></script>', // Appears first because of required config entry
                                                  '<script src="' . $url1 . '" type="text/javascript"></script>', // main script url
                                                  '<script src="' . $url2 . '" type="text/javascript"></script>', // main script url
                                                  '<script src="' . $url3 . '" type="text/javascript"></script>', // main asset appears after js and jquery
                                      Severity: Major
                                      Found in .dev/tests/unit/class_assets_test.Test.php and 3 other locations - About 2 hrs to fix
                                      .dev/tests/unit/class_assets_test.Test.php on lines 602..609
                                      .dev/tests/unit/class_assets_test.Test.php on lines 878..885
                                      .dev/tests/unit/class_assets_test.Test.php on lines 924..931

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

                                      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