Showing 3,246 of 4,217 total issues

Function _api_transaction has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public function _api_transaction($options)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_remote.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 _validate_rules_process has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public function _validate_rules_process($validate_rules = [], &$data)
    {
        $validate_ok = true;
        foreach ((array) $validate_rules as $name => $rules) {
            $is_required = false;
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 _request has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public function _request($url, $post = null, $options = null)
    {
        // import options
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
        // options
Severity: Minor
Found in plugins/api/classes/yf_api.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 ajax_validate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public function ajax_validate()
    {
        no_graphics(true);
        header('X-Robots-Tag: noindex, nofollow, noarchive, nosnippet');

Severity: Minor
Found in plugins/dynamic/modules/dynamic/yf_dynamic_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 yf_api.class.php has 509 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/***
 *  module: api
 *
Severity: Major
Found in plugins/api/classes/yf_api.class.php - About 1 day to fix

    Method _operation has 204 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _operation($options = null)
        {
            // var
            $is_valid = true;
            $is_options = true;
    Severity: Major
    Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 day to fix

      Function generate_up has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function generate_up($params = [])
          {
              if ( ! isset($report)) {
                  $report = $this->compare($params);
              }
      Severity: Minor
      Found in plugins/db/classes/db/yf_db_migrator.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 _process has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _process($params = [])
          {
              // THESE ARE REQUIRED!
              $SOURCE_ARRAY = $params['source_array'];
              $TABLE_NAME = $params['table_name'];
      Severity: Minor
      Found in plugins/common/classes/common/yf_related_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

      Function _generate_sitemap has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _generate_sitemap()
          {
              main()->NO_GRAPHICS = true;
              if ( ! $this->SITE_MAP_ENABLED) {
                  return false;
      Severity: Minor
      Found in plugins/site_map/modules/yf_site_map.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

      Method _show_filter has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _show_filter()
          {
              if ( ! in_array($_GET['action'], $this->_avail_filters)) {
                  return false;
              }

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

        <?php
        
        return [
          1 => [
            'id' => '1',
        Severity: Major
        Found in plugins/sys/share/db/data/tips.data.php - About 1 day to fix

          Function show has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
          Open

              public function show($out_type, $params = [])
              {
                  if ( ! $out_type || ! in_array($out_type, $this->supported_out_types)) {
                      throw new Exception('Assets: unsupported out content type: ' . $out_type);
                      return null;
          Severity: Minor
          Found in plugins/assets/classes/yf_assets.class.php - About 7 hrs 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 _get_methods has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _get_methods($params = [])
              {
                  $ONLY_PRIVATE_METHODS = [];
                  if (isset($params['private'])) {
                      $ONLY_PRIVATE_METHODS = $params['private'];
          Severity: Minor
          Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 7 hrs 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 write_string has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
          Open

              public function write_string($server_info = [], $string = '', $remote_file = '')
              {
                  $remote_file = _class('ssh')->_prepare_path($remote_file);
                  if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! $string || ( ! strlen($remote_file) && ! is_array($string))) {
                      return false;
          Severity: Minor
          Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 7 hrs 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

          Method api_payout has 196 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function api_payout($options = null)
              {
                  if ( ! $this->ENABLE) {
                      return  null;
                  }
          Severity: Major
          Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 7 hrs to fix

            Function _recursive_get_menu_items has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _recursive_get_menu_items($menu_id = 0, $skip_item_id = 0)
                {
                    if (empty($menu_id) || empty($this->_menu_items[$menu_id])) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/sys/classes/yf_core_menu.class.php - About 7 hrs 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_model.class.php has 488 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            load('yf_model_result', '', 'classes/model/');
            load('yf_model_relation', '', 'classes/model/');
            
            
            Severity: Minor
            Found in plugins/sys/classes/yf_model.class.php - About 7 hrs to fix

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

              <?php
              
              /**
               * Core content-related methods stored here.
               *
              Severity: Minor
              Found in classes/yf_graphics.class.php - About 7 hrs to fix

                yf_manage_shop_import_products2 has 54 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class yf_manage_shop_import_products2
                {
                    public $import_field = [
                        0 => 'не использовать (0)',
                        'id' => 'идентификатор (id)',

                  class_db_real_utils_pgsql_test has 54 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class class_db_real_utils_pgsql_test extends db_real_abstract
                  {
                      public static function _need_skip_test($name)
                      {
                          return false;
                  Severity: Major
                  Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php - About 7 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language