Showing 4,217 of 4,217 total issues

Method add_item has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function add_item()
    {
        $cat_info = db()->query_fetch('SELECT * FROM ' . db('categories') . ' WHERE id=' . (int) ($_GET['id']));
        if (empty($cat_info['id'])) {
            return _e('No such category!');
Severity: Minor
Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 1 hr to fix

    Method add has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function add()
        {
            $a = $_POST;
            if ((int) ($_GET['receiver_id']) != 0) {
                $a['receiver_id'] = $_GET['receiver_id'];

      Method edit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function edit()
          {
              $ds = $this->_get_dashboard_data($_GET['id']);
              if ( ! $ds['id']) {
                  return _e('No such record');
      Severity: Minor
      Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 1 hr to fix

        Method quick_menu has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function quick_menu()
            {
                if ( ! $this->QUICK_MENU_ENABLED
                    || (MAIN_TYPE_USER && ( ! isset($_SESSION['user_id']) || ! $_SESSION['user_id']))
                    || (MAIN_TYPE_ADMIN && ( ! isset($_SESSION['admin_id']) || ! $_SESSION['admin_id']))
        Severity: Minor
        Found in classes/yf_graphics.class.php - About 1 hr to fix

          Method _preload_plugins_list has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _preload_plugins_list($force = false)
              {
                  $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                  if (isset($this->_plugins) && ! $force) {
                      return $this->_plugins;
          Severity: Minor
          Found in classes/yf_main.class.php - About 1 hr to fix

            Method test_basic_queries_and_fetching has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function test_basic_queries_and_fetching()
                {
                    if ($this->_need_skip_test(__FUNCTION__)) {
                        return;
                    }
            Severity: Minor
            Found in .dev/tests/functional/db/class_db_real_mysql_test.Test.php - About 1 hr to fix

              Method test_table_info has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function test_table_info()
                  {
                      if ($this->_need_skip_test(__FUNCTION__)) {
                          return;
                      }
              Severity: Minor
              Found in .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php - About 1 hr to fix

                Method test_increment_decrement has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method test_dump has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

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

                            if (is_post()) {
                                foreach ((array) $keys_to_fix as $k) {
                                    if (false !== strpos($_POST[$k], '{') && false !== strpos($_POST[$k], '}')) {
                                        $_POST[$k] = str_replace(array_values($exec_fix), array_keys($exec_fix), $_POST[$k]);
                                    }
                    Severity: Major
                    Found in plugins/content/admin_modules/yf_manage_news.class.php and 2 other locations - About 1 hr to fix
                    plugins/content/admin_modules/yf_manage_faq.class.php on lines 167..173
                    plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 103..109

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

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

                    <?php
                    
                    require_once __DIR__ . '/class_db_real_pgsql_test.Test.php';
                    
                    /**
                    Severity: Major
                    Found in .dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php and 6 other locations - About 1 hr to fix
                    .dev/tests/functional/db/class_db_real_installer_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_installer_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pgsql.TODO.php on lines 1..22

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

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

                            $result = table($_sql, [
                                    'filter' => $_filter,
                                    'filter_params' => [
                                        'operation_id' => 'in',
                                        'title' => 'like',
                    Severity: Major
                    Found in plugins/payment/admin_modules/yf_manage_payment.class.php and 6 other locations - About 1 hr to fix
                    plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..413
                    plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 325..419
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..515
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 1127..1142
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 281..355
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 619..654

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

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

                            $result = table($sql, [
                                    'filter' => $filter,
                                    'filter_params' => [
                                        'status_id' => function ($a) use ($payment_status_in_progress_id) {
                                            $result = null;
                    plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..413
                    plugins/payment/admin_modules/yf_manage_payment.class.php on lines 332..373
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..515
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 1127..1142
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 281..355
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 619..654

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

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

                    <?php
                    
                    require_once __DIR__ . '/class_db_real_installer_mysql_test.Test.php';
                    
                    /**
                    .dev/tests/functional/db/class_db_real_installer_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pgsql.TODO.php on lines 1..22

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

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

                                $content && $html_operations_by_method = table($content, ['no_total' => true])
                                    ->text('operation_id', 'операция')
                                    ->text('account_number', 'счет, номер карты, кошелек')
                                    ->func('amount', function ($value, $extra, $row) use ($payment_api) {
                                        $result = $payment_api->money_html($value);
                    Severity: Major
                    Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 6 other locations - About 1 hr to fix
                    plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..413
                    plugins/payment/admin_modules/yf_manage_payment.class.php on lines 332..373
                    plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 325..419
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..515
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 281..355
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 619..654

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

                    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

                            if (is_post()) {
                                foreach ((array) $keys_to_fix as $k) {
                                    if (false !== strpos($_POST[$k], '{') && false !== strpos($_POST[$k], '}')) {
                                        $_POST[$k] = str_replace(array_values($exec_fix), array_keys($exec_fix), $_POST[$k]);
                                    }
                    Severity: Major
                    Found in plugins/content/admin_modules/yf_manage_faq.class.php and 2 other locations - About 1 hr to fix
                    plugins/content/admin_modules/yf_manage_news.class.php on lines 73..79
                    plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 103..109

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

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

                            return  table($sql, [
                                    'filter' => $filter,
                                    'filter_params' => [
                                        'status_id' => function ($a) use ($payment_status_in_progress_id) {
                                            $result = null;
                    Severity: Major
                    Found in plugins/payment/admin_modules/yf_manage_transfer.class.php and 6 other locations - About 1 hr to fix
                    plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..413
                    plugins/payment/admin_modules/yf_manage_payment.class.php on lines 332..373
                    plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 325..419
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..515
                    plugins/payment/admin_modules/yf_manage_payout.class.php on lines 1127..1142
                    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 619..654

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

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

                    <?php
                    
                    require_once __DIR__ . '/class_db_real_query_builder_mysql_test.Test.php';
                    
                    /**
                    .dev/tests/functional/db/class_db_real_installer_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_installer_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_pgsql.TODO.php on lines 1..25

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

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

                    <?php
                    
                    require_once __DIR__ . '/class_db_real_mysql_test.Test.php';
                    
                    /**
                    .dev/tests/functional/db/class_db_real_installer_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_installer_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_mysql_test.Test.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pdo_pgsql.TODO.php on lines 1..25
                    .dev/tests/functional/db/class_db_real_query_builder_pgsql.TODO.php on lines 1..22

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

                    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

                                    $sql_array = [
                                        'code' => $this->_cleanup_code($_POST['code']),
                                        'user_id' => (int) ($_POST['user_id']),
                                        'sum' => (int) ($_POST['sum']),
                                        'status' => (int) ($_POST['status']),
                    plugins/shop/admin_modules/manage_shop/yf_manage_shop_coupons.class.php on lines 118..127

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

                    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