Showing 4,217 of 4,217 total issues

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

<?php

// TODO: compare versions with require_php_lib('php_semver')
// TODO: decide with images: jpeg, png, gif, sprites
// TODO: requirejs integration, auto-generate its config with switcher on/off
Severity: Major
Found in plugins/assets/classes/yf_assets.class.php - About 5 days to fix

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

    <?php
    
    class yf_payment_test
    {
        public $api = [
    Severity: Major
    Found in plugins/payment/modules/yf_payment_test.class.php - About 5 days to fix

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

      <?php
      
      /**
       * Table2 high-level generator, mostly using bootstrap html/css framework.
       *
      Severity: Major
      Found in plugins/table2/classes/yf_table2.class.php - About 4 days to fix

        File currencies.php has 1823 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        $data = [
          'AFN' => [
            'id' => 'AFN',
        Severity: Major
        Found in .dev/scripts/currencies/currencies.php - About 4 days to fix

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

          <?php
          
          return [
              'fields' => [
                  'id' => [
          Severity: Major
          Found in plugins/sys/share/db/sql_php/sys_menus.sql_php.php and 1 other location - About 4 days to fix
          plugins/sys/share/db/sql_php/sys_categories.sql_php.php on lines 1..145

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

          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

          <?php
          
          return [
              'fields' => [
                  'id' => [
          Severity: Major
          Found in plugins/sys/share/db/sql_php/sys_categories.sql_php.php and 1 other location - About 4 days to fix
          plugins/sys/share/db/sql_php/sys_menus.sql_php.php on lines 1..145

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

          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

          Function parse has a Cognitive Complexity of 231 (exceeds 5 allowed). Consider refactoring.
          Open

              public function parse($sql)
              {
                  $parsed = $this->parser->parse($sql);
          
                  $table_name = $parsed['TABLE']['no_quotes']['parts'][0] ?: '';
          Severity: Minor
          Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.class.php - About 4 days 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 class_db_offline_query_builder_test.Test.php has 1711 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          require_once __DIR__ . '/db_offline_abstract.php';
          
          /**
          Severity: Major
          Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 4 days to fix

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

            <?php
            
            return [
              0 => [
                'c' => 'AD',
            Severity: Major
            Found in .dev/install/installer_data/db_tables/countries.data.php - About 4 days to fix

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

                  public function test_decrement()
                  {
                      if ($this->_need_skip_test(__FUNCTION__)) {
                          return;
                      }
              .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php on lines 1029..1094

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

              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_increment()
                  {
                      if ($this->_need_skip_test(__FUNCTION__)) {
                          return;
                      }
              .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php on lines 1095..1160

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

              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 test_foreach()
                  {
                      $data2 = [
                          5 => ['name' => 'name1', 'age' => 21],
                          6 => ['name' => 'name2', 'age' => 22],
              Severity: Major
              Found in .dev/tests/unit/tpl/tpl_driver_yf_foreach_test.Test.php and 1 other location - About 4 days to fix
              .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php on lines 152..181

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

              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 test_foreach()
                  {
                      $data2 = [
                          5 => ['name' => 'name1', 'age' => 21],
                          6 => ['name' => 'name2', 'age' => 22],
              Severity: Major
              Found in .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php and 1 other location - About 4 days to fix
              .dev/tests/unit/tpl/tpl_driver_yf_foreach_test.Test.php on lines 11..40

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

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

              <?php
              
              /**
               * Core main class.
               *
              Severity: Major
              Found in classes/yf_main.class.php - About 4 days to fix

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

                <?php
                
                /**
                 * HTML high-level controls collection.
                 *
                Severity: Major
                Found in plugins/html/classes/yf_html.class.php - About 4 days to fix

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

                  <?php
                  
                  /**
                   * Database query builder (Active Record).
                   *
                  Severity: Major
                  Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 4 days to fix

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

                    <?php
                    
                    /**
                     * YF db utils driver abstract class.
                     */
                    Severity: Major
                    Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 4 days to fix

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

                      <?php
                      
                      return [
                        1 => [
                          'id' => '1',
                      Severity: Major
                      Found in .dev/install/installer_data/db_tables/sys_menu_items.data.php - About 4 days to fix

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

                        <?php
                        
                        return [
                            'fields' => [
                                'time' => [
                        Severity: Major
                        Found in plugins/logs/share/db/sql_php/sys_log_auth_fails.sql_php.php and 1 other location - About 3 days to fix
                        plugins/logs/share/db/sql_php/sys_log_admin_auth_fails.sql_php.php on lines 1..124

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

                        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

                        <?php
                        
                        return [
                            'fields' => [
                                'time' => [
                        plugins/logs/share/db/sql_php/sys_log_auth_fails.sql_php.php on lines 1..124

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

                        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