Showing 4,217 of 4,217 total issues

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

    public function go()
    {
        if ($this->DEBUG_CONSOLE_HIDDEN) {
            return false;
        }
Severity: Major
Found in classes/yf_debug.class.php - About 2 hrs to fix

    Method test_rewrite_replace_links has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function test_rewrite_replace_links()
        {
            $GLOBALS['PROJECT_CONF']['tpl']['REWRITE_MODE'] = true;
            $host = self::$host;
    
    
    Severity: Major
    Found in .dev/tests/rewrite/class_rewrite_testing_shared.php - About 2 hrs to fix

      File advertising.sql_php.php has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      return [
          'fields' => [
              'id' => [
      Severity: Minor
      Found in plugins/sys/share/db/sql_php/advertising.sql_php.php - About 2 hrs to fix

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

            public function get($name, $ttl = 0, $params = [])
            {
                if ( ! $this->is_ready()) {
                    return null;
                }
        Severity: Major
        Found in plugins/cache/classes/cache/yf_cache_driver_apc.class.php and 1 other location - About 2 hrs to fix
        plugins/cache/classes/cache/yf_cache_driver_xcache.class.php on lines 38..54

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

        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($name, $ttl = 0, $params = [])
            {
                if ( ! $this->is_ready()) {
                    return null;
                }
        Severity: Major
        Found in plugins/cache/classes/cache/yf_cache_driver_xcache.class.php and 1 other location - About 2 hrs to fix
        plugins/cache/classes/cache/yf_cache_driver_apc.class.php on lines 31..47

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

        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

            public function test_input_text_attr_data()
            {
                $this->assertEquals('<input name="name" type="text" id="name" class="form-control" placeholder="Name" data-something="5">', trim(self::form_no_chain($r)->text('name', ['data-something' => '5'])));
                $this->assertEquals('<input name="name" type="text" id="name" class="form-control" placeholder="Name" data-a1="a11" data-b1="b11">', trim(self::form_no_chain($r)->text('name', ['data-a1' => 'a11', 'data-b1' => 'b11'])));
                $this->assertEquals('<input name="name" type="text" id="name" class="form-control" placeholder="Name" data-test-escape="!@#$%^&*(&quot;&apos;&lt;&gt;?&gt;&lt;:;">', trim(self::form_no_chain($r)->text('name', ['data-test-escape' => '!@#$%^&*("\'<>?><:;'])));
        Severity: Major
        Found in .dev/tests/unit/class_form_test.Test.php and 1 other location - About 2 hrs to fix
        .dev/tests/unit/class_form_test.Test.php on lines 139..144

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

        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

            protected function _field_to_sql__category_name($field, $value, $action = null)
            {
                $cache = &$this->cache;
                $result = null;
                $name = $cache['category']['name'][mb_strtolower($value, 'UTF-8')];
        plugins/shop/admin_modules/manage_shop/yf_manage_shop_import_products2.class.php on lines 1364..1376

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

        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

            protected function _field_to_sql__supplier_name($field, $value, $action = null)
            {
                $cache = &$this->cache;
                $result = null;
                $name = $cache['supplier']['name'][mb_strtolower($value, 'UTF-8')];
        plugins/shop/admin_modules/manage_shop/yf_manage_shop_import_products2.class.php on lines 1350..1362

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

        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

            public function test_input_text_attr_ng()
            {
                $this->assertEquals('<input name="name" type="text" id="name" class="form-control" placeholder="Name" ng-something="5">', trim(self::form_no_chain($r)->text('name', ['ng-something' => '5'])));
                $this->assertEquals('<input name="name" type="text" id="name" class="form-control" placeholder="Name" ng-a1="a11" ng-b1="b11">', trim(self::form_no_chain($r)->text('name', ['ng-a1' => 'a11', 'ng-b1' => 'b11'])));
                $this->assertEquals('<input name="name" type="text" id="name" class="form-control" placeholder="Name" ng-test-escape="!@#$%^&*(&quot;&apos;&lt;&gt;?&gt;&lt;:;">', trim(self::form_no_chain($r)->text('name', ['ng-test-escape' => '!@#$%^&*("\'<>?><:;'])));
        Severity: Major
        Found in .dev/tests/unit/class_form_test.Test.php and 1 other location - About 2 hrs to fix
        .dev/tests/unit/class_form_test.Test.php on lines 133..138

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

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

            public function _on_validate_ok($params = [], $form = null)
            {
                $p = $params ?: $_POST;
        
                // TODO: named cleanups and separate stats by them

          Method _add_panel has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _add_panel($options)
              {
                  static $count = 1;
                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  // action
          Severity: Major
          Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

            Method join has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function join($table, $on, $join_type = '', $is_select = false)
                {
                    $join_types = [
                        'left',
                        'right',
            Severity: Major
            Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 hrs to fix

              Method remote_file_size has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function remote_file_size($url = '')
                  {
                      $url = $this->_fix_url($url);
                      $tmp = @parse_url($url);
                      $sch = $tmp['scheme'];
              Severity: Major
              Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 hrs to fix

                Method num2str has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function num2str($float, $currency_id = null, $lang_id = null, $set = false)
                    {
                        $lang_id = $this->lang_id($lang_id, $set);
                        $currency_id = $this->currency_id($currency_id, $set);
                        $words = &$this->words[$lang_id];
                Severity: Major
                Found in plugins/common/classes/common/yf_common_num2string.class.php - About 2 hrs to fix

                  Method novaposhta_ua__import_old has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function novaposhta_ua__import_old()
                      {
                          // get data
                          // $file = '/tmp/warenhouses_ru.xls';
                          // $content = file_get_contents( $file );

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

                        public function edit()
                        {
                            $a = $this->_get_info();
                            if ( ! $a) {
                                return _404();
                    Severity: Major
                    Found in plugins/content/admin_modules/yf_manage_news.class.php - About 2 hrs to fix

                      Method test_decrement has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method test_increment has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

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

                              public function test_complex()
                              {
                                  $this->assertEquals('', common()->_get_error_messages());
                          
                                  $old = $_SERVER['REQUEST_METHOD'];
                          Severity: Major
                          Found in .dev/tests/unit/class_form_validate_test.Test.php - About 2 hrs to fix

                            yf_user_profile has 23 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class yf_user_profile extends yf_module
                            {
                                /** @var int */
                                public $MAX_SHOW_ADS = 10;
                                /** @var int */
                            Severity: Minor
                            Found in plugins/user/modules/yf_user_profile.class.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language