Showing 4,217 of 4,217 total issues

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

    public function truncate_database($db_name, $extra = [], &$error = false)
    {
        if ( ! strlen($db_name)) {
            $error = 'db_name is empty';
            return false;
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_mysql.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 _process_link_params has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _process_link_params($link, $row = [], $extra = [])
    {
        if ( ! strlen($link) || empty($row) || false === strpos($link, '%')) {
            return $link;
        }
Severity: Minor
Found in plugins/table2/classes/yf_table2.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 footer_link has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function footer_link($name, $link, $extra = [])
    {
        $item = [
            'type' => __FUNCTION__,
            'name' => $name,
Severity: Minor
Found in plugins/table2/classes/yf_table2.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 go has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function go($text = '')
    {
        $cur_page_md5 = md5($_GET['object'] . '%%' . $_GET['action'] . '%%' . $_GET['id']);
        // Verify and send email
        if ( ! empty($_POST['go'])) {
Severity: Minor
Found in plugins/common/classes/common/yf_email_page.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 _display_preview has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _display_preview($params = [], $template = '')
    {
        $replace = $params['replace'];
        $PARENT_OBJECT = $_REQUEST['parent_object'];
        $PARENT_ACTION = $_REQUEST['parent_action'];
Severity: Minor
Found in plugins/common/classes/common/yf_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 _get_oauth_header has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_oauth_header($url, $params, $method = 'POST', $oauth_token_secret = '', $add_to_sign = [])
    {
        if ( ! is_array($params)) {
            $params = [];
        }
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver1.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 _init has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        // Set found paths
        if (empty($this->FOUND_NETPBM_PATH) && defined('NETPBM_PATH') && NETPBM_PATH != '') {
            $this->FOUND_NETPBM_PATH = NETPBM_PATH;
Severity: Minor
Found in plugins/common/classes/common/yf_image_manip.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_suggesting_messages has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_suggesting_messages()
    {
        $admin_modules = module('admin_modules')->_get_modules();
        $user_modules_methods = module('admin_modules')->_get_methods(['private' => '1']);

Severity: Minor
Found in plugins/admin_home/admin_modules/yf_admin_home.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_old has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_old()
    {
        // Path to project.conf.php
        $proj_conf_path = INCLUDE_PATH . 'project_conf.php';

Severity: Minor
Found in plugins/admin_home/admin_modules/yf_admin_home.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 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
    Severity
    Category
    Status
    Source
    Language