Showing 4,217 of 4,217 total issues

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

    public function _external_response()
    {
        $operation_id = $_GET['operation_id'];
        $secret = $_GET['secret'];
        $payment_api = $this->payment_api;
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_bitcoin.class.php - About 3 hrs to fix

    Method _rewrite_replace_links has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _rewrite_replace_links($body = '', $standalone = false, $force_rewrite = false, $for_site_id = false)
        {
            if (MAIN_TYPE_ADMIN && ! $force_rewrite) {
                return $body;
            }
    Severity: Major
    Found in plugins/rewrite/classes/yf_rewrite.class.php - About 3 hrs to fix

      Method _search_autocomplete has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _search_autocomplete($options = [])
          {
              main()->NO_GRAPHICS = true;
              // prepare options
              $_ = &$options;

        Method show_metatags has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function show_metatags($meta = [])
            {
                if (empty($meta)) {
                    $meta = $this->META_DEFAULT;
                }
        Severity: Major
        Found in classes/yf_graphics.class.php - About 3 hrs to fix

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

              if (_basic_auth_check($debug_users) || ! empty($_COOKIE[$cookie_name])) {
                  $h = array_reverse(explode('.', $_SERVER['HTTP_HOST']));
                  setcookie($cookie_name, '1', 0, '/', $h[1] . '.' . $h[0]); // Live for session, set for TLD
                  define('DEBUG_MODE', 1);
              } else {
          Severity: Major
          Found in functions/yf_basic_auth.php and 1 other location - About 3 hrs to fix
          functions/yf_debug.php on lines 33..43

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

          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

                  if ( ! strlen($extra['value'])) {
                      if (isset($extra['selected'])) {
                          $value = $extra['selected'];
                      } elseif (isset($form->_params['selected'])) {
                          $value = $form->_params['selected'][$extra['name']];
          Severity: Major
          Found in plugins/form2/classes/form2/yf_form2_datetime.class.php and 1 other location - About 3 hrs to fix
          plugins/form2/classes/form2/yf_form2_daterange.class.php on lines 35..44

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

          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

                  if ( ! strlen($extra['value'])) {
                      if (isset($extra['selected'])) {
                          $value = $extra['selected'];
                      } elseif (isset($form->_params['selected'])) {
                          $value = $form->_params['selected'][$extra['name']];
          Severity: Major
          Found in plugins/form2/classes/form2/yf_form2_daterange.class.php and 1 other location - About 3 hrs to fix
          plugins/form2/classes/form2/yf_form2_datetime.class.php on lines 48..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 143.

          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

              if (_debug_auth_check($debug_users) || ! empty($_COOKIE[$cookie_name])) {
                  $h = array_reverse(explode('.', $_SERVER['HTTP_HOST']));
                  setcookie($cookie_name, '1', 0, '/', $h[1] . '.' . $h[0]); // Live for session, set for TLD
                  define('DEBUG_MODE', 1);
              } else {
          Severity: Major
          Found in functions/yf_debug.php and 1 other location - About 3 hrs to fix
          functions/yf_basic_auth.php on lines 20..30

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

          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

                  if ($this->STORE_ADMIN_AUTH) {
                      db()->INSERT('log_admin_auth', [
                          'admin_id' => (int) ($A['id']),
                          'login' => _es($A['login']),
                          'group' => (int) ($A['group']),
          Severity: Major
          Found in plugins/logs/classes/yf_logs.class.php and 1 other location - About 3 hrs to fix
          plugins/logs/classes/yf_logs.class.php on lines 85..97

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

          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

                  if ($this->STORE_USER_AUTH) {
                      db()->INSERT('log_auth', [
                          'user_id' => (int) ($A['id']),
                          'login' => _es($A['login']),
                          'group' => (int) ($A['group']),
          Severity: Major
          Found in plugins/logs/classes/yf_logs.class.php and 1 other location - About 3 hrs to fix
          plugins/logs/classes/yf_logs.class.php on lines 141..153

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

          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 yf_other_common.class.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Other common methods container.
           *
          Severity: Minor
          Found in plugins/common/classes/common/yf_other_common.class.php - About 3 hrs to fix

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

            <?php
            
            /**
             * Common used pager module.
             *
            Severity: Minor
            Found in plugins/common/classes/common/yf_divide_pages.class.php - About 3 hrs to fix

              Method user_vars has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function user_vars()
                  {
                      if (isset($_GET['id']) && ! isset($_GET['page'])) {
                          $_GET['page'] = $_GET['id'];
                          $_GET['id'] = null;

                Method init has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function init()
                    {
                        // Chanined config rule
                        if ($this->BLOCK_FAILED_LOGINS) {
                            $this->LOG_FAILED_LOGINS = true;
                Severity: Major
                Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 3 hrs to fix

                  Method _do_login has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _do_login($params = [])
                      {
                          $AUTH_LOGIN = trim($params['login']);
                          $AUTH_PSWD = trim($params['pswd']);
                  
                  
                  Severity: Major
                  Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 3 hrs to fix

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

                        public function show()
                        {
                            $this->refresh_modules_list($silent = true);
                    
                            if (main()->is_post()) {
                    Severity: Major
                    Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 3 hrs to fix

                      Method compile_insert has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function compile_insert($table, $data, $params = [])
                          {
                              if ( ! strlen($table) || ! is_array($data)) {
                                  return false;
                              }
                      Severity: Major
                      Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 3 hrs to fix

                        Method test_query_models has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function test_query_models()
                            {
                                if ($this->_need_skip_test(__FUNCTION__)) {
                                    return;
                                }
                        Severity: Major
                        Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 3 hrs to fix

                          Method test_cleanup_split_trim has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function test_cleanup_split_trim()
                              {
                                  $rules_raw = [
                                      'test1,test2,test3' => 'min_length:2|max_length:12|is_unique:user.login|between:1,10|chars:a,b,c,d|regex:[a-z0-9]+',
                                  ];
                          Severity: Major
                          Found in .dev/tests/unit/class_validate_test.Test.php - About 3 hrs to fix

                            Method test_where_basic has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function test_where_basic()
                                {
                                    if ($this->_need_skip_test(__FUNCTION__)) {
                                        return;
                                    }
                            Severity: Major
                            Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language