Showing 4,217 of 4,217 total issues

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

    public function show()
    {
        conf('_login_form_displayed', true);
        if ( ! empty($_POST)) {
            if (empty($_POST['login']) && empty($_POST['email'])) {
Severity: Minor
Found in plugins/user/modules/yf_get_pswd.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 compact_info has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function compact_info()
    {
        main()->NO_GRAPHICS = true;
        conf('no_ajax_here', true);
        // Check user id
Severity: Minor
Found in plugins/user/modules/yf_user_profile.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 _process_text has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function _process_text($body = '', $no_smilies = false, $smilies_as_image = false)
    {
        if (empty($body)) {
            return '';
        }
Severity: Minor
Found in plugins/content/classes/yf_bb_codes.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, $need_meta = false)
    {
        if (empty($sql)) {
            return false;
        }
Severity: Minor
Found in plugins/search/classes/yf_sphinxsearch.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

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

<?php


class yf_db_utils_helper_create_table
{
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_helper_create_table.class.php - About 5 hrs to fix

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

            if( is_422 ) {
                if( t.length == 3 ) {
                    result = new Date( Date.UTC( t[0], t[1] - 1, t[2] ) );
                } else if( t.length == 6 ) {
                    result = new Date( Date.UTC( t[0], t[1] - 1, t[2], t[3] || 0, t[4] || 0, t[5] || 0 ) );
    plugins/content/templates/user/js/ng/payment/balance-recharge.js on lines 624..630

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            } else if( is_224 ) {
                if( t.length == 3 ) {
                    result = new Date( Date.UTC( t[2], t[1] - 1, t[0] ) );
                } else if( t.length == 6 ) {
                    result = new Date( Date.UTC( t[3], t[4] - 1, t[5], t[0] || 0, t[1] || 0, t[2] || 0 ) );
    plugins/content/templates/user/js/ng/payment/balance-recharge.js on lines 618..630

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

    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_site_map.class.php has 377 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Site Map Generator (implementation of the http://www.sitemaps.org/protocol.php).
     *
    Severity: Minor
    Found in plugins/site_map/modules/yf_site_map.class.php - About 5 hrs to fix

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

              while ($A = db()->fetch_assoc($Q)) {
                  $comments[$A['id']] = $A;
                  $user_ids[$A['user_id']] = $A['user_id'];
      
                  $A['object_name'] == 'news' ? $news_ids[$A['object_id']] = $A['object_id'] : '';
      plugins/comments/modules/comments/yf_comments_integration.class.php on lines 75..83

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

      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

              while ($A = db()->fetch_assoc($Q)) {
                  $comments[$A['id']] = $A;
                  $user_ids[$A['user_id']] = $A['user_id'];
      
                  $A['object_name'] == 'news' ? $news_ids[$A['object_id']] = $A['object_id'] : '';
      plugins/comments/modules/comments/yf_comments_integration.class.php on lines 124..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 184.

      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_multi_check_box()
          {
              $html = html();
              $def_class = $html->CLASS_LABEL_CHECKBOX . ' ' . $html->CLASS_LABEL_CHECKBOX_INLINE;
      
      
      Severity: Major
      Found in .dev/tests/unit/class_html_test.Test.php and 1 other location - About 5 hrs to fix
      .dev/tests/unit/class_html_test.Test.php on lines 482..502

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

      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_radio_box()
          {
              $html = html();
              $def_class = $html->CLASS_LABEL_RADIO . ' ' . $html->CLASS_LABEL_RADIO_INLINE;
      
      
      Severity: Major
      Found in .dev/tests/unit/class_html_test.Test.php and 1 other location - About 5 hrs to fix
      .dev/tests/unit/class_html_test.Test.php on lines 461..481

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

      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_comments_manage.class.php has 376 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * Comments management.
       */
      Severity: Minor
      Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 5 hrs to fix

        Method _operation has 125 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, '');
                // class
        Severity: Major
        Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 5 hrs to fix

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

          <?php
          
          /**
           * Menu API methods.
           *
          Severity: Minor
          Found in plugins/sys/classes/yf_core_menu.class.php - About 5 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                        if (( ! is_array($rule_info['methods']) || $matched_method)
                            && ( ! is_array($rule_info['user_groups']) || $matched_user_group)
                            && ( ! is_array($rule_info['themes']) || $matched_theme || ! $CUR_USER_THEME)
                            && ( ! is_array($rule_info['locales']) || $matched_locale || ! $CUR_LOCALE)
                            && ( ! is_array($rule_info['site_ids']) || $matched_site || ! $CUR_SITE)
            Severity: Critical
            Found in plugins/sys/classes/yf_core_blocks.class.php - About 5 hrs to fix

              File sys_log_redirects.sql_php.php has 375 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              return [
                  'fields' => [
                      'id' => [
              Severity: Minor
              Found in plugins/logs/share/db/sql_php/sys_log_redirects.sql_php.php - About 5 hrs to fix

                Method _process_ifs has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _process_ifs($string = '', array &$replace, $stpl_name = '')
                    {
                        if (false === strpos($string, '{/if}') || empty($string)) {
                            return $string;
                        }
                Severity: Major
                Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 4 hrs to fix

                  Method test_check_box has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function test_check_box()
                      {
                          $html = html();
                          $def_class = $html->CLASS_LABEL_CHECKBOX . ' ' . $html->CLASS_LABEL_CHECKBOX_INLINE;
                  
                  
                  Severity: Major
                  Found in .dev/tests/unit/class_html_test.Test.php - About 4 hrs to fix

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

                        public function test_elseforeach()
                        {
                            $data = ['k1' => 'v1', 'k2' => 'v2'];
                            $this->assertEquals('no rows', self::_tpl('{foreach(data)} {_key}={_val} {elseforeach}no rows{/foreach}', []));
                            $this->assertEquals(' k1=v1  k2=v2 ', self::_tpl('{foreach(data)} {_key}={_val} {elseforeach}no rows{/foreach}', ['data' => $data]));
                    Severity: Major
                    Found in .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php and 1 other location - About 4 hrs to fix
                    .dev/tests/unit/tpl/tpl_driver_yf_foreach_test.Test.php on lines 130..139

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

                    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