Showing 4,217 of 4,217 total issues

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

if ( ! function_exists('_var_export')) {
    function _var_export($data)
    {
        $str = var_export($data, 1);
        $str = str_replace('  ', "\t", $str);
Severity: Major
Found in functions/yf_common_funcs.php and 1 other location - About 3 hrs to fix
.dev/scripts/countries/get_latest_countries.php on lines 24..35

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

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 (!function_exists('_var_export')) {
    function _var_export($data)
    {
        $str = var_export($data, 1);
        $str = str_replace('  ', "\t", $str);
Severity: Major
Found in .dev/scripts/countries/get_latest_countries.php and 1 other location - About 3 hrs to fix
functions/yf_common_funcs.php on lines 568..579

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

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

<?php


load('db_utils_driver', '', 'classes/db/');
class yf_db_utils_pgsql extends yf_db_utils_driver
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_pgsql.class.php - About 3 hrs to fix

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

    <?php
    
    /**
     * RSS data handler.
     *
    Severity: Minor
    Found in plugins/common/classes/common/yf_rss_data.class.php - About 3 hrs to fix

      File class_db_ddl_parser_mysql_test_tbl_film.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      return [
          'name' => 'film',
          'fields' => [
              'film_id' => [

        Method _get_all_content_for_out has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _get_all_content_for_out($out_type, $params = [])
            {
                $is_ajax = main()->is_ajax();
                // Move down inlined content
                $all_content = $this->get_content($out_type);
        Severity: Major
        Found in plugins/assets/classes/yf_assets.class.php - About 3 hrs to fix

          Method _css_urls_rewrite_and_save has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _css_urls_rewrite_and_save($content, $content_url, $cache_path, $content_type = 'url', $orig_content = '')
              {
                  $_this = $this;
                  $self_func = __FUNCTION__;
                  return preg_replace_callback('~url\([\'"\s]*(?P<url>[^\'"\)]+?)[\'"\s]*\)~ims', function ($m) use ($_this, $content_url, $cache_path, $content_type, $orig_content, $self_func) {
          Severity: Major
          Found in plugins/assets/classes/yf_assets.class.php - About 3 hrs to fix

            yf_cache has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class yf_cache
            {
                /** @var int Cache entries time-to-live (in seconds) */
                public $TTL = 3600;
                /** @var string Cache driver to use */
            Severity: Minor
            Found in plugins/cache/classes/yf_cache.class.php - About 3 hrs to fix

              yf_ck_file_browser has 26 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class yf_ck_file_browser
              {
                  public $TOP_DIR = '/uploads/';
                  public $WRITABLE_DIR = '/uploads/ck_browser/';
                  public $ALLOWED_EXTS = [
              Severity: Minor
              Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 3 hrs to fix

                Method show has 75 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/user/admin_modules/yf_user_modules.class.php - About 3 hrs to fix

                  Method go has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function go()
                      {
                          if ( ! $this->LOGGING || MAIN_TYPE_USER) {
                              return false;
                          }
                  Severity: Major
                  Found in plugins/logs/classes/logs/yf_logs_exec_admin.class.php - About 3 hrs to fix

                    yf_category_editor has 26 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class yf_category_editor
                    {
                        /** @var int */
                        public $ITEMS_PER_PAGE = 100;
                        /** @var bool */
                    Severity: Minor
                    Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 3 hrs to fix

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

                              return form($a, [
                                  'dd_mode' => 1,
                              ])
                              ->link('item_id', './?object=' . $_GET['object'] . '&action=product_edit&id=' . $product_info['id'], [
                                  'desc' => 'Product',
                      plugins/shop/admin_modules/manage_shop/yf_manage_shop__product_revisions.class.php on lines 575..594

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

                      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

                      <?php
                      
                      return [
                        5 => [
                          'id' => '5',
                      .dev/install/installer_data/db_tables_uk/gallery_photos.data.php on lines 1..32

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

                      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

                      <?php
                      
                      return [
                        5 => [
                          'id' => '5',
                      .dev/install/installer_data/db_tables_ru/gallery_photos.data.php on lines 1..32

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

                      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 (main()->is_post()) {
                                  if ( ! _ee()) {
                                      db()->update('dashboards2', db()->es([
                                          'data' => json_encode($_POST['ds_data']),
                                      ]), 'id=' . (int) ($ds['id']));
                      plugins/dashboards/admin_modules/yf_manage_dashboards.class.php on lines 158..166

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

                      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 (main()->is_post()) {
                                  if ( ! _ee()) {
                                      db()->update('dashboards', db()->es([
                                          'data' => json_encode($_POST['ds_data']),
                                      ]), 'id=' . (int) ($ds['id']));
                      plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 216..224

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

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

                          public function get_data()
                          {
                              $relation = $this->_relation;
                              $model = $this->_model;
                              $db = $model->_db;
                      Severity: Major
                      Found in plugins/sys/classes/model/yf_model_relation.class.php - About 2 hrs to fix

                        Method phone_box has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Method _delete has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _delete($params = [])
                              {
                                  if (empty(main()->USER_ID) && MAIN_TYPE_USER) {
                                      return _error_need_login();
                                  }
                          Severity: Major
                          Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language