Showing 4,217 of 4,217 total issues

Function change_location has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
Open

    public function change_location()
    {
        if ( ! main()->USE_GEO_IP) {
            return false;
        }
Severity: Minor
Found in plugins/geo/modules/yf_geo_content.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

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

    public function _get_info($id = null, $lang = null)
    {
        $id = isset($id) ? $id : $_GET['id'];
        $lang = isset($lang) ? $lang : $_GET['page'];
        $a = db()->from(self::table)
Severity: Major
Found in plugins/static_pages/admin_modules/yf_static_pages.class.php and 1 other location - About 1 day to fix
plugins/content/admin_modules/yf_manage_tips.class.php on lines 138..172

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

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 _get_info($id = null, $lang = null)
    {
        $id = isset($id) ? $id : $_GET['id'];
        $lang = isset($lang) ? $lang : $_GET['page'];
        $a = db()->from(self::table)
Severity: Major
Found in plugins/content/admin_modules/yf_manage_tips.class.php and 1 other location - About 1 day to fix
plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 236..270

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

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

<?php

/**
 * Shop managing module.
 */
Severity: Major
Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 1 day to fix

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

    <?php
    
    class yf_manage_shop_orders
    {
        public function _init()

      yf_payment_api has 85 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class yf_payment_api
      {
          public $user_id_default = null;
          public $user_id = null;
      
      
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api.class.php - About 1 day to fix

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

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

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

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

            Function _filter_sql_prepare has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _filter_sql_prepare($filter_data = [], $filter_params = [], $__sql = '', $table = null)
                {
                    if ( ! $filter_data) {
                        return '';
                    }
            Severity: Minor
            Found in plugins/table2/classes/table2/yf_table2_filter.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

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

                public function load__p24_json($options = null)
                {
                    // import options
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                    // var
            Severity: Major
            Found in plugins/payment/classes/yf_payment_api__currency.class.php and 1 other location - About 1 day to fix
            plugins/payment/classes/yf_payment_api__currency.class.php on lines 465..515

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

            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 load__cashex_json($options = null)
                {
                    // import options
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                    // var
            Severity: Major
            Found in plugins/payment/classes/yf_payment_api__currency.class.php and 1 other location - About 1 day to fix
            plugins/payment/classes/yf_payment_api__currency.class.php on lines 357..407

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

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

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

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

              <?php
              
              _class('payment_api__provider_remote');
              
              class yf_payment_api__provider_perfectmoney extends yf_payment_api__provider_remote

                File yf_aliases.php has 687 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                ///////////////////////////////////
                // Aliases for often used methods
                ///////////////////////////////////
                Severity: Major
                Found in functions/yf_aliases.php - About 1 day to fix

                  Function _try_to_find_libs has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _try_to_find_libs()
                      {
                          if ( ! $this->AUTO_FIND_PATHS) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/common/classes/common/yf_image_manip.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

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

                      public function _get_lang_links($cur_lang = null, $cur_name = null, $link_for = 'edit')
                      {
                          asset('bfh-select');
                          $this->lang_def_country = main()->get_data('lang_def_country');
                  
                  
                  plugins/content/admin_modules/yf_manage_tips.class.php on lines 110..132
                  plugins/email/admin_modules/yf_manage_emails.class.php on lines 284..306

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

                  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 3 locations. Consider refactoring.
                  Open

                      public function _get_lang_links($cur_lang = null, $cur_name = null, $link_for = 'edit')
                      {
                          asset('bfh-select');
                          $this->lang_def_country = main()->get_data('lang_def_country');
                  
                  
                  Severity: Major
                  Found in plugins/content/admin_modules/yf_manage_tips.class.php and 2 other locations - About 1 day to fix
                  plugins/email/admin_modules/yf_manage_emails.class.php on lines 284..306
                  plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 294..316

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

                  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 3 locations. Consider refactoring.
                  Open

                      public function _get_lang_links($cur_lang = null, $cur_name = null, $link_for = 'edit')
                      {
                          asset('bfh-select');
                          $this->lang_def_country = main()->get_data('lang_def_country');
                  
                  
                  Severity: Major
                  Found in plugins/email/admin_modules/yf_manage_emails.class.php and 2 other locations - About 1 day to fix
                  plugins/content/admin_modules/yf_manage_tips.class.php on lines 110..132
                  plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 294..316

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

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

                      public function _get_template_file($file_name = '', $force_storage = '', $JUST_CHECK_IF_EXISTS = false, $RETURN_TEMPLATE_PATH = false)
                      {
                          $string = false;
                          $NOT_FOUND = false;
                          $storage = 'inline';
                  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 sample_html.class.php has 675 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  class sample_html
                  {
                      /***/
                  Severity: Major
                  Found in .dev/samples/classes/sample_html.class.php - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language