Showing 3,246 of 4,217 total issues

Function checkout_product_revision has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkout_product_revision()
    {
        $_GET['id'] = (int) ($_GET['id']);
        $revision_data = db()->get('SELECT * FROM ' . db('shop_product_revisions') . ' WHERE id=' . $_GET['id']);
        if (empty($revision_data)) {

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

    public function checkout_order_revision()
    {
        $_GET['id'] = (int) ($_GET['id']);
        $revision_data = db()->get('SELECT * FROM ' . db('shop_order_revisions') . ' WHERE id=' . $_GET['id']);
        if (empty($revision_data)) {

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

    protected function _save_csv($file_name, $data = null)
    {
        // setlocale( LC_ALL, 'ru_RU.utf8' )
        // || setlocale( LC_ALL, 'ru_UA.utf8' )
        // || setlocale( LC_ALL, 'en_US.utf8' );

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

    public function find_ids()
    {
        no_graphics(true);
        if ( ! $_POST || ! main()->USER_ID || IS_ADMIN != 1/* || !strlen($_POST['param'])*/) {
            echo '';
Severity: Minor
Found in plugins/dynamic/modules/dynamic/yf_dynamic_find.class.php - About 45 mins 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 scan_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function scan_dir($server_info = [], $start_dir = '', $pattern_include = '', $pattern_exclude = '', $level = 0, $single_file = '')
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 45 mins to fix

    Method upload_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
    Severity: Minor
    Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 45 mins to fix

      Function clear_pattern_child_process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function clear_pattern_child_process()
          {
              if ( ! isset($_GET['id']) && (int) ($_GET['id'])) {
                  return t('Empty clear pattern 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 _order_validate_delivery has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _order_validate_delivery()
          {
              $_POST['exp_date'] = $_POST['exp_date_mm'] . $_POST['exp_date_yy'];
      
              $force_ship_type = module('shop')->FORCE_GROUP_SHIP[module('shop')->USER_GROUP];
      Severity: Minor
      Found in plugins/shop/modules/shop/yf_shop__order_validate_delivery.class.php - About 45 mins 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 _basket_save has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _basket_save()
          {
              if ( ! empty($_POST['quantity']) && ! module('shop')->_basket_is_processed) {
                  module('shop')->_basket_api()->clean();
                  $products_ids = [];
      Severity: Minor
      Found in plugins/shop/modules/shop/yf_shop__basket_save.class.php - About 45 mins 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 new_revision has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function new_revision($function, $ids, $db_table)
          {
              if (empty($function) || empty($ids) || empty($db_table)) {
                  return false;
              }
      Severity: Minor
      Found in plugins/shop/admin_modules/yf_manage_shop_revisions.class.php - About 45 mins 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 download_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function download_dir($server_info = [], $remote_dir = '', $local_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
      Severity: Minor
      Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 45 mins to fix

        Function _init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _init()
            {
                if ($this->USE_LOCKING) {
                    $this->LOCK_FILE_NAME = STORAGE_PATH . $this->LOCK_FILE_NAME;
                }
        Severity: Minor
        Found in plugins/site_map/modules/yf_site_map.class.php - About 45 mins 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 upload_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
        Severity: Minor
        Found in plugins/ssh/classes/yf_ssh.class.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ( ! $result) {
                                      _re('Server mail error');
                                  }
          Severity: Major
          Found in plugins/user/modules/yf_get_pswd.class.php - About 45 mins to fix

            Function _auto_update_items_orders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _auto_update_items_orders($cat_id)
                {
                    if ( ! $cat_id) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 45 mins 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 scan_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function scan_dir($server_info = [], $start_dir = '', $pattern_include = '', $pattern_exclude = '', $level = 0, $single_file = '')
            Severity: Minor
            Found in plugins/ssh/classes/yf_ssh.class.php - About 45 mins to fix

              Function _order_step_do_payment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _order_step_do_payment($FORCE_DISPLAY_FORM = false)
                  {
                      $basket_contents = module('shop')->_basket_api()->get_all();
              
                      if (module('shop')->FORCE_PAY_METHOD) {
              Severity: Minor
              Found in plugins/shop/modules/shop/yf_shop__order_step_do_payment.class.php - About 45 mins 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 download_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function download_dir($server_info = [], $remote_dir = '', $local_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
              Severity: Minor
              Found in plugins/ssh/classes/yf_ssh.class.php - About 45 mins to fix

                Function _get_parents_for_select has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function _get_parents_for_select($lang, $skip_id = null)
                    {
                        $data = [0 => '-- TOP --'];
                        foreach ((array) $this->_recursive_get_items($lang) as $id => $info) {
                            if (empty($id)) {
                Severity: Minor
                Found in plugins/content/admin_modules/yf_manage_faq.class.php - About 45 mins 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 chart has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function chart($data, $params)
                    {
                        if ($params['flash'] == true) {
                            return $this->chart_flash($data, $params);
                        }
                Severity: Minor
                Found in plugins/charts/classes/yf_charts.class.php - About 45 mins 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