Showing 3,246 of 4,217 total issues

Method supplier_add has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Method _upload_item__get has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _upload_item__get($id)
        {
            $result = [
                'status' => false,
            ];

      Method test_table_info has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function test_table_info()
          {
              if ($this->_need_skip_test(__FUNCTION__)) {
                  return;
              }
      Severity: Minor
      Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php - About 1 hr to fix

        Method test_update_foreign_key has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function test_update_foreign_key()
            {
                if ($this->_need_skip_test(__FUNCTION__)) {
                    return;
                }
        Severity: Minor
        Found in .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php - About 1 hr to fix

          Function filters_process_input has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function filters_process_input($in, $filters = [], $params = [])
              {
                  if (is_array($in)) {
                      $out = [];
                      $func = __FUNCTION__;
          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 _user_message has a Cognitive Complexity of 14 (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_transfer.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 date_box2 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function date_box2($name, $selected = '', $years = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
              {
                  if (is_array($selected)) {
                      $extra = (array) $extra + $name;
                      $name = $extra['name'];
          Severity: Minor
          Found in plugins/html/classes/html/yf_html_datetime.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 _on_validate_ok has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _on_validate_ok($params = [], $form)
              {
                  $p = $params ?: $_POST;
                  $lang = $p['lang'];
                  $to_export = [];

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

              public function date_box($selected = '', $years = '', $name_postfix = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
              {
                  if (is_array($selected)) {
                      $extra = (array) $extra + $name;
                      $selected = $extra['selected'];
          Severity: Minor
          Found in plugins/html/classes/html/yf_html_datetime.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_url has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function api_url($options = null, $request_options = null)
              {
                  // import options
                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  if ( ! empty($_url)) {
          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 _form has a Cognitive Complexity of 14 (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_ecommpay.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 mail_copy_find has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function mail_copy_find(&$mails, $options = null)
              {
                  if (empty($this->MAIL_COPY_TO)) {
                      return;
                  }
          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 balance has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function balance()
              {
                  $object = &$this->object;
                  $action = &$this->action;
                  $filter_name = &$this->filter_name;
          Severity: Minor
          Found in plugins/payment/admin_modules/yf_manage_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 _recreate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _recreate($options = null)
              {
                  // import operation
                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  // var
          Severity: Minor
          Found in plugins/payment/admin_modules/yf_manage_payout.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 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _show($return_array = false)
              {
                  if ($return_array) {
                      $this->_nav_item_as_array = true;
                  }
          Severity: Minor
          Found in plugins/site_nav_bar/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 _api_response has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _api_response($request)
              {
                  if ( ! $this->ENABLE) {
                      return  null;
                  }
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api__provider_webmoney.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 edit_item has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function edit_item()
              {
                  $item_info = db()->query_fetch('SELECT * FROM ' . db('menu_items') . ' WHERE id=' . (int) ($_GET['id']));
                  if (empty($item_info['id'])) {
                      return _e('No such menu item!');
          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 show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function show()
              {
                  // TODO: show preview if file is image
                  // TODO: doubleclick should edit file
                  // TODO: buttons near eacj table row (edit/show revisions)
          Severity: Minor
          Found in plugins/sys/admin_modules/yf_file_manager.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 _prepare_css_class has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _prepare_css_class($default_class = '', $value = '', &$extra)
              {
                  $css_class = $default_class;
                  if ($extra['badge']) {
                      $badge = is_array($extra['badge']) && isset($extra['badge'][$value]) ? $extra['badge'][$value] : $extra['badge'];
          Severity: Minor
          Found in plugins/form2/classes/yf_form2.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_stpls_list has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _show_stpls_list($files_array = [], $level = 0)
              {
                  asort($files_array);
                  $body = [];
                  foreach ((array) $files_array as $cur_file_path => $file_name) {
          Severity: Minor
          Found in plugins/tpl/admin_modules/yf_template_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

          Severity
          Category
          Status
          Source
          Language