Showing 4,217 of 4,217 total issues

Method __api_response__result has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __api_response__result($operation_id, $response)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 2 hrs to fix

    Method edit_stpl has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function edit_stpl()
        {
            $theme_name = $_GET['theme'];
            $stpl_name = $_GET['name'];
            if ( ! validate([$theme_name, $stpl_name], 'trim|required')) {
    Severity: Major
    Found in plugins/tpl/admin_modules/yf_template_editor.class.php - About 2 hrs to fix

      Method form_begin has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function form_begin($name = '', $method = '', $extra = [], $replace = [])
          {
              if (is_array($name)) {
                  $extra = (array) $extra + $name;
                  $name = '';
      Severity: Major
      Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

        Method _validate_rules_process has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _validate_rules_process($validate_rules = [], &$data)
            {
                $validate_ok = true;
                foreach ((array) $validate_rules as $name => $rules) {
                    $is_required = false;
        Severity: Major
        Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

          Method postload has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function postload($params = [], $table)
              {
                  $attr_postload_url = $params['attr_postload_url'] ?: 'postload-url';
                  $tr_id_key = $params['tr_id_key'] ?: 'name';
          
          
          Severity: Major
          Found in plugins/table2/classes/table2/yf_table2_postload.class.php - About 2 hrs to fix

            Method get_shard_table_name has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get_shard_table_name($table_name, $db)
                {
                    $shard_table_name = '';
                    // Try sharding by year/month/day (example: db('currency_pairs_log_2013_07_01') from db('currency_pairs_log'))
                    if ( ! $shard_table_name && $this->SHARDING_BY_DAY) {
            Severity: Major
            Found in plugins/db/classes/db/yf_db_installer.class.php - About 2 hrs to fix

              Method url_to_absolute has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function url_to_absolute($baseUrl, $relativeUrl)
                  {
                      // Remove several frag parts from URL
                      if (substr_count($baseUrl, '#') > 1) {
                          $baseUrl = substr($baseUrl, 0, strpos($baseUrl, '#', strpos($baseUrl, '#') + 1));
              Severity: Major
              Found in plugins/common/classes/common/yf_url_to_absolute.class.php - About 2 hrs to fix

                Method manufacturer_edit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method attribute_edit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function attribute_edit()
                      {
                          if (empty($_GET['id'])) {
                              return _e('no id');
                          }

                    Method _get_git_details has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _get_git_details($FS_PATH, $as_submodule = false)
                        {
                            $git_base_path = $FS_PATH . '.git';
                            if ( ! file_exists($git_base_path)) {
                                return [];
                    Severity: Major
                    Found in classes/yf_debug.class.php - About 2 hrs to fix

                      Method _do_rewrite has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _do_rewrite()
                          {
                              $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                              if ($this->is_console() || MAIN_TYPE_ADMIN || ! module_conf('tpl', 'REWRITE_MODE')) {
                                  return false;
                      Severity: Major
                      Found in classes/yf_main.class.php - About 2 hrs to fix

                        Method substr has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function substr($text, $start, $length = null)
                            {
                                if ($this->MULTIBYTE == $this->UNICODE_MULTIBYTE) {
                                    return $length === null ? mb_substr($text, $start) : mb_substr($text, $start, $length);
                                }
                        Severity: Major
                        Found in classes/yf_utf8.class.php - About 2 hrs to fix

                          Method test_complex has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function test_complex()
                              {
                                  $per_page = 10;
                                  conf('per_page', $per_page);
                                  $this->assertEquals($per_page, conf('per_page'));
                          Severity: Major
                          Found in .dev/tests/unit/class_divide_pages_test.Test.php - About 2 hrs to fix

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

                                        var _value = ( $scope.action.payout &&
                                            $scope.action.payout.method &&
                                            $scope.action.payout.method.amount &&
                                            $scope.action.payout.method.amount.max
                                        ) || 0;
                            plugins/content/templates/user/js/ng/payment/balance-recharge.js on lines 106..110

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

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

                            function _do_compress_php_file($file_to_open = '', $file_to_save = '')
                            {
                                $source = file_get_contents($file_to_open);
                                // Removes comments
                                foreach ((array) token_get_all($source) as $token) {
                            Severity: Major
                            Found in .dev/useful/php_compressor.php - About 2 hrs to fix

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

                                          var _value = ( $scope.action.payout &&
                                              $scope.action.payout.method &&
                                              $scope.action.payout.method.amount &&
                                              $scope.action.payout.method.amount.min
                                          ) || 0;
                              plugins/content/templates/user/js/ng/payment/balance-recharge.js on lines 133..137

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

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

                              <?php
                              
                              return [
                                2 => [
                                  'id' => '2',
                              Severity: Minor
                              Found in .dev/install/installer_data/db_tables_en/articles_texts.data.php - About 2 hrs to fix

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

                                    public function _get_conf($name, $default = null, array $params = [])
                                    {
                                        if (isset($params[$name]) && $val = $params[$name]) {
                                            return $val;
                                        }
                                plugins/cache/classes/cache/yf_cache_driver_redis.class.php on lines 33..48

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

                                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

                                        foreach ((array) $values as $key => $cur_value) {
                                            $_what_compare = (string) ($type == 1 ? $cur_value : $key);
                                            $is_selected = $_what_compare == $selected;
                                            $val = ($translate ? t($cur_value) : $cur_value);
                                            $items[] = '<li class="dropdown' . ($is_selected ? ' active' : '') . '"><a data-value="' . $key . '"' . ($is_selected ? ' data-selected="selected"' : '') . '>' . $val . '</a></li>';
                                Severity: Major
                                Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                plugins/html/classes/yf_html.class.php on lines 1494..1502

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

                                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 _get_conf($name, $default = null, array $params = [])
                                    {
                                        if (isset($params[$name]) && $val = $params[$name]) {
                                            return $val;
                                        }
                                Severity: Major
                                Found in plugins/cache/classes/cache/yf_cache_driver_redis.class.php and 1 other location - About 2 hrs to fix
                                plugins/pubsub/classes/pubsub/yf_pubsub_driver_rabbitmq.class.php on lines 19..34

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

                                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