Showing 3,246 of 4,217 total issues

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

    public function manufacturer_add()
    {
        if (main()->is_post()) {
            if ( ! $_POST['name']) {
                _re('Product name must be filled');

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

    public function coupon_edit()
    {
        $_GET['id'] = (int) ($_GET['id']);
        if (empty($_GET['id'])) {
            return _e('Empty ID!');

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

    public function set_main_image()
    {
        if ($_GET['id']) {
            $product = module('manage_shop')->_product_get_info($_GET['id']);
        }

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

    public function filter_save()
    {
        $_GET['id'] = preg_replace('~[^0-9a-z_]+~ims', '', $_GET['id']);
        if ($_GET['id'] && false !== strpos($_GET['id'], $_GET['object'] . '__')) {
            $filter_name = $_GET['id'];

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

    public function supplier_add()
    {
        if (main()->is_post()) {
            if ( ! $_POST['name']) {
                _re('Product name must be filled');

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()
    {
        $cat_info = db()->get('SELECT * FROM ' . db('categories') . ' WHERE name="' . db()->es($_GET['id']) . '" OR id=' . (int) ($_GET['id']));
        if ( ! $cat_info) {
            return _e('No such category');
Severity: Minor
Found in plugins/categories/admin_modules/yf_category_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 _init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        if ( ! empty($_SESSION['edit_escort_id'])) {
            // Do cache
            if ( ! isset($GLOBALS['_agency_info'])) {
Severity: Minor
Found in plugins/user/modules/yf_user_profile.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 _order_step_start has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _order_step_start($FORCE_DISPLAY_FORM = false)
    {
        module('shop')->_basket_save();

        $basket_contents = module('shop')->_basket_api()->get_all();
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop__order_step_start.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_item has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function add_item()
    {
        $cat_info = db()->query_fetch('SELECT * FROM ' . db('categories') . ' WHERE id=' . (int) ($_GET['id']));
        if (empty($cat_info['id'])) {
            return _e('No such category!');
Severity: Minor
Found in plugins/categories/admin_modules/yf_category_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 _get_group_prices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_group_prices($product_ids = [])
    {
        if (is_numeric($product_ids)) {
            $return_single = $product_ids;
            $product_ids = [$product_ids];
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop__get_group_prices.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 basket_main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function basket_main()
    {
        $products_ids = [];
        $basket_contents = module('shop')->_basket_api()->get_all();
        foreach ((array) $basket_contents as $_item_id => $_info) {
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop_basket_main.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 save_locale_var has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function save_locale_var()
    {
        no_graphics(true);
        if ( ! DEBUG_MODE && ! $_SESSION['locale_vars_edit']) {
            return print 'Access denied';
Severity: Minor
Found in plugins/dynamic/modules/dynamic/yf_dynamic_edit.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 _load_upload_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _load_upload_list()
    {
        $upload_list__file_name = $this->upload_list__file_name;
        $upload_list__field = $this->upload_list__field;
        $upload_list = &$this->upload_list;

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

    public function chmod($server_info = [], $path = '', $new_mode = null, $recursively = false)
    {
        if (is_array($path)) {
            $_bulk_cmd = [];
            foreach ((array) $path as $_path => $_new_mode) {
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.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 chown has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function chown($server_info = [], $path = '', $new_owner = '', $new_group = '', $recursively = false)
    {
        if (is_array($path)) {
            $_bulk_cmd = [];
            foreach ((array) $path as $_path => $_new_owner) {
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.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 _view_widget_items has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _view_widget_items($widgets = [])
    {
        $_orig_object = $_GET['object'];
        $_orig_action = $_GET['action'];
        $is_cloneable_item = true;
Severity: Minor
Found in plugins/dashboards/classes/yf_dashboards2.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 save has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function save()
    {
        $lang = $_GET['page'];
        if ( ! is_post() || ! $lang || ! isset($this->all_langs[$lang])) {
            return js_redirect(url('/@object'));
Severity: Minor
Found in plugins/content/admin_modules/yf_manage_faq.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 oauth has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function oauth($params = [])
    {
        if ( ! isset($params['only_icons'])) {
            $params['only_icons'] = 1;
        }
Severity: Minor
Found in plugins/user/modules/yf_login_form.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 _debug_profiling has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_profiling(&$params = [])
    {
        $all_timings = main()->_timing;
        if ( ! $all_timings) {
            return false;
Severity: Minor
Found in classes/yf_debug.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 _debug_dashboard has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_dashboard()
    {
        if ( ! $this->SHOW_DB_STATS) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.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