Showing 4,217 of 4,217 total issues

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

<?php

/**
 * User modules list handler.
 *
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 5 hrs to fix

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

        public function _log_fail($data = [])
        {
            if ( ! $this->LOG_FAILED_LOGINS) {
                return false;
            }
    Severity: Major
    Found in plugins/auth/classes/auth/yf_auth_admin.class.php and 1 other location - About 5 hrs to fix
    plugins/auth/classes/auth/yf_auth_user.class.php on lines 446..465

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

    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_truncate_database()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 61..73

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

    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_truncate_database()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    Severity: Major
    Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 1 other location - About 5 hrs to fix
    .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 177..189

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

    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 _log_fail($data = [])
        {
            if ( ! $this->LOG_FAILED_LOGINS) {
                return false;
            }
    Severity: Major
    Found in plugins/auth/classes/auth/yf_auth_user.class.php and 1 other location - About 5 hrs to fix
    plugins/auth/classes/auth/yf_auth_admin.class.php on lines 264..283

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

    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

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

    <?php
    
    class yf_payment
    {
        public $URL_REDIRECT = '/payment';
    Severity: Minor
    Found in plugins/payment/modules/yf_payment.class.php - About 5 hrs to fix

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

      <?php
      
      /**
       * Table2 plugin.
       */
      Severity: Minor
      Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 5 hrs to fix

        Method _on_validate_ok has 136 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _on_validate_ok($params = [], $form)
            {
                $p = $params ?: $_POST;
                $f = $_FILES['file'];
        
        

          Function add has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              public function add($params = [])
              {
                  if (is_string($params)) {
                      $params = ['table' => $params];
                  }
          Severity: Minor
          Found in plugins/sys/classes/yf_admin_methods.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 _do_login has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _do_login($params = [])
              {
                  $AUTH_LOGIN = trim($params['login']);
                  $AUTH_PSWD = trim($params['pswd']);
          
          
          Severity: Minor
          Found in plugins/auth/classes/auth/yf_auth_user.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 num2str has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              public function num2str($float, $currency_id = null, $lang_id = null, $set = false)
              {
                  $lang_id = $this->lang_id($lang_id, $set);
                  $currency_id = $this->currency_id($currency_id, $set);
                  $words = &$this->words[$lang_id];
          Severity: Minor
          Found in plugins/common/classes/common/yf_common_num2string.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

          Method _operation has 135 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _operation($options = null)
              {
                  // import options
                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  // var
          Severity: Major
          Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 5 hrs to fix

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

                    return form($a, [
                        'dd_mode' => 1,
                    ])
                    ->link('item_id', './?object=' . $_GET['object'] . '&action=view_order&id=' . $order_info['id'], [
                        'desc' => 'Order',
            plugins/shop/admin_modules/yf_manage_shop_revisions.class.php on lines 90..106

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

            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

                    return form($a, [
                            'dd_mode' => 1,
                        ])
                        ->link('Revisions list', './?object=manage_shop_revisions')
                        ->admin_info('user_id')
            plugins/shop/admin_modules/manage_shop/yf_manage_shop__product_revisions.class.php on lines 575..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 191.

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

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

              Method api_payout has 134 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

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

                if ( ! function_exists('my_array_merge')) {
                    function my_array_merge($a1, $a2)
                    {
                        foreach ((array) $a2 as $k => $v) {
                            if (isset($a1[$k]) && is_array($a1[$k])) {
                Severity: Major
                Found in functions/yf_common_funcs.php and 1 other location - About 5 hrs to fix
                .dev/install/skel_basic/config/project_conf.php on lines 26..48

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

                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 ( ! function_exists('my_array_merge')) {
                    function my_array_merge($a1, $a2)
                    {
                        foreach ((array) $a2 as $k => $v) {
                            if (isset($a1[$k]) && is_array($a1[$k])) {
                Severity: Major
                Found in .dev/install/skel_basic/config/project_conf.php and 1 other location - About 5 hrs to fix
                functions/yf_common_funcs.php on lines 160..182

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

                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

                    public function _get_sites_info()
                    {
                        // Process config files
                        foreach ((array) $this->info as $site_id => $info) {
                            $tmp_string = '';
                Severity: Major
                Found in plugins/sys/classes/yf_sites_info.class.php and 1 other location - About 5 hrs to fix
                plugins/sys/classes/core_api/yf_core_api_sites_info.class.php on lines 57..81

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

                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

                    public function _get_sites_info()
                    {
                        foreach ((array) $this->info as $site_id => $info) {
                            $tmp_string = '';
                            $found = [];
                plugins/sys/classes/yf_sites_info.class.php on lines 80..107

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

                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

                Severity
                Category
                Status
                Source
                Language