Showing 4,217 of 4,217 total issues

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

    public function test_complex_foreach2()
    {
        $data = [
            'test_array' => [
                'One' => ['name' => 'First'],
Severity: Major
Found in .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php and 1 other location - About 2 hrs to fix
.dev/tests/unit/tpl/tpl_driver_yf_foreach_test.Test.php on lines 74..88

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

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

            $replace2 = [
                'num' => $_num,
                'tag_text' => $_text,
                'tag_search_url' => './?object=' . $params['object'] . '&action=' . $params['action'] . '&id=' . $params['id_prefix'] . ($params['amp_encode'] ? str_replace(urlencode('&'), urlencode(urlencode('&')), urlencode($_text)) : urlencode($_text)),
                'cloud_fsize' => $_cloud_fsize,
Severity: Major
Found in plugins/common/classes/common/yf_other_common.class.php and 1 other location - About 2 hrs to fix
plugins/common/classes/common/yf_common_tags_cloud.class.php on lines 50..55

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

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 (_class('encryption')->_avail_ciphers as $cipher) {
            $encrypted = _class('encryption')->_safe_encrypt_with_base64(self::$to_encode, self::$secret, $cipher);
            $this->assertRegexp('/^[a-z0-9\=+\*\|]+$/i', $encrypted);
            $this->assertNotEquals($prev_encrypted, $encrypted);
            $prev_encrypted = $encrypted;
Severity: Major
Found in .dev/tests/unit/class_encryption_test.php and 1 other location - About 2 hrs to fix
.dev/tests/unit/class_encryption_test.php on lines 173..181

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

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

            $replace2 = [
                'num' => $_num,
                'tag_text' => $_text,
                'tag_search_url' => './?object=' . $params['object'] . '&action=' . $params['action'] . '&id=' . $params['id_prefix'] . ($params['amp_encode'] ? str_replace(urlencode('&'), urlencode(urlencode('&')), urlencode($_text)) : urlencode($_text)),
                'cloud_fsize' => $_cloud_fsize,
Severity: Major
Found in plugins/common/classes/common/yf_common_tags_cloud.class.php and 1 other location - About 2 hrs to fix
plugins/common/classes/common/yf_other_common.class.php on lines 234..239

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

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 get_less_content($params = [])
    {
        if ( ! $this->ALLOW_CONTENT_LESS) {
            return [];
        }
Severity: Major
Found in plugins/assets/classes/yf_assets.class.php and 1 other location - About 2 hrs to fix
plugins/assets/classes/yf_assets.class.php on lines 1303..1320

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

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 button_allow_deny_box($name, $values = [], $selected = null)
    {
        $def_cls = $this->CLASS_LABEL_BTN_RADIO;
        $values = [
            ['class' => $def_cls . ' btn-warning', 'html' => '<i class="fa fa-ban"></i> ' . t('Deny') . '</span>'],
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 1046..1054

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

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 get_sass_content($params = [])
    {
        if ( ! $this->ALLOW_CONTENT_SASS) {
            return [];
        }
Severity: Major
Found in plugins/assets/classes/yf_assets.class.php and 1 other location - About 2 hrs to fix
plugins/assets/classes/yf_assets.class.php on lines 1326..1343

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

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 button_yes_no_box($name, $values = [], $selected = null)
    {
        $def_cls = $this->CLASS_LABEL_BTN_RADIO;
        $values = [
            ['class' => $def_cls . ' btn-warning', 'html' => '<i class="fa fa-ban"></i> ' . t('No') . '</span>'],
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 1061..1069

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

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

    protected function _api_PerfectMoney($title)
    {
        $php = '';
        $api = _class('payment_api__provider_perfectmoney');
        $methods = [
Severity: Major
Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

    Method _operation_table has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _operation_table($options = null)
        {
            // import options
            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
            // class
    Severity: Major
    Found in plugins/payment/admin_modules/yf_manage_payment.class.php - About 2 hrs to fix

      Method parse has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function parse($name, $replace = [], $params = [])
          {
              $name = strtolower(trim($name));
              // Support for the driver name in prefix, example: "twig:user/account", "smarty:user/account"
              if (strpos($name, ':') !== false) {
      Severity: Major
      Found in plugins/tpl/classes/yf_tpl.class.php - About 2 hrs to fix

        Method _compile_foreach has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _compile_foreach($m)
            {
                $start = '<' . '?p' . 'hp ';
                $end = ' ?' . '>';
        
        
        Severity: Major
        Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 2 hrs to fix

          Method _process_replaces has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _process_replaces($string, array &$replace, $name = '')
              {
                  if ( ! strlen($string) || false === strpos($string, '{')) {
                      return $string;
                  }
          Severity: Major
          Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 2 hrs to fix

            Method _render_add_custom_fields has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _render_add_custom_fields(&$params, &$data, &$ids)
                {
                    if ( ! $data || ! $ids || ! $params['custom_fields']) {
                        return false;
                    }
            Severity: Major
            Found in plugins/table2/classes/yf_table2.class.php - About 2 hrs to fix

              Method supplier_edit has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method show has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function show()
                    {
                        conf('_login_form_displayed', true);
                        if ( ! empty($_POST)) {
                            if (empty($_POST['login']) && empty($_POST['email'])) {
                Severity: Major
                Found in plugins/user/modules/yf_get_pswd.class.php - About 2 hrs to fix

                  Method clear_patterns has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function clear_patterns()
                      {
                          $html = table('SELECT * FROM ' . db('shop_patterns'), [
                              'table_attr' => 'id="patterns_list"',
                              'filter' => $_SESSION[$_GET['object'] . '__patterns'],

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

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

                      Method _get_grid has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _get_grid($data = [])
                          {
                              $rows = [];
                              foreach ((array) $data as $row_id => $row_items) {
                                  $cols = '';
                      Severity: Major
                      Found in plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php - About 2 hrs to fix

                        Method test_where has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function test_where()
                            {
                                if ($this->_need_skip_test(__FUNCTION__)) {
                                    return;
                                }
                          Severity
                          Category
                          Status
                          Source
                          Language