Showing 3,246 of 4,217 total issues

Function __api_response__check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __api_response__check($operation_id, $response)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 45 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 load__cbr_xml has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function load__cbr_xml($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 45 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_parents_for_select has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_parents_for_select($menu_id, $skip_id = null)
    {
        $data = [0 => '-- TOP --'];
        foreach ((array) $this->_recursive_get_menu_items($menu_id/*, $skip_id*/) as $cur_item_id => $cur_item_info) {
            if (empty($cur_item_id)) {
Severity: Minor
Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 45 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

Avoid deeply nested control flow statements.
Open

                        if ($real_payment_code == $payment_code && $confirmations >= $this->CONFIRMATIONS && $real_address == $address) {
                            $need_update_amount = false;
                            $request_amount_currency_satoshi = $operation['options']['request']['amount_currency_satoshi'];

                            $request_fee = $operation['options']['request']['fee'];
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 45 mins to fix

    Function api_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

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

        public function copy_item()
        {
            $dir_name = urldecode($_POST['dir_name']);
            $items_to_copy = [];
            foreach ((array) $_POST as $k => $v) {
    Severity: Minor
    Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 45 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 find_active_modules has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function find_active_modules($section = 'all')
        {
            if ( ! in_array($section, ['all', 'user', 'admin'])) {
                $section = 'all';
            }
    Severity: Minor
    Found in plugins/sys/classes/yf_admin_methods.class.php - About 45 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

    Avoid deeply nested control flow statements.
    Open

                            if ($real_secret == $secret) {
                                $transaction_hash = $_GET['transaction_hash'];
                                $value_in_satoshi = $_GET['value'];
                                $value_in_btc = $value_in_satoshi / 100000000;
    
    
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api__provider_bitcoin.class.php - About 45 mins to fix

      Function signature has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function signature($options, $is_request = true)
          {
              $_ = &$options;
              $request = [];
              // add allow fields
      Severity: Minor
      Found in plugins/payment/classes/payment_provider/interkassa/Interkassa.php - About 45 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 _purse_by_currency has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

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

          public function make_zip_item()
          {
              $dir_name = urldecode($_POST['dir_name']);
              if ( ! $_POST['new_zip_name']) {
                  $_POST['new_zip_name'] = 'tmp_1234';
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 45 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_cke_config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _get_cke_config($params = [])
          {
              asset('ckeditor-plugin-save');
              asset('ckeditor-plugin-autosave');
              asset('ckeditor-plugin-html5-video');
      Severity: Minor
      Found in plugins/sys/classes/yf_admin_methods.class.php - About 45 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 edit_rule has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function edit_rule()
          {
              $rule_info = db()->get('SELECT * FROM ' . db('block_rules') . ' WHERE id=' . (int) ($_GET['id']));
              if (empty($rule_info['id'])) {
                  return _e('No such rule!');
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_blocks.class.php - About 45 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_method_source has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function get_method_source($module, $method, $section = 'all')
          {
              if ( ! is_object($module)) {
                  if (false !== strpos($module, '/')) {
                      list($subfolder, $module) = explode('/', $module);
      Severity: Minor
      Found in plugins/sys/classes/yf_core_api.class.php - About 45 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 _auto_update_items_orders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _auto_update_items_orders($menu_id)
          {
              if ( ! $menu_id) {
                  return false;
              }
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 45 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 _init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _init()
          {
              require_php_lib('twig');
      
              // path
      Severity: Minor
      Found in plugins/tpl/classes/tpl/yf_tpl_driver_twig.class.php - About 45 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 _exec_method_on_action has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _exec_method_on_action($action = 'login')
          {
              if ($action == 'login') {
                  $callbacks = $this->EXEC_AFTER_LOGIN;
              } elseif ($action == 'logout') {
      Severity: Minor
      Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 45 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_libs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function get_libs($folder = 'vendor/')
          {
              $libs = [];
              $suffix = '/';
              foreach ($this->get_globs($folder, $suffix) as $glob) {
      Severity: Minor
      Found in plugins/sys/classes/yf_core_api.class.php - About 45 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_box has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function phone_box($name = '', $extra = [], $replace = [])
          {
              if (is_array($name)) {
                  $extra = (array) $extra + $name;
              } else {
      Severity: Minor
      Found in plugins/form2/classes/yf_form2.class.php - About 45 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 array_to_form has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function array_to_form($a = [], $params = [], $replace = [])
          {
              $this->_params = $params + (array) $this->_params;
              $this->_replace = $replace + (array) $this->_replace;
              // Example of row: ['text', 'login', ['class' => 'input-medium']]
      Severity: Minor
      Found in plugins/form2/classes/yf_form2.class.php - About 45 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