Showing 3,246 of 4,217 total issues

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

<?php

class yf_manage_emails
{
    const table = 'emails_templates';
Severity: Minor
Found in plugins/email/admin_modules/yf_manage_emails.class.php - About 2 hrs to fix

    Function _operation has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _operation($options = null)
        {
            // import options
            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
            // var
    Severity: Minor
    Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 2 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 _parse_sources has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _parse_sources($params = [])
        {
            $files = [];
            if ($params['include_framework']) {
                $params['find_php'] && $files['framework']['php'] = $this->_scan_files('framework', 'php', $params);

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

        public function _is_current_page($item)
        {
            $object = $_GET['object'];
            $action = $_GET['action'];
            $id = $_GET['id'];
    Severity: Minor
    Found in plugins/sys/classes/yf_core_menu.class.php - About 2 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 _compile_prepare_cond has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _compile_prepare_cond($cond = '', $for_right = false)
        {
            $cond = trim($cond);
            $_array_magick = [
                '_key' => '$_k',
    Severity: Minor
    Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 2 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 display_what has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function display_what()
        {
            $hooks_data = _class('admin_methods')->call_hooks('settings', $r);
            $avail_hook_modules = [];
            foreach ((array) $hooks_data as $k => $v) {
    Severity: Minor
    Found in plugins/conf/admin_modules/yf_settings.class.php - About 2 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 validate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function validate($validate_rules = [], $post = [], $extra = [])
        {
            $this->_validate_prepare($validate_rules, $extra);
    
            $func = function ($validate_rules, $post, $extra, $form) {
    Severity: Minor
    Found in plugins/form2/classes/yf_form2.class.php - About 2 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 whereid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function whereid()
        {
            $id = func_get_args();
            $pk = '';
            if (count((array) $id) > 1) {
    Severity: Minor
    Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 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 load_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function load_data()
        {
            // Preload db installer SQL CREATE TABLE DDL statements
            $ext = '.sql.php';
            $pattern = '{,plugins/*/}{,share/}db/sql/*' . $ext;
    Severity: Minor
    Found in plugins/db/classes/db/yf_db_installer.class.php - About 2 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 list_keys has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function list_keys()
        {
            $do_real_work = true;
            if ( ! $this->_driver_ok) {
                $do_real_work = false;
    Severity: Minor
    Found in plugins/cache/classes/yf_cache.class.php - About 2 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 http_request has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function http_request($url, $headers = [], $method = 'GET', $data = null, $retry = 3)
        {
            $result = new stdClass();
            // Parse the URL, and make sure we can handle the schema.
            $uri = parse_url($url);
    Severity: Minor
    Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 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_file_size has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function multi_file_size($page_urls, $options = [], $max_threads = 50)
        {
            if (empty($max_threads)) {
                $max_threads = $this->CURL_DEF_MAX_THREADS;
            }
    Severity: Minor
    Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 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 _hook_side_column has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _hook_side_column()
        {
            $custom_class_name = 'sample_' . $_GET['action'];
            $custom_obj = _class_safe($custom_class_name);
            $hook_name = __FUNCTION__;
    Severity: Minor
    Found in plugins/docs/modules/yf_docs.class.php - About 2 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 send has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function send($phone, $text, $params = [])
        {
            if ( ! $this->_is_enabled()) {
                return false;
            }
    Severity: Minor
    Found in plugins/sms/classes/yf_service_turbosms.class.php - About 2 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 _check has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _check($target_user_id = 0, $source_user_id = 0)
        {
            if (empty($source_user_id) && ! empty(main()->USER_ID)) {
                $source_user_id = main()->USER_ID;
            }
    Severity: Minor
    Found in plugins/common/classes/common/yf_multi_accounts.class.php - About 2 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 btn_active has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function btn_active($name = '', $link = '', $extra = [])
        {
            if (is_array($name)) {
                $extra = $name;
                $name = '';
    Severity: Minor
    Found in plugins/table2/classes/yf_table2.class.php - About 2 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 _lst has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _lst($id, $with_root = false)
        {
            $dir = $this->_path($id);
            $res = [];
            foreach (glob(rtrim($dir, '/') . '/*') as $f) {
    Severity: Minor
    Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 2 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 upload_images has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function upload_images()
        {
            $SUPPLIER_ID = $this->SUPPLIER_ID;
            $ADMIN_INFO = db()->query_fetch('SELECT * FROM ' . db('sys_admin') . ' WHERE id=' . (int) (main()->ADMIN_ID));
            $SUPPLIER_INFO = db()->query_fetch('SELECT * FROM ' . db('shop_suppliers') . ' WHERE id=' . (int) $SUPPLIER_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 _init_sftp_phpseclib has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _init_sftp_phpseclib($server_info = [])
        {
            if ( ! $this->DRIVER == 'phpseclib') {
                return false;
            }
    Severity: Minor
    Found in plugins/ssh/classes/yf_ssh.class.php - About 2 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 shell_exec has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function shell_exec($server_info = [], $cmd = '')
        {
            if ( ! $this->_INIT_OK || ! $cmd || ! $server_info) {
                return false;
            }
    Severity: Minor
    Found in plugins/ssh/classes/yf_ssh.class.php - About 2 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