Showing 4,217 of 4,217 total issues

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

    public function _url($options, $is_server = false)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 931..944
plugins/payment/classes/yf_payment_api__provider_perfectmoney.class.php on lines 304..317
plugins/payment/classes/yf_payment_api__provider_webmoney.class.php on lines 734..747
plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php on lines 372..385

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

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 5 locations. Consider refactoring.
Open

    public function _url($options, $is_server = false)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php on lines 712..725
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 931..944
plugins/payment/classes/yf_payment_api__provider_perfectmoney.class.php on lines 304..317
plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php on lines 372..385

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

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 3 locations. Consider refactoring.
Open

    public function display($params = [])
    {
        if (is_string($params)) {
            $name = $params;
        }
Severity: Major
Found in plugins/common/classes/common/yf_dashboards.class.php and 2 other locations - About 2 hrs to fix
plugins/dashboards/admin_modules/yf_manage_dashboards.class.php on lines 198..214
plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 302..318

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

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 3 locations. Consider refactoring.
Open

    public function time($name = '', $desc = '', $extra = [], $replace = [])
    {
        if ( ! is_array($extra)) {
            $extra = [];
        }
Severity: Major
Found in plugins/form2/classes/yf_form2.class.php and 2 other locations - About 2 hrs to fix
plugins/form2/classes/yf_form2.class.php on lines 1752..1766
plugins/form2/classes/yf_form2.class.php on lines 1798..1812

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

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 3 locations. Consider refactoring.
Open

    public function display($params = [])
    {
        if (is_string($params)) {
            $name = $params;
        }
plugins/common/classes/common/yf_dashboards.class.php on lines 59..75
plugins/dashboards/admin_modules/yf_manage_dashboards.class.php on lines 198..214

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

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 ( ! empty($gallery_ids)) {
            $Q = db()->query('SELECT id,name FROM ' . db('gallery_photos') . ' WHERE id IN(' . implode(',', $gallery_ids) . ')');
            while ($A = db()->fetch_assoc($Q)) {
                $titles['gallery' . $A['id']] = $A['name'] !== '' ? $A['name'] : t('No title');
            }
plugins/comments/modules/comments/yf_comments_integration.class.php on lines 103..108

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

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 ( ! empty($gallery_ids)) {
            $Q = db()->query('SELECT id,name FROM ' . db('gallery_photos') . ' WHERE id IN(' . implode(',', $gallery_ids) . ')');
            while ($A = db()->fetch_assoc($Q)) {
                $titles['gallery' . $A['id']] = $A['name'] !== '' ? $A['name'] : t('No title');
            }
plugins/comments/modules/comments/yf_comments_integration.class.php on lines 152..157

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

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 3 locations. Consider refactoring.
Open

    public function week($name = '', $desc = '', $extra = [], $replace = [])
    {
        if ( ! is_array($extra)) {
            $extra = [];
        }
Severity: Major
Found in plugins/form2/classes/yf_form2.class.php and 2 other locations - About 2 hrs to fix
plugins/form2/classes/yf_form2.class.php on lines 1752..1766
plugins/form2/classes/yf_form2.class.php on lines 1775..1789

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

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 3 locations. Consider refactoring.
Open

    public function phone($name = '', $desc = '', $extra = [], $replace = [])
    {
        if ( ! is_array($extra)) {
            $extra = [];
        }
Severity: Major
Found in plugins/form2/classes/yf_form2.class.php and 2 other locations - About 2 hrs to fix
plugins/form2/classes/yf_form2.class.php on lines 1775..1789
plugins/form2/classes/yf_form2.class.php on lines 1798..1812

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

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 filter_save()
    {
        $object = &$this->object;
        $id = &$this->id;
        switch ($id) {
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_deposit.class.php and 1 other location - About 2 hrs to fix
plugins/payment/admin_modules/yf_manage_payout.class.php on lines 261..284

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

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 filter_save()
    {
        $object = &$this->object;
        $id = &$this->id;
        switch ($id) {
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 1 other location - About 2 hrs to fix
plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 209..232

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

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

    public function edit()
    {
        $object = &$this->object;
        $action = &$this->action;
        $filter_name = &$this->filter_name;
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_currency.class.php - About 1 hr to fix

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

        public function _get_daily_stats($type = 'sum', $days = null)
        {
            $time = time();
            $days = $days ?: 60;
            $min_time = $time - $days * 86400;
    Severity: Minor
    Found in plugins/payment/admin_modules/yf_manage_payment.class.php - About 1 hr to fix

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

          public function _create_invoice($options)
          {
              $operation_id = $options['operation_id'];
              require_php_lib('bitpay');
              $storageEngine = new \Bitpay\Storage\FilesystemStorage();
      Severity: Minor
      Found in plugins/payment/classes/yf_payment_api__provider_bitpay.class.php - About 1 hr to fix

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

            public function _product_image_upload($product_id)
            {
                $products_images_dir = module('manage_shop')->products_img_dir;
        
                $d = sprintf('%09s', $product_id);

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

              public function express_pdf($send_mail = false)
              {
                  $date = date('Y-m-d');
                  $hours = (int) ($_GET['hours']);
                  $orders = db()->get_2d('SELECT id FROM ' . db('shop_orders') . " WHERE delivery_time LIKE '" . $date . ' ' . $hours . "%' AND status = 1");

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

                public function _data()
                {
                    $_sub_action = [
                        '0' => '- не выбрано -',
                        'load' => 'загрузить',

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

                  public function mkdir_m($dir_name, $dir_mode = 0755, $create_index_htmls = 0, $start_folder = '')
                  {
                      if ( ! $dir_name || ! strlen($dir_name)) {
                          return 0;
                      }
              Severity: Minor
              Found in classes/yf_dir.class.php - About 1 hr to fix

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

                    protected function execute(InputInterface $input, OutputInterface $output)
                    {
                        global $yf_paths;
                        require_once $yf_paths['db_setup_path'];
                        init_yf();
                Severity: Minor
                Found in .dev/console/commands/yf_console_db_utils.class.php - About 1 hr to fix

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

                      public function media_objects()
                      {
                          //        $img = module('dynamic')->placeholder_img(array('width' => 300, 'height' => 200));
                          $img = url('/dynamic/placeholder/64x64');
                          $body = 'Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.';
                  Severity: Minor
                  Found in .dev/samples/classes/sample_html.class.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language