Showing 3,246 of 4,217 total issues

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

    public function btn_delete($name = '', $link = '', $extra = [])
    {
        if (is_array($name)) {
            $extra = $name;
            $name = '';
Severity: Minor
Found in plugins/table2/classes/yf_table2.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 _phone_cleanup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _phone_cleanup($phone = '', &$error = '')
    {
        $error = false;
        $phone = preg_replace('/[^0-9]+/ims', '', strip_tags($phone));
        // TODO: implement $this->allowed_countries
Severity: Minor
Found in plugins/sms/classes/yf_service_turbosms.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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_user_info()
    {
        $access_token = $this->_storage_get('access_token');
        if ( ! $access_token) {
            $access_token = $this->get_access_token();
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver_odnoklassniki.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 sub has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function sub($channel, $callback)
    {
        if ( ! $channel || ! is_callable($callback)) {
            return false;
        }
Severity: Minor
Found in plugins/rabbitmq/classes/yf_wrapper_rabbitmq.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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_user_info()
    {
        $access_token = $this->_storage_get('access_token');
        if ( ! $access_token) {
            $access_token = $this->get_access_token();
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver_vk.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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_user_info()
    {
        $access_token = $this->_storage_get('access_token');
        if ( ! $access_token) {
            $access_token = $this->get_access_token();
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver_disqus.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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_user_info()
    {
        $access_token = $this->_storage_get('access_token');
        if ( ! $access_token) {
            $access_token = $this->get_access_token();
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver_foursquare.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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_user_info()
    {
        $access_token = $this->_storage_get('access_token');
        if ( ! $access_token) {
            $access_token = $this->get_access_token();
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver_yandex.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 format_time has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function format_time($timestamp, $accuracy = 'second')
    {
        $timestamp = (int) $timestamp;
        if ($timestamp == 0) {
            return 0;
Severity: Minor
Found in plugins/common/classes/yf_common.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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_user_info()
    {
        $access_token = $this->_storage_get('access_token');
        if ( ! $access_token) {
            $access_token = $this->get_access_token();
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver_mailru.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 _decode_result has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _decode_result($result, $response, $for_method = '')
    {
        if (strpos($response['content_type'], 'json') !== false || strpos($response['content_type'], 'javascript') !== false || is_string($result) && in_array(substr(ltrim($result), 0, 1), ['[', '{'])) {
            $result = json_decode($result, $assoc = true);
        } elseif (strpos($response['content_type'], 'application/x-www-form-urlencoded') !== false) {
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver2.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 _ip_filter_valid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _ip_filter_valid($ip_filter)
    {
        if ( ! is_array($ip_filter)) {
            return  false;
        }
Severity: Minor
Found in plugins/api/classes/yf_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_geo_data_from_db has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_geo_data_from_db($cur_ip = '')
    {
        $cur_ip = trim(array_pop(explode(',', preg_replace("/[^0-9\.,]/i", '', $cur_ip))));
        if (empty($cur_ip)) {
            return false;
Severity: Minor
Found in plugins/common/classes/common/yf_other_common.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_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_data($url = '', $params = [])
    {
        if ( ! $url) {
            return false;
        }
Severity: Minor
Found in plugins/common/classes/common/yf_rss_data.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 _home_block_from_menu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _home_block_from_menu()
    {
        $STPL_MENU_MAIN = 'admin_home/menu';
        $STPL_MENU_ITEM = $STPL_MENU_MAIN . '_item';

Severity: Minor
Found in plugins/admin_home/admin_modules/yf_admin_home.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_country_by_ip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_country_by_ip($ip = '')
    {
        if ( ! $ip) {
            return false;
        }
Severity: Minor
Found in plugins/common/classes/common/yf_other_common.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 footer_submit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function footer_submit($name = '', $extra = [])
    {
        if (is_array($name)) {
            $extra = $name;
            $name = $extra['name'];
Severity: Minor
Found in plugins/table2/classes/yf_table2.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 product_activate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function product_activate()
    {
        if ($_GET['id']) {
            $a = $this->_get_product($_GET['id']);
        }
Severity: Minor
Found in plugins/shop/admin_modules/manage_shop/yf_manage_shop_products.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 search_product_by_filename has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function search_product_by_filename($folder, $supplier_id = false)
    {
        $filename = basename($folder);
        $ext = pathinfo($filename, PATHINFO_EXTENSION);
        $filename = ltrim($filename, ' .-_+=/\|,!@#%~&*()');

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

    public function feedback_activate()
    {
        if ($_GET['id']) {
            $a = db()->query_fetch('SELECT * FROM ' . db('shop_product_feedback') . ' WHERE id = ' . (int) ($_GET['id']));
        }
Severity: Minor
Found in plugins/shop/admin_modules/manage_shop/yf_manage_shop_feedback.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

Severity
Category
Status
Source
Language