Showing 3,246 of 4,217 total issues

Function _get_request_headers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_request_headers()
    {
        $arh = [];
        $rx_http = '/(\AHTTP_)/';
        foreach ((array) $_SERVER as $key => $val) {
Severity: Minor
Found in classes/yf_debug.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_welcome has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_welcome()
    {
        // For authorized admins only
        if (MAIN_TYPE_ADMIN) {
            $login_time = $_SESSION['admin_login_time'];
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 __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($type = 'user', $no_db_connect = false, $auto_init_all = false, $_conf = [])
    {
        if ( ! isset($this->_time_start)) {
            $this->_time_start = microtime(true);
        }
Severity: Minor
Found in classes/yf_main.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 resend_code has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function resend_code()
    {
        if ( ! empty($_POST['email'])) {
            $user_info = db()->query_fetch('SELECT * FROM ' . db('user') . ' WHERE email="' . _es($_POST['email']) . '"');
            if (empty($user_info)) {
Severity: Minor
Found in plugins/user/modules/yf_register.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_html has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _prepare_html($text = '', $need_strip_slashes = 1, $use_smart_function = 1)
    {
        if (is_array($text)) {
            foreach ((array) $text as $k => $v) {
                $text[$k] = $this->_prepare_html($v);
Severity: Minor
Found in classes/yf_utils.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 _hook_side_column has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        if ($_GET['object'] != 'manage_dashboards' || ! in_array($_GET['action'], ['edit', 'add'])) {
            return false;
        }
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 xss_clean has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function xss_clean($str, $is_image = false)
    {
        // Is the string an array?
        if (is_array($str)) {
            while (list($key) = each($str)) {
Severity: Minor
Found in classes/yf_security.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 include_module has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function include_module($path_to_module = '', $is_required = false)
    {
        if (DEBUG_MODE) {
            $_time_start = microtime(true);
        }
Severity: Minor
Found in classes/yf_main.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_themes_twbs4 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function get_themes_twbs4()
{
    global $themes_twbs4_file, $twbs_v4;
    $gh_api_url = 'https://api.github.com/repos/thomaspark/bootswatch/contents/dist?ref=v' . $twbs_v4;
    $themes = [];
Severity: Minor
Found in .dev/scripts/assets/assets_cache_sync.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        if ($_GET['id']) {
            return _class('docs')->_show_for($this);
        }
Severity: Minor
Found in .dev/samples/classes/sample_services.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        if ($_GET['id']) {
            return _class('docs')->_show_for($this);
        }
Severity: Minor
Found in .dev/samples/classes/sample_assets.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_themes_twbs5 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function get_themes_twbs5()
{
    global $themes_twbs5_file, $twbs_v5;
    $gh_api_url = 'https://api.github.com/repos/thomaspark/bootswatch/contents/dist?ref=v' . $twbs_v5;
    $themes = [];
Severity: Minor
Found in .dev/scripts/assets/assets_cache_sync.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 _decode_entities has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _decode_entities($prefix, $codepoint, $original, &$table, &$exclude)
    {
        // Named entity
        if ( ! $prefix) {
            if (isset($table[$original])) {
Severity: Minor
Found in classes/yf_utf8.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_themes_twbs3 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function get_themes_twbs3()
{
    global $themes_twbs3_file, $twbs_v3;

    $gh_api_url = 'https://api.github.com/repos/thomaspark/bootswatch/contents/?ref=v' . $twbs_v3;
Severity: Minor
Found in .dev/scripts/assets/assets_cache_sync.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 ssh_exec_all has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function ssh_exec_all($group_name = '', $cmd = '')
    {
        static $server_groups, $server_groups_names, $server_groups, $server_groups_names, $servers, $servers_ids_by_group;
        if (empty($servers)) {
            $server_groups = [];
Severity: Minor
Found in .dev/scripts/ssh_config.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_themes_twbs2 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function get_themes_twbs2()
{
    global $themes_twbs2_file, $twbs_v2;

    $gh_api_url = 'https://api.github.com/repos/thomaspark/bootswatch/contents/?ref=v' . $twbs_v2;
Severity: Minor
Found in .dev/scripts/assets/assets_cache_sync.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_sakila_basic has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_sakila_basic()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
Severity: Minor
Found in .dev/tests/functional/model/class_model_sakila_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 import_demo_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function import_demo_data()
    {
        $lang = $_POST['install_project_lang'];

        $suffix = '.data.php';
Severity: Minor
Found in .dev/install/install.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 class_basename has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function class_basename($class, $prefix = '', $suffix = '')
    {
        $class = is_object($class) ? get_class($class) : $class;
        $class = basename(str_replace('\\', '/', $class));
        $prefixes = [
Severity: Minor
Found in functions/yf_common_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

Function array_get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function array_get($array, $key, $default = null)
    {
        if ($key === null) {
            return $array;
        }
Severity: Minor
Found in functions/yf_array_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

Severity
Category
Status
Source
Language