Showing 4,217 of 4,217 total issues

Method create_models has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create_models()
    {
try {
        $this->assertFalse(class_exists('bears'));
        $this->assertFalse(class_exists('fish'));
Severity: Major
Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 2 hrs to fix

    Method dd_table has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function dd_table($replace = [], $field_types = [], $extra = [])
        {
            $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
            if (DEBUG_MODE) {
                $ts = microtime(true);
    Severity: Minor
    Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

      Method user_var_push has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function user_var_push($FORCE_ID = false)
          {
              $_GET['id'] = (int) ($FORCE_ID ? $FORCE_ID : $_GET['id']);
              $A = db()->query_fetch('SELECT * FROM ' . db('locale_user_tr') . ' WHERE id=' . (int) ($_GET['id']));
              if ( ! $A) {

        Method edit_item has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function edit_item()
            {
                $item_info = db()->query_fetch('SELECT * FROM ' . db('menu_items') . ' WHERE id=' . (int) ($_GET['id']));
                if (empty($item_info['id'])) {
                    return _e('No such menu item!');
        Severity: Minor
        Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 2 hrs to fix

          Method _do_login_with_encrypted has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _do_login_with_encrypted()
              {
                  header('X-Robots-Tag: noindex,nofollow,noarchive,nosnippet');
                  if ( ! $_GET['id'] || strlen($_GET['id']) < 16 || is_numeric($_GET['id'])) {
                      $this->_encrypted_error = 'GET_id is not like an encrypted string';
          Severity: Minor
          Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 2 hrs to fix

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

                public function send(array $params = [], &$error_message = '')
                {
                    require_php_lib('mandrill');
            
                    try {
            Severity: Minor
            Found in plugins/email/classes/mail/yf_mail_driver_mandrill.class.php - About 2 hrs to fix

              Method _check has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _check($input = [], $user_info = [])
                  {
                      // Default banned status
                      $BANNED_STATUS = false;
                      // Nothing to check
              Severity: Minor
              Found in plugins/common/classes/common/yf_user_ban.class.php - About 2 hrs to fix

                Method show_orders has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function show_orders()
                    {
                        if ($this->SUPPLIER_ID) {
                            $sql = 'SELECT o.*, COUNT(*) AS num_items
                                    FROM ' . db('shop_orders') . ' AS o

                  Method orders has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function orders()
                      {
                          if ( ! main()->USER_ID) {
                              if (main()->is_post()) {
                                  module('shop')->order_validate_data();
                  Severity: Minor
                  Found in plugins/shop/modules/shop/yf_shop_orders.class.php - About 2 hrs to fix

                    Method drag_items has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function drag_items()
                        {
                            $cat_info = db()->get('SELECT * FROM ' . db('categories') . ' WHERE name="' . db()->es($_GET['id']) . '" OR id=' . (int) ($_GET['id']));
                            if ( ! $cat_info) {
                                return _e('No such category');
                    Severity: Minor
                    Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 2 hrs to fix

                      Method show_image has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function show_image($no_header = false, $no_exit = false)
                          {
                              if (function_exists('main')) {
                                  main()->NO_GRAPHICS = true;
                              }
                      Severity: Minor
                      Found in plugins/content/classes/yf_captcha.class.php - About 2 hrs to fix

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

                            public function show()
                            {
                                $id = preg_replace('~[^a-z0-9_-]+~ims', '', $_GET['id']);
                                $method = preg_replace('~[^a-z0-9_-]+~ims', '', $_GET['page']);
                                if (strlen($id)) {
                        Severity: Minor
                        Found in .dev/samples/classes/sample_form.class.php - About 2 hrs to fix

                          Method test_update has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function test_update()
                              {
                                  if ($this->_need_skip_test(__FUNCTION__)) {
                                      return;
                                  }

                            Method test_many_to_many has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Method test_php_to_sql_db_installer has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Method test_recusrion3 has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function test_recusrion3()
                                    {
                                        $jquery_url = _class('assets')->get_asset('jquery', 'js');
                                        $url = $jquery_url;
                                        $url1 = $url . '?v=1';
                                Severity: Minor
                                Found in .dev/tests/unit/class_assets_test.Test.php - About 2 hrs to fix

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

                                      public function _url($options, $is_server = false)
                                      {
                                          if ( ! $this->ENABLE) {
                                              return  null;
                                          }
                                  plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php on lines 712..725
                                  plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 931..944
                                  plugins/payment/classes/yf_payment_api__provider_webmoney.class.php on lines 734..747
                                  plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php on lines 372..385

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

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

                                      public function _url($options, $is_server = false)
                                      {
                                          if ( ! $this->ENABLE) {
                                              return  null;
                                          }
                                  plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php on lines 712..725
                                  plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 931..944
                                  plugins/payment/classes/yf_payment_api__provider_perfectmoney.class.php on lines 304..317
                                  plugins/payment/classes/yf_payment_api__provider_webmoney.class.php on lines 734..747

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

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

                                      public function _url($options, $is_server = false)
                                      {
                                          if ( ! $this->ENABLE) {
                                              return  null;
                                          }
                                  plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php on lines 712..725
                                  plugins/payment/classes/yf_payment_api__provider_perfectmoney.class.php on lines 304..317
                                  plugins/payment/classes/yf_payment_api__provider_webmoney.class.php on lines 734..747
                                  plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php on lines 372..385

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

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

                                      public function display($params = [])
                                      {
                                          if (is_string($params)) {
                                              $name = $params;
                                          }
                                  plugins/common/classes/common/yf_dashboards.class.php on lines 59..75
                                  plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 302..318

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

                                  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