Showing 4,217 of 4,217 total issues

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

<?php

return [
  1 => [
    'id' => '1',
.dev/install/installer_data/db_tables_ru/forum_forums.data.php on lines 1..42

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

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 radio_box($name, $extra = [])
    {
        $this->form();
        return $this->func($name, function ($field, $params, $row) {
            $extra = $params['extra'];
Severity: Major
Found in plugins/table2/classes/yf_table2.class.php and 1 other location - About 5 hrs to fix
plugins/table2/classes/yf_table2.class.php on lines 2241..2258

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

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

<?php

return [
  1 => [
    'id' => '1',
.dev/install/installer_data/db_tables_en/forum_forums.data.php on lines 1..42

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

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 select_box($name, $extra = [])
    {
        $this->form();
        return $this->func($name, function ($field, $params, $row) {
            $extra = $params['extra'];
Severity: Major
Found in plugins/table2/classes/yf_table2.class.php and 1 other location - About 5 hrs to fix
plugins/table2/classes/yf_table2.class.php on lines 2217..2235

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

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_tpl has 39 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_tpl
{
    /** @var string @conf_skip Path to the templates (including current theme path) */
    public $TPL_PATH = '';
    /** @var string default template name */
Severity: Minor
Found in plugins/tpl/classes/yf_tpl.class.php - About 5 hrs to fix

    Method ui_range has 129 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

          public function _hook_side_column()
          {
              $items = [];
              $url = url('/@object');
              $methods = $this->_get_texts();
      Severity: Major
      Found in .dev/samples/classes/sample_all.class.php and 1 other location - About 5 hrs to fix
      .dev/samples/classes/sample_demo.class.php on lines 12..35

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

      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 _hook_side_column()
          {
              $items = [];
              $url = url('/@object');
              $methods = $this->_get_demos();
      Severity: Major
      Found in .dev/samples/classes/sample_demo.class.php and 1 other location - About 5 hrs to fix
      .dev/samples/classes/sample_all.class.php on lines 13..36

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

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

          public function mail($options = null)
          {
              // DEBUG
              // ini_set( 'html_errors', 0 );
              // var_dump( $options );
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api.class.php - About 5 hrs to fix

        File yf_admin.class.php has 380 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Admin users manager.
         *
        Severity: Minor
        Found in plugins/admin/admin_modules/yf_admin.class.php - About 5 hrs to fix

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

              public function show()
              {
                  $i = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['i'])); // instance
                  $g = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['g'])); // group
                  $t = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['t'])); // type
          Severity: Major
          Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 5 hrs to fix

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

                public function show()
                {
                    $filter_name = $_GET['object'] . '__' . $_GET['action'];
                    $default_filter = [
                        'order_by' => 'time',
            Severity: Major
            Found in plugins/logs/admin_modules/yf_log_user_auth_fails.class.php and 1 other location - About 5 hrs to fix
            plugins/logs/admin_modules/yf_log_admin_auth_fails.class.php on lines 14..35

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

            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()
                {
                    $filter_name = $_GET['object'] . '__' . $_GET['action'];
                    $default_filter = [
                        'order_by' => 'time',
            Severity: Major
            Found in plugins/logs/admin_modules/yf_log_admin_auth_fails.class.php and 1 other location - About 5 hrs to fix
            plugins/logs/admin_modules/yf_log_user_auth_fails.class.php on lines 14..35

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

            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

                        'webmoney' => [
                            'title' => 'WebMoney',
                            'icon' => 'webmoney',
                            'uri' => [
                                '%method' => 'webmoney',
            plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php on lines 320..370

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

            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

                        'qiwi' => [
                            'title' => 'Qiwi',
                            'icon' => 'qiwi',
                            'uri' => [
                                '%method' => 'qiwi',
            plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php on lines 371..420

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

            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

            Function api_payout has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function api_payout($options = null)
                {
                    if ( ! $this->ENABLE) {
                        return  null;
                    }
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 5 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function _recursive_get_methods_from_extends has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
                {
                    $extends_file_path = '';
                    $methods = [];
                    // TODO: connect plugins
            Severity: Minor
            Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 5 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function send has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function send($params = [])
                {
                    $driver = strtolower($params['driver'] ?: $this->DRIVER);
                    if (DEBUG_MODE || $this->LOG_EMAILS) {
                        $time_start = microtime(true);
            Severity: Minor
            Found in plugins/email/classes/yf_send_mail.class.php - About 5 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function query has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function &query($sql)
                {
                    if ( ! $this->_connected && ! $this->connect()) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/db/classes/yf_db.class.php - About 5 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function _set_curl_options has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _set_curl_options($url_options = [], $is_ftp_url = false)
                {
                    $curl_opts = [];
            
                    $user_agent = isset($url_options['user_agent']) ? $url_options['user_agent'] : $this->DEF_USER_AGENT;
            Severity: Minor
            Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language