Showing 4,217 of 4,217 total issues

Method _api_Interkassa has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _api_Interkassa($title)
    {
        $php = '';
        $api = _class('payment_api__provider_interkassa');
        $methods = [
Severity: Major
Found in plugins/payment/modules/yf_payment_test.class.php - About 3 hrs to fix

    Method _external_response has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _external_response()
        {
            $ip = common()->get_ip();
            if ( ! in_array($ip, ['185.71.65.92', '185.71.65.189', '149.202.17.210'])) {
                $this->external_response_errors[] = 'Invalid sender IP address ' . $ip;
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api__provider_payeer.class.php - About 3 hrs to fix

      Method split_url has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function split_url($url, $decode = false)
          {
              // Character sets from RFC3986.
              $xunressub = 'a-zA-Z\d\-._~\!$&\'()\[\]*+,;=\|';
              $xpchar = $xunressub . ':@%';
      Severity: Major
      Found in plugins/common/classes/common/yf_url_to_absolute.class.php - About 3 hrs to fix

        Method product_details has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function product_details()
            {
                if ( ! $_GET['id']) {
                    return is_redirect('./?object=shop');
                }
        Severity: Major
        Found in plugins/shop/modules/shop/yf_shop_product_details.class.php - About 3 hrs to fix

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

                  if ($this->SESSION_LOCK_TO_UA && ! empty($_SESSION[$this->VAR_ADMIN_ID]) && $_GET['task'] !== 'logout') {
                      // User has changed User Agent, logout immediately
                      $ua = $_SERVER['HTTP_USER_AGENT'];
                      if ( ! isset($_SESSION[$this->VAR_LOCK_UA]) || $_SESSION[$this->VAR_LOCK_UA] !== $ua) {
                          trigger_error('AUTH: Attempt to use session with changed User Agent blocked, auth_ua:"' . $_SESSION[$this->VAR_LOCK_UA] . '", new_ua:"' . $ua . '", admin_id: ' . (int) ($_SESSION[$this->VAR_ADMIN_ID]), E_USER_WARNING);
          Severity: Major
          Found in plugins/auth/classes/auth/yf_auth_admin.class.php and 3 other locations - About 3 hrs to fix
          plugins/auth/classes/auth/yf_auth_admin.class.php on lines 118..128
          plugins/auth/classes/auth/yf_auth_user.class.php on lines 187..195
          plugins/auth/classes/auth/yf_auth_user.class.php on lines 197..205

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

          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

                  if ($this->SESSION_LOCK_TO_HOST && ! empty($_SESSION[$this->VAR_USER_ID]) && $_GET['task'] !== 'logout') {
                      // User has changed Host, logout immediately
                      $host = $_SERVER['HTTP_HOST'];
                      if ( ! isset($_SESSION[$this->VAR_LOCK_HOST]) || $_SESSION[$this->VAR_LOCK_HOST] !== $host) {
                          trigger_error('AUTH: Attempt to use session with changed Host blocked, auth_host:"' . $_SESSION[$this->VAR_LOCK_HOST] . '", new_host:"' . $ua . '", user_id: ' . (int) ($_SESSION[$this->VAR_USER_ID]), E_USER_WARNING);
          Severity: Major
          Found in plugins/auth/classes/auth/yf_auth_user.class.php and 3 other locations - About 3 hrs to fix
          plugins/auth/classes/auth/yf_auth_admin.class.php on lines 106..116
          plugins/auth/classes/auth/yf_auth_admin.class.php on lines 118..128
          plugins/auth/classes/auth/yf_auth_user.class.php on lines 187..195

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

          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

                  if ($this->SESSION_LOCK_TO_HOST && ! empty($_SESSION[$this->VAR_ADMIN_ID]) && $_GET['task'] !== 'logout') {
                      // User has changed Host, logout immediately
                      $host = $_SERVER['HTTP_HOST'];
                      if ( ! isset($_SESSION[$this->VAR_LOCK_HOST]) || $_SESSION[$this->VAR_LOCK_HOST] !== $host) {
                          trigger_error('AUTH: Attempt to use session with changed Host blocked, auth_host:"' . $_SESSION[$this->VAR_LOCK_HOST] . '", new_host:"' . $ua . '", admin_id: ' . (int) ($_SESSION[$this->VAR_ADMIN_ID]), E_USER_WARNING);
          Severity: Major
          Found in plugins/auth/classes/auth/yf_auth_admin.class.php and 3 other locations - About 3 hrs to fix
          plugins/auth/classes/auth/yf_auth_admin.class.php on lines 106..116
          plugins/auth/classes/auth/yf_auth_user.class.php on lines 187..195
          plugins/auth/classes/auth/yf_auth_user.class.php on lines 197..205

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

          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

              public function test_disconnect_connect()
              {
                  if ($this->_need_skip_test(__FUNCTION__)) {
                      return;
                  }
          Severity: Major
          Found in .dev/tests/functional/db/class_db_real_mysql_test.Test.php and 1 other location - About 3 hrs to fix
          .dev/tests/functional/db/class_db_real_pgsql.TODO.php on lines 36..50

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

          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

              public function test_disconnect_connect()
              {
                  if ($this->_need_skip_test(__FUNCTION__)) {
                      return;
                  }
          Severity: Major
          Found in .dev/tests/functional/db/class_db_real_pgsql.TODO.php and 1 other location - About 3 hrs to fix
          .dev/tests/functional/db/class_db_real_mysql_test.Test.php on lines 35..49

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

          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

                  if ($this->SESSION_LOCK_TO_UA && ! empty($_SESSION[$this->VAR_USER_ID]) && $_GET['task'] !== 'logout') {
                      // User has changed User Agent, logout immediately
                      $ua = $_SERVER['HTTP_USER_AGENT'];
                      if ( ! isset($_SESSION[$this->VAR_LOCK_UA]) || $_SESSION[$this->VAR_LOCK_UA] !== $ua) {
                          trigger_error('AUTH: Attempt to use session with changed User Agent blocked, auth_ua:"' . $_SESSION[$this->VAR_LOCK_UA] . '", new_ua:"' . $ua . '", user_id: ' . (int) ($_SESSION[$this->VAR_USER_ID]), E_USER_WARNING);
          Severity: Major
          Found in plugins/auth/classes/auth/yf_auth_user.class.php and 3 other locations - About 3 hrs to fix
          plugins/auth/classes/auth/yf_auth_admin.class.php on lines 106..116
          plugins/auth/classes/auth/yf_auth_admin.class.php on lines 118..128
          plugins/auth/classes/auth/yf_auth_user.class.php on lines 197..205

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

          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 forum_posts.data.php has 305 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          return [
            22 => [
              'id' => '22',
          Severity: Minor
          Found in .dev/install/installer_data/db_tables_ru/forum_posts.data.php - About 3 hrs to fix

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

            class sphinx_config_variable
            {
                public $name;
                public $value;
                public $comment;
            Severity: Major
            Found in plugins/search/admin_modules/yf_manage_sphinx.class.php and 1 other location - About 3 hrs to fix
            plugins/search/admin_modules/manage_sphinx/yf_manage_sphinx_config_variable.class.php on lines 7..57

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

            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

            class yf_manage_sphinx_config_variable
            {
                public $name;
                public $value;
                public $comment;
            plugins/search/admin_modules/yf_manage_sphinx.class.php on lines 1034..1084

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

            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_current_lang has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _get_current_lang($force = false)
                {
                    $langs = $this->LANGUAGES ?: $this->_get_langs();
            
                    $FORCE_LOCALE = conf('FORCE_LOCALE');
            Severity: Major
            Found in plugins/locale/classes/yf_i18n.class.php - About 3 hrs to fix

              Method _on_validate_ok has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _on_validate_ok($params = [], $form = null)
                  {
                      $p = $params ?: $_POST;
                      $lang = $p['lang_to'];
                      $lang_from = $p['lang_from'] ?: 'en';

                Method currency_rates_current has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function currency_rates_current()
                    {
                        $result = [];
                        $payment_api = _class('payment_api');
                        // conversion UNT to UAH
                Severity: Major
                Found in plugins/payment/modules/yf_payment_test.class.php - About 3 hrs to fix

                  Method auto has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function auto($table = '', $id = '', $params = [], $form)
                      {
                          if ($params['links_add']) {
                              $form->_params['links_add'] = $params['links_add'];
                          }
                  Severity: Major
                  Found in plugins/form2/classes/form2/yf_form2_auto.class.php - About 3 hrs to fix

                    Method image has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function image($name, $path, $link = '', $extra = [], $table)
                        {
                            if (is_array($path)) {
                                $extra = (array) $extra + $path;
                                $path = '';
                    Severity: Major
                    Found in plugins/table2/classes/table2/yf_table2_image.class.php - About 3 hrs to fix

                      Method render_type_blocks has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function render_type_blocks($params = [])
                          {
                              $total_records = $params['total_records'];
                              $per_page = $params['per_page'];
                              $requested_page = $params['requested_page'];
                      Severity: Major
                      Found in plugins/common/classes/common/yf_divide_pages.class.php - About 3 hrs to fix

                        Method ajax_validate has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function ajax_validate()
                            {
                                no_graphics(true);
                                header('X-Robots-Tag: noindex, nofollow, noarchive, nosnippet');
                        
                        
                        Severity: Major
                        Found in plugins/dynamic/modules/dynamic/yf_dynamic_validate.class.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language