Showing 4,218 of 4,218 total issues

Function _check_profile_url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_profile_url($CUR_VALUE = '', $force_value_to_check = null, $name_in_form = 'profile_url')
    {
        // TODO: rewrite me
        $TEXT_TO_CHECK = $_POST[$name_in_form];
        // Override value to check
Severity: Minor
Found in classes/yf_validate.class.php - About 25 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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function is_unique($in, $params = [])
    {
        if ( ! $in) {
            return true;
        }
Severity: Minor
Found in classes/yf_validate.class.php - About 25 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 required has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function required($in)
    {
        if (is_array($in)) {
            $func = __FUNCTION__;
            foreach ($in as $v) {
Severity: Minor
Found in classes/yf_validate.class.php - About 25 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 data_get_latest_icons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function data_get_latest_icons()
{
    $url = 'http://fontawesome.io/cheatsheet/';
    $f2 = __DIR__ . '/' . basename($url);
    if (!file_exists($f2)) {
Severity: Minor
Found in .dev/scripts/fontawesome_icons/get_latest_icons.php - About 25 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 exists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function exists($in, $params = [])
    {
        if ( ! $in) {
            return false;
        }
Severity: Minor
Found in classes/yf_validate.class.php - About 25 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 get_all_submodules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_all_submodules($section = 'all')
    {
        $data = [];
        $submodules = (array) _class('core_api')->get_submodules($section);
        foreach ($submodules as $_section => $modules) {
Severity: Minor
Found in .dev/samples/classes/sample_core_api.class.php - About 25 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 test_yf_db_installer_create_missing_table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_yf_db_installer_create_missing_table()
    {
        $bak['ERROR_AUTO_REPAIR'] = self::db()->ERROR_AUTO_REPAIR;
        self::db()->ERROR_AUTO_REPAIR = true;

Severity: Minor
Found in .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php - About 25 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 my_explode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function my_explode($string = '', $divider = PHP_EOL)
    {
        $result = explode($divider, trim($string));
        foreach ((array) $result as $k => $v) {
            $v = trim($v);
Severity: Minor
Found in functions/yf_common_funcs.php - About 25 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 _basic_auth_check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function _basic_auth_check($users = [])
{
    $auth_user = trim($_SERVER['PHP_AUTH_USER']);
    $auth_pswd = trim($_SERVER['PHP_AUTH_PW']);
    if ( ! strlen($auth_user) || ! strlen($auth_pswd)) {
Severity: Minor
Found in functions/yf_basic_auth.php - About 25 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 debug has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function debug($name = null, $new_value = null, $max_items = 500)
    {
        $arr_name = 'DEBUG';
        if ($max_items && $new_value !== null && substr($name, -2) == '[]') {
            $v = conf(substr($name, 0, -2), null, $arr_name);
Severity: Minor
Found in functions/yf_conf.php - About 25 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 _debug_auth_check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function _debug_auth_check($users = [])
{
    $auth_user = trim($_SERVER['PHP_AUTH_USER']);
    $auth_pswd = trim($_SERVER['PHP_AUTH_PW']);
    if ( ! strlen($auth_user) || ! strlen($auth_pswd)) {
Severity: Minor
Found in functions/yf_debug.php - About 25 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 array_dot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function array_dot($array, $prepend = '')
    {
        $results = [];
        foreach ($array as $key => $value) {
            if (is_array($value)) {
Severity: Minor
Found in functions/yf_array_funcs.php - About 25 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 _htmlchars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function _htmlchars($str = '')
    {
        if (is_array($str)) {
            foreach ((array) $str as $k => $v) {
                $str[$k] = _htmlchars($v);
Severity: Minor
Found in functions/yf_common_funcs.php - About 25 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 array_pluck has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function array_pluck($array, $value, $key = null)
    {
        $results = [];
        foreach ($array as $item) {
            $itemValue = is_object($item) ? $item->{$value} : $item[$value];
Severity: Minor
Found in functions/yf_array_funcs.php - About 25 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 obj2arr has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function obj2arr(&$obj)
    {
        $obj = (array) $obj;
        foreach ($obj as &$v) {
            if (is_array($v)) {
Severity: Minor
Found in functions/yf_common_funcs.php - About 25 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 array_forget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function array_forget(&$array, $key)
    {
        $keys = explode('.', $key);
        while (count((array) $keys) > 1) {
            $key = array_shift($keys);
Severity: Minor
Found in functions/yf_array_funcs.php - About 25 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 __call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function __call($name, $arguments)
        {
            if ( ! $this->_silent) {
                trigger_error($this->_o_name . '(): missing object method: ' . $name . ($this->_c_name ? ' for class: ' . $this->_c_name : ''), E_USER_WARNING);
                if (function_exists('trace') && function_exists('is_console') && is_console()) {
Severity: Minor
Found in functions/yf_aliases.php - About 25 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