Showing 3,246 of 4,217 total issues

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

    public function _add_bundle($_content, $_params = [])
    {
        if ( ! $_content) {
            return false;
        }
Severity: Minor
Found in plugins/assets/classes/yf_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 api_payout has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function _delete($params = [])
    {
        if (empty(main()->USER_ID) && MAIN_TYPE_USER) {
            return _error_need_login();
        }
Severity: Minor
Found in plugins/comments/modules/comments/yf_comments_manage.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 remote_file_size has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function remote_file_size($url = '')
    {
        $url = $this->_fix_url($url);
        $tmp = @parse_url($url);
        $sch = $tmp['scheme'];
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.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 multi_set has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_set($data = [], $ttl = 0)
    {
        $do_real_work = true;
        if ( ! $this->_driver_ok || $this->NO_CACHE) {
            $do_real_work = false;
Severity: Minor
Found in plugins/cache/classes/yf_cache.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 connect has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function connect()
    {
        $this->db_connect_id = mysqli_init();
        if ( ! $this->db_connect_id || mysqli_connect_errno()) {
            $this->_connect_error = 'cannot_connect_to_server';
Severity: Minor
Found in plugins/db/classes/db/yf_db_driver_mysqli.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 del_by_prefix has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function del_by_prefix($prefix = '')
    {
        $do_real_work = true;
        if ( ! $this->_driver_ok) {
            $do_real_work = false;
Severity: Minor
Found in plugins/cache/classes/yf_cache.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 _show_info_items has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_info_items()
    {
        // Array of text fields
        $text_fields = [
            'name' => 'Name',
Severity: Minor
Found in plugins/user/modules/yf_user_profile.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 products_show has a Cognitive Complexity of 26 (exceeds 5 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: Minor
Found in plugins/shop/modules/shop/yf_shop_products_show.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 attribute_edit has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function attribute_edit()
    {
        if (empty($_GET['id'])) {
            return _e('no id');
        }

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

    public function _show_auto_table($items = [], $params = [], $name = '')
    {
        if ( ! is_array($items)) {
            $items = [];
        }
Severity: Minor
Found in classes/yf_debug.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

Method product_clone has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function product_clone()
    {
        $_GET['id'] = (int) ($_GET['id']);
        if ($_GET['id']) {
            $a = $this->_get_product($_GET['id']);

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

    <?php
    
    /**
     * Dashboards2 management.
     *
    Severity: Minor
    Found in plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php - About 3 hrs to fix

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

      <?php
      
      class yf_manage_currency
      {
          public $load_provider = [
      Severity: Minor
      Found in plugins/payment/admin_modules/yf_manage_currency.class.php - About 3 hrs to fix

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

            public function _data($id)
            {
                if (strpos($id, ':')) {
                    $id = array_map([$this, 'id'], explode(':', $id));
                    return [
        Severity: Major
        Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 3 hrs to fix

          File sys_log_user_errors.sql_php.php has 320 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          return [
              'fields' => [
                  'id' => [
          Severity: Minor
          Found in plugins/logs/share/db/sql_php/sys_log_user_errors.sql_php.php - About 3 hrs to fix

            yf_db_utils_mysql has 30 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class yf_db_utils_mysql extends yf_db_utils_driver
            {
                public function _get_supported_field_types()
                {
                    return [
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_utils_mysql.class.php - About 3 hrs to fix

              yf_db_driver_mysqli has 30 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class yf_db_driver_mysqli extends yf_db_driver
              {
                  /** @var @conf_skip */
                  public $db_connect_id = null;
                  /** @var string */
              Severity: Minor
              Found in plugins/db/classes/db/yf_db_driver_mysqli.class.php - About 3 hrs to fix

                yf_dir has 30 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class yf_dir
                {
                    /** @var bool */
                    public $CHECK_IF_READABLE = true;
                    /** @var bool */
                Severity: Minor
                Found in classes/yf_dir.class.php - About 3 hrs to fix

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

                  <?php
                  
                  class yf_manage_faq
                  {
                      const table = 'faq';
                  Severity: Minor
                  Found in plugins/content/admin_modules/yf_manage_faq.class.php - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language