Showing 4,217 of 4,217 total issues

Function shell_exec has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function shell_exec($server_info = [], $cmd = '')
    {
        if ( ! $this->_INIT_OK || ! $cmd || ! $server_info) {
            return false;
        }
Severity: Minor
Found in plugins/ssh/classes/yf_ssh.class.php - About 2 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 download_dir has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function download_dir($server_info = [], $remote_dir = '', $local_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
    {
        $local_dir = _class('ssh')->_prepare_path($local_dir);
        $remote_dir = _class('ssh')->_prepare_path($remote_dir);
        if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($local_dir) || ! strlen($remote_dir)) {
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 2 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 drag_items has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function drag_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 2 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 orders has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function orders()
    {
        if ( ! main()->USER_ID) {
            if (main()->is_post()) {
                module('shop')->order_validate_data();
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop_orders.class.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function _data()
    {
        $_class_price = $this->_class_price;
        // init sql
        $sql_table = db('shop_products');

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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_modules_from_files()
    {
        $regex = '~function(\s)+(' . implode('|', $this->HOOK_NAMES) . ')\s*\(~ims';

        $yf_prefix_len = strlen(YF_PREFIX);
Severity: Minor
Found in plugins/site_map/modules/yf_site_map.class.php - About 2 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 scan_dir has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function scan_dir($start_dir, $_tmp = 1, $pattern_include = '', $pattern_exclude = '')
    {
        $func = __FUNCTION__;
        // Here we accept several start folders, result will be merged
        if (is_array($start_dir)) {
Severity: Minor
Found in classes/yf_dir.class.php - About 2 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 replace has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function replace($start_dirs, $pattern_include = '', $pattern_exclude = '', $pattern_find, $pattern_replace)
    {
        $files = [];
        if ( ! is_array($start_dirs)) {
            $start_dirs = [$start_dirs];
Severity: Minor
Found in classes/yf_dir.class.php - About 2 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 create_image_versions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function create_image_versions($uploads_result = null, $options = null)
    {
        if ( ! is_array($uploads_result) || ! is_array($options['image_versions'])) {
            return  false;
        }
Severity: Minor
Found in plugins/content/classes/yf_upload_handler.class.php - About 2 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 getset has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function getset($name, callable $func, $ttl = 0, array $params = [])
    {
        if ( ! is_string($name) || ! $name) {
            return null;
        }
Severity: Minor
Found in classes/yf_main.class.php - About 2 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 save has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function save($output_file = '')
    {
        if (empty($this->tmp_img)) {
            if ( ! $this->SILENT_MODE) {
                trigger_error('No temporary image for resizing!', E_USER_WARNING);
Severity: Minor
Found in plugins/content/classes/yf_resize_images.class.php - About 2 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 grep has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function grep($pattern_find, $start_dirs, $pattern_path = '*', $extra = [])
    {
        if ( ! $pattern_find) {
            return false;
        }
Severity: Minor
Found in classes/yf_dir.class.php - About 2 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

File yf_oauth_driver1.class.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

load('oauth_driver2', '', 'classes/oauth/');
abstract class yf_oauth_driver1 extends yf_oauth_driver2
{
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver1.class.php - About 2 hrs to fix

    Method _init has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _init()
        {
            // class
            $this->payment_api = _class('payment_api');
            $this->manage_payment_lib = module('manage_payment_lib');
    Severity: Major
    Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 2 hrs to fix

      Method _combine_content has 60 lines of code (exceeds 25 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: Major
      Found in plugins/assets/classes/yf_assets.class.php - About 2 hrs to fix

        Method stats has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function stats()
            {
                $payment_api = &$this->payment_api;
                // payment providers
                $providers = $payment_api->provider();
        Severity: Major
        Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 2 hrs to fix

          Method _api_WebMoney has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _api_WebMoney($title)
              {
                  $php = '';
                  $api = _class('payment_api__provider_webmoney');
                  $methods = [
          Severity: Major
          Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

            Method _check_block_rights has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _check_block_rights($block_id = 0, $OBJECT = '', $ACTION = '')
                {
                    if (empty($block_id) || empty($OBJECT)) {
                        return false;
                    }
            Severity: Major
            Found in plugins/sys/classes/yf_core_blocks.class.php - About 2 hrs to fix

              Method _fix_data_safe has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _fix_data_safe($table, $data = [], $extra = [])
                  {
                      if ( ! $this->FIX_DATA_SAFE) {
                          return $data;
                      }
              Severity: Major
              Found in plugins/db/classes/yf_db.class.php - About 2 hrs to fix

                Method merge_order has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function merge_order()
                    {
                        $_GET['id'] = (int) ($_GET['id']);
                        if ($_GET['id']) {
                            $order_info = db()->query_fetch('SELECT * FROM ' . db('shop_orders') . ' WHERE id=' . (int) ($_GET['id']));
                  Severity
                  Category
                  Status
                  Source
                  Language