Showing 3,246 of 4,217 total issues

Method _init_sftp_phpseclib has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _init_sftp_phpseclib($server_info = [])
    {
        if ( ! $this->DRIVER == 'phpseclib') {
            return false;
        }
Severity: Major
Found in plugins/ssh/classes/yf_ssh.class.php - About 2 hrs to fix

    Method test_order_by has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function test_order_by()
        {
            if ($this->_need_skip_test(__FUNCTION__)) {
                return;
            }
    Severity: Major
    Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 2 hrs to fix

      Method test_num2str_uah_ru has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function test_num2str_uah_ru()
          {
              //        $this->assertEquals( 'пятьсот пятьдесят пять триллионов четыреста сорок четыре милиарда триста тридцать три миллиона двести двадцать две тысячи сто одиннадцать гривен 99 копеек', common()->num2str( '555 444 333 222 111.999', 'uah', 'ru' ) );
              //        $this->assertEquals( 'п`ятьсот п`ятьдесят п`ять трильйонів чотиреста сорок чотири мільярда триста тридцять три мільйона двісті двадцять дві тисячі сто одиннадцять гривень 99 копійок', common()->num2str( '555 444 333 222 111.999', 'uah', 'ua' ) );
              //        $this->assertEquals( 'five hundred fifty five trillions four hundred forty four milliards three hundred thirty three millions two hundred twenty two thousands one hundred eleven grivnas 99 kopecks', common()->num2str( '555 444 333 222 111.999', 'uah', 'en' ) );
      Severity: Major
      Found in .dev/tests/unit/class_num2string_test.Test.php - About 2 hrs to fix

        Method yf_placeholder_img has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function yf_placeholder_img($w = 100, $h = 100, $params = [])
        {
            $w = abs((int) $w ?: 100);
            $h = abs((int) $h ?: 100);
            $text = $params['text'] ?: $w . ' x ' . $h;
        Severity: Major
        Found in functions/yf_placeholder_img.php - About 2 hrs to fix

          Function radio_box has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
              {
                  if (is_array($name)) {
                      $extra = (array) $extra + $name;
                      $name = $extra['name'];
          Severity: Minor
          Found in plugins/html/classes/yf_html.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 _get_admin_daily_info has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _get_admin_daily_info($sql, $days = 60, $admin_ids = [])
              {
                  if ( ! $admin_ids) {
                      return false;
                  }
          Severity: Minor
          Found in plugins/admin/admin_modules/yf_admin.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 _rss_general has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _rss_general()
              {
                  foreach ((array) module('comments')->COMMENT_LINKS as $key => $value) {
                      $where .= 'object_name="' . $key . '"';
                      if ($value !== end(module('comments')->COMMENT_LINKS)) {
          Severity: Minor
          Found in plugins/comments/modules/comments/yf_comments_integration.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 _process_where_cond has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _process_where_cond($left, $op, $right)
              {
                  ! $op && $op = '=';
                  $left = trim(strtolower($left));
                  if (is_string($op)) {
          Severity: Minor
          Found in plugins/db/classes/db/yf_db_query_builder_driver.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 go has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function go($sql = '', $url_path = '', $render_type = '', $records_on_page = 0, $num_records = 0, $tpls_path = '', $add_get_vars = 1, $extra = [])
              {
                  if (is_array($url_path)) {
                      $extra = $url_path;
                      $url_path = '';
          Severity: Minor
          Found in plugins/common/classes/common/yf_divide_pages.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 rotate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function rotate($source_file_path, $dest_file_path, $ANGLE)
              {
                  // Check source file
                  if ( ! file_exists($source_file_path) || ! filesize($source_file_path) || ! is_readable($source_file_path)) {
                      trigger_error('ROTATE_IMG: Source file is empty', E_USER_WARNING);
          Severity: Minor
          Found in plugins/common/classes/common/yf_image_manip.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 _get_available_widgets_hooks has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _get_available_widgets_hooks()
              {
                  if (isset($this->_avail_widgets)) {
                      return $this->_avail_widgets;
                  }
          Severity: Minor
          Found in plugins/common/classes/common/yf_dashboards.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 product_image_search has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function product_image_search()
              {
                  $_GET['id'] = (int) ($_GET['id']);
                  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 _recursive_sort_items has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _recursive_sort_items($items = [], $skip_item_id = 0, $parent_id = 0)
              {
                  $children = [];
                  $cur_group = MAIN_TYPE_USER ? $_SESSION['user_group'] : $_SESSION['admin_group'];
                  foreach ((array) $items as $id => $info) {
          Severity: Minor
          Found in plugins/categories/classes/yf_cats.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 _show_category_contents has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _show_category_contents($params = [])
              {
                  $ICONS_PATH = 'uploads/icons/';
                  $MEDIA_PATH = WEB_PATH;
                  $force_stpl_name = isset($params['force_stpl_name']) ? $params['force_stpl_name'] : false;
          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 copy_dir has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function copy_dir($path1, $path2, $pattern_include = '', $pattern_exclude = '', $level = null)
              {
                  if ( ! $path1 || ! file_exists($path1)) {
                      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

          Function my_array_merge has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function my_array_merge($a1, $a2)
              {
                  foreach ((array) $a2 as $k => $v) {
                      if (isset($a1[$k]) && is_array($a1[$k])) {
                          if (is_array($a2[$k])) {
          Severity: Minor
          Found in classes/yf_utils.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 check has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function check($field_in_form = 'image_numbers', $input = null)
              {
                  if ( ! $this->ENABLED) {
                      return true;
                  }
          Severity: Minor
          Found in plugins/content/classes/yf_captcha.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 _helper_add_config has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _helper_add_config($libs = [], $types = ['js', 'css'])
              {
                  _class('assets')->clean_all();
                  foreach ($libs as $name => $config) {
                      foreach ($types as $type) {
          Severity: Minor
          Found in .dev/tests/unit/class_assets_test.Test.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 import_base_db_structure has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function import_base_db_structure()
              {
                  $import_tables = [
                      'dashboards',
                      'static_pages',
          Severity: Minor
          Found in .dev/install/install.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_core_api_admin_modules.class.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          
          class yf_core_api_admin_modules
          {
          Severity: Minor
          Found in plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php - About 2 hrs to fix
            Severity
            Category
            Status
            Source
            Language