Showing 3,246 of 4,217 total issues

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

    protected function _user_message($options = null)
    {
        $url = &$this->url;
        // import operation
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_deposit.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_vars_from_files has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_vars_from_files($lang)
    {
        $files = [];
        // Auto-find shared language vars. They will be connected in order of file system
        // Names can be any, but better to include lang name into file name. Examples:
Severity: Minor
Found in plugins/locale/admin_modules/yf_locale_editor.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 button_box has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function button_box($name, $values = [], $selected = '', $extra = [])
    {
        if (is_array($name)) {
            $extra = (array) $extra + $name;
            $name = $extra['name'];
Severity: Minor
Found in plugins/html/classes/yf_html.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 multi_set has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_set(array $data, $ttl = 0)
    {
        if ( ! $this->is_ready()) {
            return null;
        }
Severity: Minor
Found in plugins/memcached/classes/yf_wrapper_memcached.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 set_content has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function set_content($asset_type, $md5, $content_type, $content, $params = [])
    {
        if (isset($this->content[$asset_type][$md5])) {
            return $this->content[$asset_type][$md5];
        }
Severity: Minor
Found in plugins/assets/classes/yf_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 _cached_url_get_mtime has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _cached_url_get_mtime($str = '')
    {
        $url_param = 'yfmt';
        if ( ! $this->CACHE_OUT_ADD_MTIME || ! strlen($str) || false !== strpos($str, $url_param . '=')) {
            return false;
Severity: Minor
Found in plugins/assets/classes/yf_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 _add_panel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _add_panel($options)
    {
        static $count = 1;
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
        // action
Severity: Minor
Found in plugins/payment/modules/yf_payment_test.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 _api_response has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _api_response()
    {
        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 transfer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function transfer($options = null)
    {
        $_ = &$options;
        $is_transaction = isset( $_['is_transaction'] ) ? $_['is_transaction'] : true;
        // check: from, to
Severity: Minor
Found in plugins/payment/classes/yf_payment_api.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 _api_YandexMoney has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _api_YandexMoney($title)
    {
        $php = '';
        $api = _class('payment_api__provider_yandexmoney');
        $methods = [
Severity: Minor
Found in plugins/payment/modules/yf_payment_test.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 _form has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _form($data, $options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_liqpay.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 _amount_payout has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _amount_payout($amount, $currency_id, $method, $is_request = true)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_remote.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 _payout_process has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _payout_process($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 _api_balance has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _api_balance($request, $options)
    {
        // security
        $_request = [];
        foreach (['operation_id', 'amount', 'currency_id', 'provider_id', 'page', 'method_id', 'account', 'name'] as $key) {
Severity: Minor
Found in plugins/payment/modules/yf_payment.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 _form has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _form($data, $options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_privat24.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 _update_status has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _update_status($options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_remote.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_items has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_items()
    {
        $menu_info = db()->query_fetch('SELECT * FROM ' . db('menus') . ' WHERE id=' . (int) ($_GET['id']) . ' OR name="' . db()->es($_GET['id']) . '"');
        if (empty($menu_info)) {
            return _e('No such menu!');
Severity: Minor
Found in plugins/sys/admin_modules/yf_menus_editor.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 __call has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function __call($name, $args)
    {
        $where_prefix = 'where_';
        $scope_prefix = 'scope_';
        $get_prefix = 'get_attr_';
Severity: Minor
Found in plugins/sys/classes/yf_model.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()
    {
        $items = [];

        if (in_array($_GET['object'], [])) {
Severity: Minor
Found in plugins/site_nav_bar/admin_modules/yf_site_nav_bar.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 _admin_link_is_allowed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _admin_link_is_allowed($link = '')
    {
        // Currently this works only for admin section
        if (MAIN_TYPE == 'user') {
            return false;
Severity: Minor
Found in plugins/sys/classes/yf_admin_methods.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

Severity
Category
Status
Source
Language