Showing 4,217 of 4,217 total issues

File install.php has 580 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

// TODO: form validation
// TODO: add language selector $_POST['install_project_lang']
// TODO: webserver selection (write htaccess or not?)
Severity: Major
Found in .dev/install/install.php - About 1 day to fix

    Function _on_validate_ok has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

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

    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 init_graphics has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

        public function init_graphics()
        {
            $init_type = MAIN_TYPE;
            // Do not remove this!
            $this->_init_global_tags();
    Severity: Minor
    Found in plugins/tpl/classes/yf_tpl.class.php - About 1 day 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 shop_products.sql_php.php has 577 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    return [
        'fields' => [
            'id' => [
    Severity: Major
    Found in plugins/shop/share/db/sql_php/shop_products.sql_php.php - About 1 day to fix

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

          public function test_alpha_dash()
          {
              $this->assertFalse(_class('validate')->alpha_dash(''));
              $this->assertFalse(_class('validate')->alpha_dash(null));
              $this->assertFalse(_class('validate')->alpha_dash(false));
      Severity: Major
      Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
      .dev/tests/unit/class_validate_test.Test.php on lines 302..319

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

      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 _form($data, $options = null)
          {
              if ( ! $this->ENABLE) {
                  return  null;
              }
      plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php on lines 387..422

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

      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_alpha_numeric()
          {
              $this->assertFalse(_class('validate')->alpha_numeric(''));
              $this->assertFalse(_class('validate')->alpha_numeric(null));
              $this->assertFalse(_class('validate')->alpha_numeric(false));
      Severity: Major
      Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
      .dev/tests/unit/class_validate_test.Test.php on lines 342..359

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

      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 _form($data, $options = null)
          {
              if ( ! $this->ENABLE) {
                  return  null;
              }
      plugins/payment/classes/yf_payment_api__provider_perfectmoney.class.php on lines 319..354

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

      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

      class_form_test has 66 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class class_form_test extends yf\tests\wrapper
      {
          private static $_bak_settings = [];
          private static $css = [];
          private static $action = '';
      Severity: Major
      Found in .dev/tests/unit/class_form_test.Test.php - About 1 day to fix

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

        <?php
        
        
        class yf_ssh_files
        {
        Severity: Major
        Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 1 day to fix

          yf_html has 65 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_html
          {
              public $AUTO_ASSIGN_IDS = true;
              public $BOXES_USE_STPL = false;
              public $SELECT_BOX_DEF_OPT_TPL = '- %select% %name% -';
          Severity: Major
          Found in plugins/html/classes/yf_html.class.php - About 1 day to fix

            File forum_posts.data.php has 561 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            return [
              1 => [
                'id' => '1',
            Severity: Major
            Found in .dev/install/installer_data/db_tables_en/forum_posts.data.php - About 1 day to fix

              Function init has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function init()
                  {
                      // Chained config rule
                      if ($this->BLOCK_FAILED_LOGINS) {
                          $this->LOG_FAILED_LOGINS = true;
              Severity: Minor
              Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 1 day 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 sys_log_exec.sql_php.php has 558 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              return [
                  'fields' => [
                      'id' => [
              Severity: Major
              Found in plugins/logs/share/db/sql_php/sys_log_exec.sql_php.php - About 1 day to fix

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

                    public function test_order1()
                    {
                        $url = 'http://jquery.com/jquery-wp-content/themes/jquery.com/style.css';
                        $url1 = $url . '?v=1';
                        $url2 = $url . '?v=2';
                Severity: Major
                Found in .dev/tests/unit/class_assets_test.Test.php and 2 other locations - About 1 day to fix
                .dev/tests/unit/class_assets_test.Test.php on lines 690..725
                .dev/tests/unit/class_assets_test.Test.php on lines 728..763

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

                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_order3()
                    {
                        $url = 'http://jquery.com/jquery-wp-content/themes/jquery.com/style.css';
                        $url1 = $url . '?v=1';
                        $url2 = $url . '?v=2';
                Severity: Major
                Found in .dev/tests/unit/class_assets_test.Test.php and 2 other locations - About 1 day to fix
                .dev/tests/unit/class_assets_test.Test.php on lines 652..687
                .dev/tests/unit/class_assets_test.Test.php on lines 690..725

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

                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_order2()
                    {
                        $url = 'http://jquery.com/jquery-wp-content/themes/jquery.com/style.css';
                        $url1 = $url . '?v=1';
                        $url2 = $url . '?v=2';
                Severity: Major
                Found in .dev/tests/unit/class_assets_test.Test.php and 2 other locations - About 1 day to fix
                .dev/tests/unit/class_assets_test.Test.php on lines 652..687
                .dev/tests/unit/class_assets_test.Test.php on lines 728..763

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

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

                <?php
                
                /**
                 * SSH Client (based on SSH2 PHP extension).
                 *
                Severity: Major
                Found in plugins/ssh/classes/yf_ssh.class.php - About 1 day to fix

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

                  <?php
                  
                  // User profile handling module
                  class yf_user_profile extends yf_module
                  {
                  Severity: Major
                  Found in plugins/user/modules/yf_user_profile.class.php - About 1 day to fix

                    Function _edit has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _edit($params = [])
                        {
                            if (empty(main()->USER_ID) && MAIN_TYPE_USER) {
                                return _error_need_login();
                            }
                    Severity: Minor
                    Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 1 day 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