Showing 4,217 of 4,217 total issues

Method test_basic has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function test_basic()
    {
        $table = table();
        $this->assertEquals('<div class="alert alert-info">No records</div>', trim($table));

Severity: Minor
Found in .dev/tests/unit/class_table_test.Test.php - About 1 hr to fix

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

        public function test_where_exists()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php on lines 1640..1650

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

    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_union()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php on lines 1592..1602

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

    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_union_all()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php on lines 1581..1591

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

    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_where_not_exists()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php on lines 1629..1639

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

    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 time_box($name = '', $values = [], $extra = [], $replace = [])
        {
            if (is_array($name)) {
                $extra = (array) $extra + $name;
                $name = '';
    Severity: Major
    Found in plugins/form2/classes/yf_form2.class.php and 1 other location - About 1 hr to fix
    plugins/form2/classes/yf_form2.class.php on lines 2686..2699

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

    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 date_box($name = '', $values = [], $extra = [], $replace = [])
        {
            if (is_array($name)) {
                $extra = (array) $extra + $name;
                $name = '';
    Severity: Major
    Found in plugins/form2/classes/yf_form2.class.php and 1 other location - About 1 hr to fix
    plugins/form2/classes/yf_form2.class.php on lines 2707..2720

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

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

        public function li_tree($data = [], $extra = [])
        {
            $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
            if ($data) {
                $data = $this->_parent->_recursive_sort_items($data);
    Severity: Minor
    Found in plugins/html/classes/html/yf_html_tree.class.php - About 1 hr to fix

      Function payout has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              payout: function( options ) {
                  var $this = this;
                  $scope.block_wait     = true;
                  $scope.is_submitted   = true;
                  $scope.status         = false;
      Severity: Minor
      Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 1 hr to fix

        Method _render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _render($result)
            {
                $asset_class = _class('assets');
                $asset_class->clean_all();
                $asset_class->ADD_IS_DIRECT_OUT = true;
        Severity: Minor
        Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

          Method submit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function submit($name = '', $value = '', $extra = [], $replace = [])
              {
                  if (is_array($name)) {
                      $extra = (array) $extra + $name;
                      $name = '';
          Severity: Minor
          Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

            Method active_box has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function active_box($name = '', $desc = '', $extra = [], $replace = [])
                {
                    if (is_array($name)) {
                        $extra += $name;
                        $desc = '';
            Severity: Minor
            Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

              Method _compile_prepare_cond has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _compile_prepare_cond($cond = '', $for_right = false)
                  {
                      $cond = trim($cond);
                      $_array_magick = [
                          '_key' => '$_k',
              Severity: Minor
              Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 1 hr to fix

                Method process has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function process($options = null, $initialize = true, $error_messages = null)
                    {
                        $this->options = [
                            'upload_dir' => INCLUDE_PATH . 'uploads/' . $_GET['object'] . '/',
                            'upload_url' => WEB_PATH . 'uploads/' . $_GET['object'] . '/',
                Severity: Minor
                Found in plugins/form2/classes/form2/yf_form2_file_handler.class.php - About 1 hr to fix

                  Method shell_exec has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function shell_exec($server_info = [], $cmd = '')
                      {
                          if ( ! $this->_INIT_OK || ! $cmd || ! $server_info) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/ssh/classes/yf_ssh.class.php - About 1 hr to fix

                    Method _order_step_start has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _order_step_start($FORCE_DISPLAY_FORM = false)
                        {
                            module('shop')->_basket_save();
                    
                            $basket_contents = module('shop')->_basket_api()->get_all();
                    Severity: Minor
                    Found in plugins/shop/modules/shop/yf_shop__order_step_start.class.php - About 1 hr to fix

                      Method _attributes_save has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _attributes_save($object_id = 0)
                          {
                              if (empty($object_id)) {
                                  return;
                              }

                        Method novaposhta_ua__import has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function novaposhta_ua__import()
                            {
                                // get data
                                // *** local
                                // $file = '/tmp/JsonWarehouseList.json';

                          Method xss_clean has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function xss_clean($str, $is_image = false)
                              {
                                  // Is the string an array?
                                  if (is_array($str)) {
                                      while (list($key) = each($str)) {
                          Severity: Minor
                          Found in classes/yf_security.class.php - About 1 hr to fix

                            Method _find_site has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _find_site($sites_dir = '')
                                {
                                    $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                                    if ( ! $sites_dir) {
                                        $try_paths = [
                            Severity: Minor
                            Found in classes/yf_main.class.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language