Showing 4,217 of 4,217 total issues

File class_db_real_utils_pgsql.TODO.php has 807 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

require_once __DIR__ . '/db_real_abstract.php';

/**
Severity: Major
Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php - About 1 day to fix

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

        public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $ONLY_PRIVATE_METHODS = false)
        {
            // TODO: need to add 'site__' and 'adm__' functionality
            $extends_file_path = '';
            $methods = [];
    Severity: Major
    Found in plugins/user/admin_modules/yf_user_modules.class.php and 1 other location - About 1 day to fix
    plugins/sys/classes/core_api/yf_core_api_user_modules.class.php on lines 237..279

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

    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 _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $ONLY_PRIVATE_METHODS = false)
        {
            // TODO: need to add 'site__' and 'adm__' functionality
            $extends_file_path = '';
            $methods = [];
    plugins/user/admin_modules/yf_user_modules.class.php on lines 361..403

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

    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 address.data.php has 803 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    return [
        0 => [
            'address_id' => '1',
    Severity: Major
    Found in .dev/tests/functional/model/fixtures/address.data.php - About 1 day to fix

      Function read has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
      Open

          public function read($filename)
          {
              // split the file into lines, we'll process it line by line
              $config_file = file($filename);
      
      
      Severity: Minor
      Found in plugins/search/admin_modules/yf_manage_sphinx.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

      Function read has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
      Open

          public function read($filename)
          {
              // split the file into lines, we'll process it line by line
              $config_file = file($filename);
      
      

      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

      yf_db has 99 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class yf_db
      {
          /** @var string Type of database (default) */
          public $DB_TYPE = 'mysql';
          /** @var bool Switch caching on/off */
      Severity: Major
      Found in plugins/db/classes/yf_db.class.php - About 1 day to fix

        File class_assets_test.Test.php has 790 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        require_once dirname(__DIR__) . '/yf_unit_tests_setup.php';
        
        class class_assets_test extends PHPUnit\Framework\TestCase
        Severity: Major
        Found in .dev/tests/unit/class_assets_test.Test.php - About 1 day to fix

          Function conf has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
          Open

              function conf($name = null, $new_value = null, $_arr_name = '')
              {
                  $_arr_sub = null;
                  if ( ! $_arr_name) {
                      $_arr_name = 'CONF';
          Severity: Minor
          Found in functions/yf_conf.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 yf_auth_user.class.php has 786 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Special methods for user authentification.
           *
          Severity: Major
          Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 1 day to fix

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

            <?php
            
            /**
             * YF database migrations handler.
             */
            Severity: Major
            Found in plugins/db/classes/db/yf_db_migrator.class.php - About 1 day to fix

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

                  public function tree()
                  {
                      return _class('html')->tree([
                          11 => [
                              'name' => 'Tools',
              Severity: Major
              Found in .dev/samples/classes/sample_html.class.php and 1 other location - About 1 day to fix
              .dev/samples/classes/sample_html.class.php on lines 425..497

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

              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 menu()
                  {
                      return _class('html')->menu([
                          11 => [
                              'name' => 'Tools',
              Severity: Major
              Found in .dev/samples/classes/sample_html.class.php and 1 other location - About 1 day to fix
              .dev/samples/classes/sample_html.class.php on lines 500..572

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

              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

                      foreach ((array) $tables_php as $name => $sql_php) {
                          $table = $db_prefix . $name;
                          $sql_php = $this->_fix_sql_php($sql_php);
                          $this->assertTrue(is_array($sql_php) && count((array) $sql_php) && $sql_php);
                          $this->assertFalse((bool) self::utils()->table_exists(self::table_name($table)));
              .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php on lines 263..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 377.

              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

                      foreach ((array) $tables_php as $name => $sql_php) {
                          $table = $db_prefix . $name;
                          $sql_php = $this->_fix_sql_php($sql_php);
                          $this->assertTrue(is_array($sql_php) && count((array) $sql_php) && $sql_php);
                          $this->assertFalse((bool) self::utils()->table_exists(self::table_name($table)));
              .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php on lines 336..356

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

              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

              <?php
              
              load('cache_driver', '', 'classes/cache/');
              class yf_cache_driver_couchbase extends yf_cache_driver
              {
              plugins/cache/classes/cache/yf_cache_driver_memcache.class.php on lines 1..90

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

              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

              <?php
              
              load('cache_driver', '', 'classes/cache/');
              class yf_cache_driver_memcache extends yf_cache_driver
              {
              plugins/cache/classes/cache/yf_cache_driver_couchbase.class.php on lines 1..90

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

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

              <?php
              
              class yf_manage_deposit
              {
                  public $payment_api = null;
              Severity: Major
              Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 1 day to fix

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

                <?php
                
                class yf_payment_api__currency
                {
                    public $base = 'UAH';
                Severity: Major
                Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 1 day to fix

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

                  <?php
                  
                  /**
                   * Locale, i18n (Internationalization) editor.
                   *
                  Severity: Major
                  Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language