Showing 4,217 of 4,217 total issues

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

    public function _url($name, $replace = null)
    {
        $url = &$this->url;
        $result = null;
        if (empty($url[$name])) {
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 4 other locations - About 1 hr to fix
plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 88..100
plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 64..76
plugins/payment/admin_modules/yf_manage_payment_yandexmoney.class.php on lines 62..74
plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 110..122

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

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

        return form($r, [
                'selected' => $_SESSION[$filter_name],
                'class' => 'form-vertical',
            ])
            ->text('name')
Severity: Major
Found in plugins/geo/admin_modules/yf_manage_countries.class.php and 1 other location - About 1 hr to fix
plugins/geo/admin_modules/yf_manage_regions.class.php on lines 113..121

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

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($name, $replace = null)
    {
        $url = &$this->url;
        $result = null;
        if (empty($url[$name])) {
plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 88..100
plugins/payment/admin_modules/yf_manage_payment_yandexmoney.class.php on lines 62..74
plugins/payment/admin_modules/yf_manage_payout.class.php on lines 140..152
plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 110..122

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

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($name, $replace = null)
    {
        $url = &$this->url;
        $result = null;
        if (empty($url[$name])) {
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_transfer.class.php and 4 other locations - About 1 hr to fix
plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 88..100
plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 64..76
plugins/payment/admin_modules/yf_manage_payment_yandexmoney.class.php on lines 62..74
plugins/payment/admin_modules/yf_manage_payout.class.php on lines 140..152

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

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

        } elseif ($A['receiver_type'] == 'user_id') {
            $table = table('SELECT * FROM ' . db('notifications_receivers') . ' WHERE `notification_id`=' . (int) ($_GET['id']))
                ->text('receiver_id')
                ->text('is_read')

plugins/notifications/admin_modules/yf_manage_notifications.class.php on lines 111..117

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

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

            } else {
                $_host = $params['host'];
                $_port = $params['port'] ?: '80';
                $_path = $params['path'] ?: '/';
                $link = $this->_correct_protocol($http_protocol . '://' . $_host . ($_port && ! in_array($_port, ['80', '443']) ? ':' . $_port : '') . ($_path ?: '/') . $u);
Severity: Major
Found in plugins/rewrite/classes/yf_rewrite.class.php and 1 other location - About 1 hr to fix
plugins/rewrite/classes/yf_rewrite.class.php on lines 397..408

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

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 ($params['admin_host']) {
                    $_host = $params['admin_host'];
                    $_port = $params['admin_port'] ?: '80';
                    $_path = $params['admin_path'] ?: '/admin/';
                    $link = $this->_correct_protocol($http_protocol . '://' . $_host . ($_port && ! in_array($_port, ['80', '443']) ? ':' . $_port : '') . ($_path ?: '/') . $u);
Severity: Major
Found in plugins/rewrite/classes/yf_rewrite.class.php and 1 other location - About 1 hr to fix
plugins/rewrite/classes/yf_rewrite.class.php on lines 409..414

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

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

    public function _load_lang_get_vars_from_files($lang)
    {
        $files = [];
        // Auto-find shared language vars. They will be connected in order of file system
        // Names can be any, but better to include lang name into file name. Examples:
Severity: Minor
Found in plugins/locale/classes/yf_i18n.class.php - About 1 hr to fix

    Method _filter_form_balance has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _filter_form_balance($filter, $replace)
        {
            $order_fields = [];
            foreach (explode('|', 'operation_id|datetime_update|datetime_start|datetime_finish|title|amount|balance') as $f) {
                $order_fields[$f] = $f;
    Severity: Minor
    Found in plugins/payment/admin_modules/yf_manage_payment.class.php - About 1 hr to fix

      Method csv has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function csv()
          {
              // class
              $payment_api = &$this->payment_api;
              $provider_class = $payment_api->provider_class([
      Severity: Minor
      Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

        Method currency_conversion_payout has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function currency_conversion_payout($options)
            {
                // import options
                is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                // var
        Severity: Minor
        Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 1 hr to fix

          Method _operation_form has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _operation_form()
              {
                  // import options
                  is_array($_GET) && extract($_GET, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  is_array($_POST) && extract($_POST, EXTR_PREFIX_ALL | EXTR_REFS, '_');
          Severity: Minor
          Found in plugins/payment/modules/yf_payment.class.php - About 1 hr to fix

            Method _operation_balance_update has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _operation_balance_update($options = null)
                {
                    // import options
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                    // operation
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

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

                  public function edit()
                  {
                      $_GET['id'] = (int) ($_GET['id']);
                      // Do save data
                      if ( ! empty($_POST)) {
              Severity: Minor
              Found in plugins/sys/admin_modules/yf_manage_advertising.class.php - About 1 hr to fix

                Method table_info has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function table_info($table, $extra = [], &$error = false)
                    {
                        if (is_array($table)) {
                            $extra = (array) $extra + $table;
                            $table = '';
                Severity: Minor
                Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 1 hr to fix

                  Method _get_admin_daily_info has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _get_admin_daily_info($sql, $days = 60, $admin_ids = [])
                      {
                          if ( ! $admin_ids) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/admin/admin_modules/yf_admin.class.php - About 1 hr to fix

                    Method multi_del has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function multi_del($names = [])
                        {
                            $do_real_work = true;
                            if ( ! $this->_driver_ok) {
                                $do_real_work = false;
                    Severity: Minor
                    Found in plugins/cache/classes/yf_cache.class.php - About 1 hr to fix

                      Method del_by_prefix has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function del_by_prefix($prefix = '')
                          {
                              $do_real_work = true;
                              if ( ! $this->_driver_ok) {
                                  $do_real_work = false;
                      Severity: Minor
                      Found in plugins/cache/classes/yf_cache.class.php - About 1 hr to fix

                        Method _render_table_td has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _render_table_td($info, $row, $params, $row_id)
                            {
                                $name = $info['name'];
                                if ( ! array_key_exists($name, $row)) {
                                    return false;
                        Severity: Minor
                        Found in plugins/table2/classes/yf_table2.class.php - About 1 hr to fix

                          Method view has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function view($params = [])
                              {
                                  if ( ! is_array($params)) {
                                      $params = [];
                                  }
                          Severity: Minor
                          Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language