Showing 4,217 of 4,217 total issues

Function get_asset has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_asset($name, $asset_type, $version = '')
    {
        if ( ! $name) {
            return null;
        }
Severity: Minor
Found in plugins/assets/classes/yf_assets.class.php - About 3 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 _get_current_lang has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_current_lang($force = false)
    {
        $langs = $this->LANGUAGES ?: $this->_get_langs();

        $FORCE_LOCALE = conf('FORCE_LOCALE');
Severity: Minor
Found in plugins/locale/classes/yf_i18n.class.php - About 3 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 dd_table has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function dd_table($replace = [], $field_types = [], $extra = [])
    {
        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
        if (DEBUG_MODE) {
            $ts = microtime(true);
Severity: Minor
Found in plugins/html/classes/yf_html.class.php - About 3 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 _combine_content has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _combine_content(array $out, $out_type, array $to_combine, $combined_file, array $md5_inside_combined)
    {
        if ( ! file_exists($combined_file)) {
            $divider = PHP_EOL;
            if ($out_type === 'js') {
Severity: Minor
Found in plugins/assets/classes/yf_assets.class.php - About 3 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 mail has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function mail($options = null)
    {
        // DEBUG
        // ini_set( 'html_errors', 0 );
        // var_dump( $options );
Severity: Minor
Found in plugins/payment/classes/yf_payment_api.class.php - About 3 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 rates has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function csv_ecommpay($options = null)
    {
        $operation_id = &$_POST['operation_id'];
        if ( ! is_array($operation_id) || count($operation_id) < 1) {
            common()->message_info('Отсутствуют данные');
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 3 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 api_payout has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function api_payout($options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }

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

    public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $ONLY_PRIVATE_METHODS = false)
    {
        // TODO: need to add 'site__' and 'adm__' functionality
        $extends_file_path = '';
        $methods = [];
Severity: Minor
Found in plugins/sys/classes/core_api/yf_core_api_user_modules.class.php - About 3 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 api_payout has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function api_payout($options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_payeer.class.php - About 3 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_column_type has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _parse_column_type($str, &$error = false)
    {
        // TODO: use db ddl parser if available for the given db family (mysql currently supported)
        $str = trim($str);
        $type = $length = $decimals = $values = null;
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 3 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 _init has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        $this->REWRITE_PATTERNS = [
            'yf' => _class('rewrite_pattern_yf', 'classes/rewrite/'),
        ];
Severity: Minor
Found in plugins/rewrite/classes/yf_rewrite.class.php - About 3 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 image has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function image($name, $path, $link = '', $extra = [], $table)
    {
        if (is_array($path)) {
            $extra = (array) $extra + $path;
            $path = '';
Severity: Minor
Found in plugins/table2/classes/table2/yf_table2_image.class.php - About 3 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_del has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function view($params = [])
    {
        if ( ! is_array($params)) {
            $params = [];
        }
Severity: Minor
Found in plugins/common/classes/common/yf_dashboards.class.php - About 3 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 _data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _data($id)
    {
        if (strpos($id, ':')) {
            $id = array_map([$this, 'id'], explode(':', $id));
            return [
Severity: Minor
Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 3 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 _db_exists has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _db_exists($name, $options = [])
    {
        $cache = &$this->cache;
        $_ = $options;
        $key = $_['key'];

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

    public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $ONLY_PRIVATE_METHODS = false)
    {
        // TODO: need to add 'site__' and 'adm__' functionality
        $extends_file_path = '';
        $methods = [];
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 3 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 _get_modules_from_files has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
    {
        $modules = [];

        $yf_prefix_len = strlen(YF_PREFIX);
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 3 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 go has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function go()
    {
        if ($this->DEBUG_CONSOLE_HIDDEN) {
            return false;
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 3 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