Showing 3,246 of 4,217 total issues

Method multi_select has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
    {
        // Passing params as array
        if (is_array($name)) {
            $extra = (array) $extra + $name;
Severity: Major
Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

    Method connect has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function connect($db_host = '', $db_user = '', $db_pswd = null, $db_name = null, $force = false, $params = [])
        {
            if (is_array($db_host)) {
                $params = $db_host;
                $db_host = '';
    Severity: Major
    Found in plugins/db/classes/yf_db.class.php - About 2 hrs to fix

      Method _try_to_find has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _try_to_find($input_name = '', $CUR_CHECKS = [], $where_search = '')
          {
              // Default value
              $IS_FOUND = false;
              $WHAT_FOUND = '';
      Severity: Major
      Found in plugins/common/classes/common/yf_user_ban.class.php - About 2 hrs to fix

        Method _order_create has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _order_create()
            {
                if (empty($_POST)) {
                    return false;
                }
        Severity: Major
        Found in plugins/shop/modules/shop/yf_shop__order_create.class.php - About 2 hrs to fix

          Method go has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function go()
              {
                  if ( ! db()->QUERY_LOG) {
                      return false;
                  }
          Severity: Major
          Found in plugins/logs/classes/logs/yf_logs_db_queries.class.php - About 2 hrs to fix

            Method tree has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function tree()
                {
                    return _class('html')->tree([
                        11 => [
                            'name' => 'Tools',
            Severity: Major
            Found in .dev/samples/classes/sample_html.class.php - About 2 hrs to fix

              Method menu has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function menu()
                  {
                      return _class('html')->menu([
                          11 => [
                              'name' => 'Tools',
              Severity: Major
              Found in .dev/samples/classes/sample_html.class.php - About 2 hrs to fix

                Method radio_box has 69 lines of code (exceeds 25 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: Major
                Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

                  Method get_asset_from_bower has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function get_asset_from_bower($name, $version = 'master', $asset_data = [], $asset_type)
                      {
                          if ( ! $name || ! $asset_data || ! isset($asset_data[$asset_type])) {
                              return false;
                          }
                  Severity: Major
                  Found in plugins/assets/classes/yf_assets.class.php - About 2 hrs to fix

                    Method _api_response has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _api_response($request)
                        {
                            if ( ! $this->ENABLE) {
                                return  null;
                            }
                    Severity: Major
                    Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 2 hrs to fix

                      Method drag_items has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function drag_items()
                          {
                              if (empty($_GET['id'])) {
                                  return _e('No id!');
                              }
                      Severity: Major
                      Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 2 hrs to fix

                        Method view has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function view()
                            {
                                $id = (int) $_GET['id'];
                                if ($id) {
                                    $a = db()->from(self::table)->whereid($id)->get();
                        Severity: Major
                        Found in plugins/db/admin_modules/yf_manage_revisions.class.php - About 2 hrs to fix

                          Method btn has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function btn($name, $link, $extra = [])
                              {
                                  if (is_array($link)) {
                                      $extra = $link;
                                      $link = '';
                          Severity: Major
                          Found in plugins/table2/classes/yf_table2.class.php - About 2 hrs to fix

                            Method _view_widget_items has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _view_widget_items($name_ids = [], $items_configs = [])
                                {
                                    $list_of_hooks = $this->_get_available_widgets_hooks();
                            
                                    $_orig_object = $_GET['object'];
                            Severity: Major
                            Found in plugins/common/classes/common/yf_dashboards.class.php - About 2 hrs to fix

                              Function connect has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function connect($params = [])
                                  {
                                      $this->_connected_ok = false;
                              
                                      $ext_old_allowed = $this->FORCE_EXT ? in_array($this->FORCE_EXT, ['old', 'memcache']) : true;
                              Severity: Minor
                              Found in plugins/memcached/classes/yf_wrapper_memcached.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 _load_lang_get_vars_from_files has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function _load_lang_get_vars_from_files($lang)
                                  {
                                      $files = [];
                                      // Auto-find shared language vars. They will be connected in order of file system
                                      // Names can be any, but better to include lang name into file name. Examples:
                              Severity: Minor
                              Found in plugins/locale/classes/yf_i18n.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 menu has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function menu($data = [], $extra = [])
                                  {
                                      $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                      if ($data) {
                                          $data = $this->_recursive_sort_items($data);
                              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 view has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function view()
                                  {
                                      // check operation
                                      $operation = $this->_operation();
                                      // import options
                              Severity: Minor
                              Found in plugins/payment/admin_modules/yf_manage_payout.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_daily_stats has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function _get_daily_stats($type = 'sum', $days = null)
                                  {
                                      $time = time();
                                      $days = $days ?: 60;
                                      $min_time = $time - $days * 86400;
                              Severity: Minor
                              Found in plugins/payment/admin_modules/yf_manage_payment.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_dir_contents has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function _get_dir_contents($abs_dir_name)
                                  {
                                      $contents = [
                                          'dirs' => [],
                                          'files' => [],
                              Severity: Minor
                              Found in plugins/sys/admin_modules/yf_file_manager.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

                              Severity
                              Category
                              Status
                              Source
                              Language