Showing 4,217 of 4,217 total issues

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

<?php

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

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

        public function test_create_full()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/functional/db/class_db_real_migrator_mysql.Test__off__.php on lines 176..204

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

    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_create_safe()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    .dev/tests/functional/db/class_db_real_migrator_mysql.Test__off__.php on lines 205..233

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

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

    <?php
    
    require_once __DIR__ . '/yf_aliases.php';
    require_once __DIR__ . '/yf_is_funcs.php';
    require_once __DIR__ . '/yf_array_funcs.php';
    Severity: Major
    Found in functions/yf_common_funcs.php - About 1 day to fix

      Method render has 267 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render($extra = [], $replace = [])
          {
              if (isset($this->_rendered)) {
                  return $this->_rendered;
              }
      Severity: Major
      Found in plugins/form2/classes/yf_form2.class.php - About 1 day to fix

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

            public function confirmation_update_expired()
            {
                $url = &$this->url;
                // command line interface
                $is_cli = (php_sapi_name() == 'cli');
        Severity: Major
        Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 1 other location - About 1 day to fix
        plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 771..805

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

        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 update_expired()
            {
                $url = &$this->url;
                // command line interface
                $is_cli = (php_sapi_name() == 'cli');
        Severity: Major
        Found in plugins/payment/admin_modules/yf_manage_deposit.class.php and 1 other location - About 1 day to fix
        plugins/payment/admin_modules/yf_manage_payout.class.php on lines 1937..1971

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

        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 class_db_real_query_builder_mysql_test.Test.php has 608 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        require_once __DIR__ . '/db_real_abstract.php';
        
        /**

          Function _render_get_data has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _render_get_data(&$params)
              {
                  $default_per_page = MAIN_TYPE_USER ? conf('user_per_page') : conf('admin_per_page');
                  if ($params['rotate_table']) {
                      $default_per_page = 10;
          Severity: Minor
          Found in plugins/table2/classes/yf_table2.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 balance-recharge.js has 606 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function () { 'use strict';
          
          var __NS__ = 'payment.balance.recharge';
          __ANGULAR_MODULES__.push( __NS__ );
          
          
          Severity: Major
          Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 1 day to fix

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

            <?php
            
            /**
             * Core API.
             */
            Severity: Major
            Found in plugins/sys/classes/yf_core_api.class.php - About 1 day to fix

              Function _validate_rules_cleanup has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _validate_rules_cleanup($validate_rules = [])
                  {
                      // Trim names with spaces
                      foreach ((array) $validate_rules as $name => $raw) {
                          $trimmed = trim($name);
              Severity: Minor
              Found in classes/yf_validate.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 class_model_bears_test.Test.php has 600 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              require_once dirname(__DIR__) . '/db_real_abstract.php';
              
              /**
              Severity: Major
              Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 1 day to fix

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

                <?php
                
                class yf_manage_shop__product_revisions
                {
                    public $temp_fields = [

                  Method parse has 256 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function parse($sql)
                      {
                          $parsed = $this->parser->parse($sql);
                  
                          $table_name = $parsed['TABLE']['no_quotes']['parts'][0] ?: '';
                  Severity: Major
                  Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.class.php - About 1 day to fix

                    yf_table2 has 69 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class yf_table2
                    {
                        /* Example:
                            return table('SELECT * FROM '.db('admin'))
                                ->text('login')
                    Severity: Major
                    Found in plugins/table2/classes/yf_table2.class.php - About 1 day to fix

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

                          public function _fix_sql_php($sql_php)
                          {
                              $innodb_has_fulltext = self::_innodb_has_fulltext();
                              if ( ! $innodb_has_fulltext) {
                                  // Remove fulltext indexes from db structure before creating table
                      Severity: Major
                      Found in .dev/tests/functional/model/class_model_sakila_test.Test.php and 1 other location - About 1 day to fix
                      .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php on lines 35..67

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

                      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 _fix_sql_php($sql_php)
                          {
                              $innodb_has_fulltext = self::_innodb_has_fulltext();
                              if ( ! $innodb_has_fulltext) {
                                  // Remove fulltext indexes from db structure before creating table
                      .dev/tests/functional/model/class_model_sakila_test.Test.php on lines 40..72

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

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

                          public function product_set_edit()
                          {
                              $product_set_id = (int) $_GET['id'];
                              $a = db()->from('shop_product_sets')->whereid($product_set_id)->get();
                      
                      

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

                          protected function _db_import($options, $test)
                          {
                              $_ = $options;
                              $id = $_['id'];
                              $fields = $_['fields'];

                      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