Showing 4,217 of 4,217 total issues

Function go has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function go($new_file_path, $k, $name_in_form = 'image', $max_image_size = 0, $is_local = false)
    {

        // We do not want to user break our operation
        ignore_user_abort(true);
Severity: Minor
Found in plugins/common/classes/common/yf_multi_upload_image.class.php - About 4 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 go has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function go()
    {
        if ( ! $this->LOGGING || MAIN_TYPE_USER) {
            return false;
        }
Severity: Minor
Found in plugins/logs/classes/logs/yf_logs_exec_admin.class.php - About 4 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

Method _process_patterns has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _process_patterns($name, array $replace, $string)
    {
        $_this = $this;

        $start = '<' . '?p' . 'hp ';
Severity: Major
Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 4 hrs to fix

    Method init has 118 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function init()
        {
            // Chained config rule
            if ($this->BLOCK_FAILED_LOGINS) {
                $this->LOG_FAILED_LOGINS = true;
    Severity: Major
    Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 4 hrs to fix

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

              foreach ($data_stamp as $type => $array) {
                  $table = $this->all_queries['product'][$type]['table'];
                  $field = $this->all_queries['product'][$type]['field'];
                  $multi = $this->all_queries['product'][$type]['multi'];
                  if ( ! $multi) {
      plugins/shop/admin_modules/manage_shop/yf_manage_shop__product_revisions.class.php on lines 615..627

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

      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

              foreach ($data_stamp as $type => $array) {
                  $table = $this->all_queries['order'][$type]['table'];
                  $field = $this->all_queries['order'][$type]['field'];
                  $multi = $this->all_queries['order'][$type]['multi'];
                  if ( ! $multi) {
      plugins/shop/admin_modules/manage_shop/yf_manage_shop__product_revisions.class.php on lines 524..536

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

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

          public function show()
          {
              $object = &$this->object;
              $action = &$this->action;
              $filter_name = &$this->filter_name;
      Severity: Major
      Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 4 hrs to fix

        Method error_handler has 117 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function error_handler($error_type, $error_msg, $error_file, $error_line)
            {
                // quickly turn off notices logging
                if ($this->NO_NOTICES && ($error_type == E_NOTICE || $error_type == E_USER_NOTICE)) {
                    return true;
        Severity: Major
        Found in plugins/sys/classes/yf_core_errors.class.php - About 4 hrs to fix

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

          <?php
          
          /**
           * Category display handler.
           *
          Severity: Minor
          Found in plugins/categories/classes/yf_cats.class.php - About 4 hrs to fix

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

                public function test_max_length()
                {
                    $this->assertFalse(_class('validate')->max_length('12345'));
                    $this->assertTrue(_class('validate')->max_length('1234', ['param' => '5']));
                    $this->assertTrue(_class('validate')->max_length('12345', ['param' => '5']));
            Severity: Major
            Found in .dev/tests/unit/class_validate_test.Test.php and 2 other locations - About 4 hrs to fix
            .dev/tests/unit/class_validate_test.Test.php on lines 151..161
            .dev/tests/unit/class_validate_test.Test.php on lines 173..183

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

            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 test_exact_length()
                {
                    $this->assertFalse(_class('validate')->exact_length('12345'));
                    $this->assertFalse(_class('validate')->exact_length('1234', ['param' => '5']));
                    $this->assertTrue(_class('validate')->exact_length('12345', ['param' => '5']));
            Severity: Major
            Found in .dev/tests/unit/class_validate_test.Test.php and 2 other locations - About 4 hrs to fix
            .dev/tests/unit/class_validate_test.Test.php on lines 151..161
            .dev/tests/unit/class_validate_test.Test.php on lines 162..172

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

            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 test_cleanup_26_2()
                {
                    $closure = function ($in) {
                        return module('register')->_login_not_exists($in);
                    };
            Severity: Major
            Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 4 hrs to fix
            .dev/tests/unit/class_validate_test.Test.php on lines 1022..1042

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

            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 trigger_info($name, $extra = [], &$error = false)
                {
                    if (strpos($name, '.') !== false) {
                        list($db_name, $name) = explode('.', trim($name));
                    }
            Severity: Major
            Found in plugins/db/classes/db/yf_db_utils_driver.class.php and 1 other location - About 4 hrs to fix
            plugins/db/classes/db/yf_db_utils_mysql.class.php on lines 349..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 176.

            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 test_min_length()
                {
                    $this->assertFalse(_class('validate')->min_length('12345'));
                    $this->assertFalse(_class('validate')->min_length('1234', ['param' => '5']));
                    $this->assertTrue(_class('validate')->min_length('12345', ['param' => '5']));
            Severity: Major
            Found in .dev/tests/unit/class_validate_test.Test.php and 2 other locations - About 4 hrs to fix
            .dev/tests/unit/class_validate_test.Test.php on lines 162..172
            .dev/tests/unit/class_validate_test.Test.php on lines 173..183

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

            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

                        'okpay' => [
                            'title' => 'OkPay',
                            'icon' => 'okpay',
                            'currency' => [
                                'RUB' => [
            plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 550..594

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

            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 event_info($name, $extra = [], &$error = false)
                {
                    if (strpos($name, '.') !== false) {
                        list($db_name, $name) = explode('.', trim($name));
                    }
            Severity: Major
            Found in plugins/db/classes/db/yf_db_utils_mysql.class.php and 1 other location - About 4 hrs to fix
            plugins/db/classes/db/yf_db_utils_driver.class.php on lines 1472..1490

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

            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 test_cleanup_26_1()
                {
                    $closure = function ($in) {
                        return module('register')->_login_not_exists($in);
                    };
            Severity: Major
            Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 4 hrs to fix
            .dev/tests/unit/class_validate_test.Test.php on lines 1043..1063

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

            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',
                            'currency' => [
                                'USD' => [
            plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 462..506

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

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

                public function login($provider, $params = [])
                {
                    if ( ! $provider) {
                        return false;
                    }
            Severity: Major
            Found in plugins/oauth/classes/yf_oauth.class.php - About 4 hrs to fix

              Method _upload_item__import_test has 116 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _upload_item__import_test($options)
                  {
                      // load import data
                      $_ = $options;
                      $id = $_['id'];
                Severity
                Category
                Status
                Source
                Language