Showing 3,246 of 4,217 total issues

Function write_file has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function write_file($server_info = [], $local_file = '', $remote_file = '')
    {
        $local_file = trim($local_file);
        $remote_file = _class('ssh')->_prepare_path($remote_file);
        if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($local_file) || ! strlen($remote_file)) {
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 1 hr 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 _prepare_for_box has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _prepare_for_box($cat_items = [], $with_all = true, $parent_item_id = 0, $all = false)
    {
        if ( ! empty($cat_items) && is_string($cat_items)) {
            $cat_items = $this->_get_items_array($cat_items);
        }
Severity: Minor
Found in plugins/categories/classes/yf_cats.class.php - About 1 hr 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 preview has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function preview($extra = [])
    {
        conf('ROBOTS_NO_INDEX', true);
        no_graphics(true);
        if (main()->USER_ID != 1) {
Severity: Minor
Found in plugins/dynamic/modules/dynamic/yf_dynamic_preview.class.php - About 1 hr 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 quick_menu has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function quick_menu()
    {
        if ( ! $this->QUICK_MENU_ENABLED
            || (MAIN_TYPE_USER && ( ! isset($_SESSION['user_id']) || ! $_SESSION['user_id']))
            || (MAIN_TYPE_ADMIN && ( ! isset($_SESSION['admin_id']) || ! $_SESSION['admin_id']))
Severity: Minor
Found in classes/yf_graphics.class.php - About 1 hr 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 tail has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function tail($file, $lines = 10)
    {
        if ( ! $file || ! file_exists($file)) {
            return false;
        }
Severity: Minor
Found in classes/yf_dir.class.php - About 1 hr 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_edit_widget_items has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_edit_widget_items($column_items = [], $ds = [])
    {
        $items_configs = $ds['data']['items_configs'];
        $ds_settings = $ds['data']['settings'];

Severity: Minor
Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 1 hr 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 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        $docs = _class('docs');
        $dir = $docs->demo_dir;
        $dir_len = strlen($dir);
Severity: Minor
Found in .dev/samples/classes/sample_demo.class.php - About 1 hr 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 test_php_to_sql_db_installer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_php_to_sql_db_installer()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
Severity: Minor
Found in .dev/tests/unit/db/class_db_ddl_parser_mysql_test.Test.php - About 1 hr 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 test_sql_to_php_db_installer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_sql_to_php_db_installer()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
Severity: Minor
Found in .dev/tests/unit/db/class_db_ddl_parser_mysql_test.Test.php - About 1 hr 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 apache_request_headers has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    function apache_request_headers()
    {
        $arh = [];
        $rx_http = '/\AHTTP_/';
        foreach ($_SERVER as $key => $val) {
Severity: Minor
Found in functions/yf_compat_funcs.php - About 1 hr 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 combine has 43 lines of code (exceeds 25 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 1 hr to fix

    Method get_asset has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_asset($name, $asset_type, $version = '')
        {
            if ( ! $name) {
                return null;
            }
    Severity: Minor
    Found in plugins/assets/classes/yf_assets.class.php - About 1 hr to fix

      Method _api_response has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _api_response($options)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              /*
      Severity: Minor
      Found in plugins/payment/classes/yf_payment_api__provider_bitpay.class.php - About 1 hr to fix

        Method _form has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _form($data, $options = null)
            {
                if ( ! $this->ENABLE) {
                    return  null;
                }
        Severity: Minor
        Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 1 hr to fix

          Method check_all_interkassa has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function check_all_interkassa($options = null)
              {
                  // command line interface
                  $is_cli = (php_sapi_name() == 'cli');
                  $is_cli && $this->_check_all_interkassa_cli();
          Severity: Minor
          Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

            Method _api_provider has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _api_provider($request, $options)
                {
                    $api = _class('api');
                    $payment_api = _class('payment_api');
                    $provider_name = $_GET['name'];
            Severity: Minor
            Found in plugins/payment/modules/yf_payment.class.php - About 1 hr to fix

              Method copy_item2 has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function copy_item2()
                  {
                      if ($_POST['items_to_copy']) {
                          $items = unserialize(urldecode($_POST['items_to_copy']));
                          foreach ((array) $items as $k => $v) {
              Severity: Minor
              Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 1 hr to fix

                Method show_items has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function show_items()
                    {
                        $menu_info = db()->query_fetch('SELECT * FROM ' . db('menus') . ' WHERE id=' . (int) ($_GET['id']) . ' OR name="' . db()->es($_GET['id']) . '"');
                        if (empty($menu_info)) {
                            return _e('No such menu!');
                Severity: Minor
                Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 1 hr to fix

                  Method _cleanup_menu_items has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _cleanup_menu_items($menu_items = [])
                      {
                          $center_block_id = _class('graphics')->_get_center_block_id();
                  
                          $out = [];
                  Severity: Minor
                  Found in plugins/sys/classes/yf_core_menu.class.php - About 1 hr to fix

                    Method _load_tables_sql_php_from_files has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _load_tables_sql_php_from_files($params = [])
                        {
                            $existing_files_sql_php = [];
                            $existing_sql_php = [];
                            // Preload db installer PHP array of CREATE TABLE DDL statements
                    Severity: Minor
                    Found in plugins/db/classes/db/yf_db_migrator.class.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language