Showing 4,217 of 4,217 total issues

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 1446..1454

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

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

            if ( ! $use_pswd) {
                $key = new Crypt_RSA();
                if ($server_info['ssh_key_pswd']) {
                    $key->setPassword($server_info['ssh_key_pswd']); // password for key
                }
Severity: Major
Found in plugins/ssh/classes/yf_ssh.class.php and 1 other location - About 2 hrs to fix
plugins/ssh/classes/yf_ssh.class.php on lines 255..266

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

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

        for ($i = 0; $i < $this->add_rects; $i++) {
            imagefilledrectangle($image, rand(-$this->image_width, $this->image_width), rand(-$this->image_height, $this->image_height), rand(-$this->image_width, $this->image_width), rand(-$this->image_height, $this->image_height), array_rand(array_flip($this->rect_colors)));
        }
Severity: Major
Found in plugins/content/classes/yf_captcha.class.php and 1 other location - About 2 hrs to fix
plugins/content/classes/yf_captcha.class.php on lines 325..327

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

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

        if ( ! $use_pswd) {
            $key = new Crypt_RSA();
            if ($server_info['ssh_key_pswd']) {
                $key->setPassword($server_info['ssh_key_pswd']); // password for key
            }
Severity: Major
Found in plugins/ssh/classes/yf_ssh.class.php and 1 other location - About 2 hrs to fix
plugins/ssh/classes/yf_ssh.class.php on lines 163..174

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

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

        for ($i = 0; $i < $this->add_lines; $i++) {
            imageline($image, rand(-$this->image_width, $this->image_width), rand(-$this->image_height, $this->image_height), rand(-$this->image_width, $this->image_width), rand(-$this->image_height, $this->image_height), array_rand(array_flip($this->line_colors)));
        }
Severity: Major
Found in plugins/content/classes/yf_captcha.class.php and 1 other location - About 2 hrs to fix
plugins/content/classes/yf_captcha.class.php on lines 321..323

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

yf_remote_files has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_remote_files
{
    /** @var string SMTP host to verify emails from. Be sure to set this correctly! */
    public $SMTP_PROBE_HOST = 'mx.test.com';
    /** @var string */
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 hrs to fix

    yf_api has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_api
    {
        public $API_SSL_VERIFY = true;
        public $JSON_VULNERABILITY_PROTECTION = true;
        public $ROBOT_NONE = true;
    Severity: Minor
    Found in plugins/api/classes/yf_api.class.php - About 2 hrs to fix

      yf_db_driver has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class yf_db_driver
      {
          abstract protected function __construct(array $params);
      
          /**
      Severity: Minor
      Found in plugins/db/classes/db/yf_db_driver.class.php - About 2 hrs to fix

        yf_manage_dashboards has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class yf_manage_dashboards
        {
            /**
             * Bootstrap CSS classes used to create configurable grid.
             */
        Severity: Minor
        Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 2 hrs to fix

          class_rewrite_testing_shared has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class class_rewrite_testing_shared extends yf\tests\wrapper
          {
              private static $host = 'test.dev';
              private static $_bak_settings = [];
          
          
          Severity: Minor
          Found in .dev/tests/rewrite/class_rewrite_testing_shared.php - About 2 hrs to fix

            Method _filter_form_show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _filter_form_show($filter, $replace)
                {
                    $order_fields = [
                        'o.operation_id' => 'номер операций',
                        'o.amount' => 'сумма',
            Severity: Major
            Found in plugins/payment/admin_modules/yf_manage_payment_operation.class.php - About 2 hrs to fix

              Method vars has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function vars()
                  {
                      $vars = $this->_get_all_vars_from_files();
                      $vars_db = $this->_get_all_vars_from_db();
                      foreach ((array) $vars_db as $source => $a) {
              Severity: Major
              Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 2 hrs to fix

                Method _check_interkassa has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _check_interkassa($options = null)
                    {
                        // check operation
                        $operation = $this->_operation($options);
                        // import options
                Severity: Major
                Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 2 hrs to fix

                  Method daterange_select has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method connect has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function connect()
                        {
                            $this->db_connect_id = mysqli_init();
                            if ( ! $this->db_connect_id || mysqli_connect_errno()) {
                                $this->_connect_error = 'cannot_connect_to_server';
                    Severity: Major
                    Found in plugins/db/classes/db/yf_db_driver_mysqli.class.php - About 2 hrs to fix

                      Method basket has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function basket($params = [])
                          {
                              $STPL_NAME = $params['STPL'] ? $params['STPL'] : 'shop/basket';
                      
                              $basket_contents = module('shop')->_basket_api()->get_all();
                      Severity: Major
                      Found in plugins/shop/modules/shop/yf_shop_basket.class.php - About 2 hrs to fix

                        Method main_layout_html has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function main_layout_html($body = '')
                            {
                                ob_start(); ?>
                        <!DOCTYPE html>
                        <html>
                        Severity: Major
                        Found in .dev/install/install.php - About 2 hrs to fix

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

                              public function _show_header()
                              {
                                  $pheader = t('Shop');
                                  $subheader = _ucwords(str_replace('_', ' ', $_GET['action']));
                                  $cases = [
                          plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 319..335

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

                          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 _show_header()
                              {
                                  $pheader = t('Static pages');
                                  $subheader = _ucwords(str_replace('_', ' ', $_GET['action']));
                                  $cases = [
                          Severity: Major
                          Found in plugins/static_pages/admin_modules/yf_static_pages.class.php and 1 other location - About 2 hrs to fix
                          plugins/shop/admin_modules/manage_shop/yf_manage_shop__show_header.class.php on lines 5..21

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

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

                              public function show()
                              {
                                  $a = $this->_get_page_from_db();
                                  if ( ! $a) {
                                      return _404();
                          Severity: Major
                          Found in plugins/static_pages/modules/yf_static_pages.class.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language