Showing 3,246 of 4,217 total issues

Function _check has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check($input = [], $user_info = [])
    {
        // Default banned status
        $BANNED_STATUS = false;
        // Nothing to check
Severity: Minor
Found in plugins/common/classes/common/yf_user_ban.class.php - About 3 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 allow has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function allow()
    {
        if ( ! $this->LOGGING || MAIN_TYPE_ADMIN) {
            return false;
        }
Severity: Minor
Found in plugins/logs/classes/logs/yf_logs_exec_user.class.php - About 3 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 _skip_by_pattern has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function _skip_by_pattern($path = '', $_type = 'f', $pattern_include = '', $pattern_exclude = '')
    {
        if ( ! $path) {
            return false;
        }
Severity: Minor
Found in plugins/ssh/classes/yf_ssh.class.php - About 3 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 mkdir_m has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function mkdir_m($dir_name, $dir_mode = 0755, $create_index_htmls = 0, $start_folder = '')
    {
        if ( ! $dir_name || ! strlen($dir_name)) {
            return 0;
        }
Severity: Minor
Found in classes/yf_dir.class.php - About 3 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 data_get_latest_currencies has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

function data_get_latest_currencies()
{
    $url = 'http://www.currency-iso.org/dam/downloads/table_a1.xml';
    $f = __DIR__ . '/' . basename($url);
    if (!file_exists($f)) {
Severity: Minor
Found in .dev/scripts/currencies/get_latest_currencies.php - About 3 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_response has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _api_response()
    {
        if ( ! $this->ENABLE) {
            return  null;
        }

    Method get_remote_page has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_remote_page($url = '', $cache_ttl = -1, $url_options = [], &$requests_info = [])
        {
            if (empty($url)) {
                return false;
            }
    Severity: Major
    Found in plugins/common/classes/common/yf_remote_files.class.php - About 3 hrs to fix

      Method go has 97 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function go($source_file_path = '', $dest_file_path = '', $LIMIT_X = -1, $LIMIT_Y = -1, $watermark_path = '', $ext = '')
          {
              $_prev_num_errors = count((array) main()->_all_core_error_msgs);
              $LIMIT_X = (int) ($LIMIT_X != -1 ? $LIMIT_X : THUMB_WIDTH);
              $LIMIT_Y = (int) ($LIMIT_Y != -1 ? $LIMIT_Y : THUMB_HEIGHT);
      Severity: Major
      Found in plugins/common/classes/common/yf_make_thumb.class.php - About 3 hrs to fix

        Method _data has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _data()
            {
                $_sub_action = [
                    '0' => '- не выбрано -',
                    'add' => 'добавить',

          Method test_xss_clean has 97 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function test_xss_clean()
              {
                  $this->assertEquals(_class('security')->xss_clean('script'), 'script');
                  $this->assertEquals(_class('security')->xss_clean('<script'), '&lt;script');
                  $this->assertEquals(_class('security')->xss_clean('<img src="javascript:alert(document.cookie)" />'), '<img  />');
          Severity: Major
          Found in .dev/tests/unit/class_security_test.Test.php - About 3 hrs to fix

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

            <?php
            
            return [
              1 => [
                'id' => '1',
            Severity: Minor
            Found in .dev/install/installer_data/db_tables/states.data.php - About 3 hrs to fix

              Method _prepare_invoice_body has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _prepare_invoice_body($order_id = false)
                  {
                      $_class_price = $this->_class_price;
                      $_class_units = $this->_class_units;
                      $_class_region = $this->_class_region;

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

                <?php
                
                /**
                 * High level html emails wrapper.
                 */
                Severity: Minor
                Found in plugins/email/classes/yf_email.class.php - About 3 hrs to fix

                  Method _set_curl_options has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _set_curl_options($url_options = [], $is_ftp_url = false)
                      {
                          $curl_opts = [];
                  
                          $user_agent = isset($url_options['user_agent']) ? $url_options['user_agent'] : $this->DEF_USER_AGENT;
                  Severity: Major
                  Found in plugins/common/classes/common/yf_remote_files.class.php - About 3 hrs to fix

                    Method _show has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _show($params = [])
                        {
                    
                            // Set cookie
                            if (empty($_COOKIE['advertise']) && $_GET['ads_places'] == 1) {
                    Severity: Major
                    Found in plugins/common/modules/yf_advertising.class.php - About 3 hrs to fix

                      Method products_show has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function products_show($search = '', $str_search = '')
                          {
                              foreach ((array) module('shop')->_shop_cats as $_cat_id => $_cat_name) {
                                  if ($_GET['id'] == module('shop')->_shop_cats_all[$_cat_id]['url'] && $_GET['id'] != '') {
                                      $_GET['id'] = $_cat_id;
                      Severity: Major
                      Found in plugins/shop/modules/shop/yf_shop_products_show.class.php - About 3 hrs to fix

                        Method _external_response has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _external_response($options)
                            {
                                $operation_id = $options['operation_id'];
                                $payment_code = $options['code'] ?: '';
                                $address = $options['address'] ?: '';
                        Severity: Major
                        Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 3 hrs to fix

                          Function user_vars has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function user_vars()
                              {
                                  if (isset($_GET['id']) && ! isset($_GET['page'])) {
                                      $_GET['page'] = $_GET['id'];
                                      $_GET['id'] = null;

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

                              public function combine()
                              {
                                  $assets = clone _class('assets');
                                  $assets->clean_all();
                                  $assets->ADD_IS_DIRECT_OUT = false;
                          Severity: Minor
                          Found in plugins/assets/admin_modules/yf_manage_assets.class.php - About 3 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 form_row has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function form_row($content, $extra = [], $replace = [], $form)
                              {
                                  $name = $extra['name'];
                                  $is_html_array = (false !== strpos($name, '['));
                                  if ($is_html_array) {
                          Severity: Minor
                          Found in plugins/html/classes/html5fw/yf_html5fw_bs3.class.php - About 3 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

                          Severity
                          Category
                          Status
                          Source
                          Language