Showing 3,246 of 4,217 total issues

Function _framework_destruct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _framework_destruct()
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        // Restore startup working directory
        chdir($this->_CWD);
Severity: Minor
Found in classes/yf_main.class.php - About 35 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 rglob has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function rglob($folder, $pattern = '*')
    {
        $folder = rtrim($folder, '/');
        if (false === strpos($pattern, '[')) {
            $pattern = $this->_sql_regcase($pattern);
Severity: Minor
Found in classes/yf_dir.class.php - About 35 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 load_db_class has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function load_db_class()
{
    static $_loaded_class;
    if ($_loaded_class) {
        return $_loaded_class;
Severity: Minor
Found in .dev/samples/db_funcs.php - About 35 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_languages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function data_get_latest_languages()
{
    $url = 'https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes';
    $f2 = __DIR__ . '/' . basename($url) . '.table.html';
    if (!file_exists($f2)) {
Severity: Minor
Found in .dev/scripts/languages/get_latest_languages.php - About 35 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 _check_birth_date has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_birth_date($CUR_VALUE = '')
    {
        // TODO: rewrite me
        $_POST['birth_date'] = $CUR_VALUE;

Severity: Minor
Found in classes/yf_validate.class.php - About 35 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 scan has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function scan($path)
    {
        global $phar, $baselen, $total;

        foreach (glob($path . '/' . $this->mask) as $file) {
Severity: Minor
Found in .dev/scripts/phar_create.php - About 35 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 phone_cleanup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function phone_cleanup($in, $params = [], $fields = [], &$error = '')
    {
        $error = false;
        $country_prefix = $params['param'] ?: '38';
        $p_len = strlen($country_prefix);
Severity: Minor
Found in classes/yf_validate.class.php - About 35 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 process_example has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process_example() {
        $libs_root = $this->libs_root;
        $example = $this->example;
        if (!is_callable($example)) {
            return false;
Severity: Minor
Found in services/_yf_autoloader.php - About 35 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_services has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_services()
    {
        $services = [];
        $suffix = '.php';
        $dir = 'share/services/';
Severity: Minor
Found in .dev/samples/classes/sample_services.class.php - About 35 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_properties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_all_properties($section = 'all')
    {
        $data = [];
        foreach (_class('core_api')->get_properties($section) as $module => $props) {
            $i++;
Severity: Minor
Found in .dev/samples/classes/sample_core_api.class.php - About 35 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_urls_from_css has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function get_urls_from_css($css)
{
    preg_match_all('~url\([\']?(?P<url>.*?)[\']?\)~ims', $css, $m);
    $urls = [];
    foreach ((array) $m['url'] as $url) {
Severity: Minor
Found in .dev/scripts/assets/assets_cache_sync.php - About 35 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_basic has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_yf_db_installer_basic()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
Severity: Minor
Found in .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php - About 35 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 db_query has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function &db_query($sql = '', $db_connection = false)
{
    if ( ! $db_connection) {
        db_connect();
        $db_connection = $GLOBALS['_db_connection'];
Severity: Minor
Found in .dev/scripts/change_db_prefix.php - About 35 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_sql_to_php_sakila has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public static function _need_skip_test($name)
    {
        if (main()->is_hhvm()) {
            if (in_array($name, ['test_drop_database', 'test_create_database', 'test_rename_database'])) {
                return true;
Severity: Minor
Found in .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php - About 35 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_resize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_resize()
    {
        if (getenv('CI') == 'jenkins') {
            $this->markTestSkipped('Right now we skip this test, when running inside Jenkins.');
        }
Severity: Minor
Found in .dev/tests/unit/class_images_test.Test.php - About 35 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 _do_compress_php_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _do_compress_php_file($file_to_open = '', $file_to_save = '')
{
    $source = file_get_contents($file_to_open);
    // Removes comments
    foreach ((array) token_get_all($source) as $token) {
Severity: Minor
Found in .dev/useful/pack_zend.php - About 35 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 _do_compress_php_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _do_compress_php_file($file_to_open = '', $file_to_save = '')
{
    $source = file_get_contents($file_to_open);
    // Removes comments
    foreach ((array) token_get_all($source) as $token) {
Severity: Minor
Found in .dev/useful/php_compressor.php - About 35 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_do has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_do()
    {
        ini_set('default_socket_timeout', $this->TIMEOUT);

        $data = require YF_PATH . '.dev/scripts/assets/assets_urls_collect.php';
Severity: Minor
Found in .dev/tests/integration/assets_urls_check_test.Test.php - About 35 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_remove_from_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _debug_remove_from_url($uri = '', $qs = '')
{
    if (empty($uri)) {
        $uri = $_SERVER['REQUEST_URI'];
    }
Severity: Minor
Found in functions/yf_debug.php - About 35 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