Showing 4,217 of 4,217 total issues

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

        'user_type' => [
            'name' => 'user_type',
            'type' => 'enum',
            'length' => null,
            'decimals' => null,
Severity: Major
Found in plugins/sys/share/db/sql_php/users_online.sql_php.php and 3 other locations - About 1 hr to fix
plugins/notifications/share/db/sql_php/notifications.sql_php.php on lines 35..53
plugins/notifications/share/db/sql_php/notifications_receivers.sql_php.php on lines 35..53
plugins/sys/share/db/sql_php/users_online_details.sql_php.php on lines 20..38

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

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

        'receiver_type' => [
            'name' => 'receiver_type',
            'type' => 'enum',
            'length' => null,
            'decimals' => null,
plugins/notifications/share/db/sql_php/notifications.sql_php.php on lines 35..53
plugins/sys/share/db/sql_php/users_online.sql_php.php on lines 20..38
plugins/sys/share/db/sql_php/users_online_details.sql_php.php on lines 20..38

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

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

        'user_type' => [
            'name' => 'user_type',
            'type' => 'enum',
            'length' => null,
            'decimals' => null,
plugins/notifications/share/db/sql_php/notifications.sql_php.php on lines 35..53
plugins/notifications/share/db/sql_php/notifications_receivers.sql_php.php on lines 35..53
plugins/sys/share/db/sql_php/users_online.sql_php.php on lines 20..38

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

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 strtoupper($text)
    {
        if (is_array($text)) {
            foreach ((array) $text as $k => $v) {
                $text[$k] = $this->strtoupper($v);
Severity: Major
Found in classes/yf_utf8.class.php and 1 other location - About 1 hr to fix
classes/yf_utf8.class.php on lines 373..389

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

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 static function first_or_new()
    {
        $obj = isset($this) ? $this : new static();
        $args = func_get_args();
        $first = $obj->new_query([
Severity: Major
Found in plugins/sys/classes/yf_model.class.php and 1 other location - About 1 hr to fix
plugins/sys/classes/yf_model.class.php on lines 99..113

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

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 strtolower($text)
    {
        if (is_array($text)) {
            foreach ((array) $text as $k => $v) {
                $text[$k] = $this->strtolower($v);
Severity: Major
Found in classes/yf_utf8.class.php and 1 other location - About 1 hr to fix
classes/yf_utf8.class.php on lines 351..367

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

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 static function first_or_create()
    {
        $obj = isset($this) ? $this : new static();
        $args = func_get_args();
        $first = $obj->new_query([
Severity: Major
Found in plugins/sys/classes/yf_model.class.php and 1 other location - About 1 hr to fix
plugins/sys/classes/yf_model.class.php on lines 118..132

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

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 (substr($a['data_old'], 0, 1) === '{') {
            $a['data_old'] = json_decode($a['data_old'], true);
        } elseif (substr($a['data_old'], 0, $plen) === $prefix) {
            $a['data_old'] = json_decode(substr($a['data_old'], $plen), true);
        }
Severity: Major
Found in plugins/db/admin_modules/yf_manage_revisions.class.php and 1 other location - About 1 hr to fix
plugins/db/admin_modules/yf_manage_revisions.class.php on lines 165..169

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

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 (substr($a['data_new'], 0, 1) === '{') {
            $a['data_new'] = json_decode($a['data_new'], true);
        } elseif (substr($a['data_new'], 0, $plen) === $prefix) {
            $a['data_new'] = json_decode(substr($a['data_new'], $plen), true);
        }
Severity: Major
Found in plugins/db/admin_modules/yf_manage_revisions.class.php and 1 other location - About 1 hr to fix
plugins/db/admin_modules/yf_manage_revisions.class.php on lines 160..164

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

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

    protected function _user_message($options = null)
    {
        $url = &$this->url;
        // import operation
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 1 hr to fix

    Method button_box has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function button_box($name, $values = [], $selected = '', $extra = [])
        {
            if (is_array($name)) {
                $extra = (array) $extra + $name;
                $name = $extra['name'];
    Severity: Minor
    Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

      Method _status has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method _show_filter has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method interkassa_detect_card has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function interkassa_detect_card($options = null)
              {
                  // import options
                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  if (empty($_card)) {
          Severity: Minor
          Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

            Method _object_update has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _object_update($name, $data, $options = null)
                {
                    if (empty($name)) {
                        return  null;
                    }
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

              Method __api_response__check has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function __api_response__check($operation_id, $response)
                  {
                      if ( ! $this->ENABLE) {
                          return  null;
                      }
              Severity: Minor
              Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 1 hr to fix

                Method edit_rule has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function edit_rule()
                    {
                        $rule_info = db()->get('SELECT * FROM ' . db('block_rules') . ' WHERE id=' . (int) ($_GET['id']));
                        if (empty($rule_info['id'])) {
                            return _e('No such rule!');
                Severity: Minor
                Found in plugins/sys/admin_modules/yf_blocks.class.php - About 1 hr to fix

                  Method _get_cached_paths has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _get_cached_paths()
                      {
                          $cache_name = __FUNCTION__ . '_' . MAIN_TYPE;
                          if (isset($this->$cache_name)) {
                              return $this->$cache_name;
                  Severity: Minor
                  Found in plugins/tpl/classes/yf_tpl.class.php - About 1 hr to fix

                    Method _ckeditor_html has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _ckeditor_html($extra = [], $replace = [], $form)
                        {
                            if ( ! is_array($extra)) {
                                return '';
                            }
                    Severity: Minor
                    Found in plugins/form2/classes/form2/yf_form2_ckeditor.class.php - About 1 hr to fix

                      Method _sql_to_array has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _sql_to_array($return_raw = false, $sql_data = null)
                          {
                              if ( ! isset($sql_data)) {
                                  $sql_data = &$this->_sql;
                              }
                      Severity: Minor
                      Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language