Showing 3,246 of 4,217 total issues

Method li_tree has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function li_tree($data = [], $extra = [])
    {
        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
        if ($data) {
            $data = $this->_parent->_recursive_sort_items($data);
Severity: Minor
Found in plugins/html/classes/html/yf_html_tree.class.php - About 1 hr to fix

    Function payout has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            payout: function( options ) {
                var $this = this;
                $scope.block_wait     = true;
                $scope.is_submitted   = true;
                $scope.status         = false;
    Severity: Minor
    Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 1 hr to fix

      Method _render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _render($result)
          {
              $asset_class = _class('assets');
              $asset_class->clean_all();
              $asset_class->ADD_IS_DIRECT_OUT = true;
      Severity: Minor
      Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

        Method submit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function submit($name = '', $value = '', $extra = [], $replace = [])
            {
                if (is_array($name)) {
                    $extra = (array) $extra + $name;
                    $name = '';
        Severity: Minor
        Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

          Method active_box has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function active_box($name = '', $desc = '', $extra = [], $replace = [])
              {
                  if (is_array($name)) {
                      $extra += $name;
                      $desc = '';
          Severity: Minor
          Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

            Method _compile_prepare_cond has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _compile_prepare_cond($cond = '', $for_right = false)
                {
                    $cond = trim($cond);
                    $_array_magick = [
                        '_key' => '$_k',
            Severity: Minor
            Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 1 hr to fix

              Method process has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function process($options = null, $initialize = true, $error_messages = null)
                  {
                      $this->options = [
                          'upload_dir' => INCLUDE_PATH . 'uploads/' . $_GET['object'] . '/',
                          'upload_url' => WEB_PATH . 'uploads/' . $_GET['object'] . '/',
              Severity: Minor
              Found in plugins/form2/classes/form2/yf_form2_file_handler.class.php - About 1 hr to fix

                Method shell_exec has 48 lines of code (exceeds 25 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 1 hr to fix

                  Method _order_step_start has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _order_step_start($FORCE_DISPLAY_FORM = false)
                      {
                          module('shop')->_basket_save();
                  
                          $basket_contents = module('shop')->_basket_api()->get_all();
                  Severity: Minor
                  Found in plugins/shop/modules/shop/yf_shop__order_step_start.class.php - About 1 hr to fix

                    Method _attributes_save has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _attributes_save($object_id = 0)
                        {
                            if (empty($object_id)) {
                                return;
                            }

                      Method novaposhta_ua__import has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function novaposhta_ua__import()
                          {
                              // get data
                              // *** local
                              // $file = '/tmp/JsonWarehouseList.json';

                        Method xss_clean has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function xss_clean($str, $is_image = false)
                            {
                                // Is the string an array?
                                if (is_array($str)) {
                                    while (list($key) = each($str)) {
                        Severity: Minor
                        Found in classes/yf_security.class.php - About 1 hr to fix

                          Method _find_site has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _find_site($sites_dir = '')
                              {
                                  $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                                  if ( ! $sites_dir) {
                                      $try_paths = [
                          Severity: Minor
                          Found in classes/yf_main.class.php - About 1 hr to fix

                            Method _debug_stpls has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _debug_stpls(&$params = [])
                                {
                                    if ( ! $this->SHOW_STPLS) {
                                        return '';
                                    }
                            Severity: Minor
                            Found in classes/yf_debug.class.php - About 1 hr to fix

                              Method call_class_method has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function call_class_method($class_name = '', $custom_path = '', $method_name = '', $method_params = '', $tpl_name = '', $silent = false, $use_cache = false, $cache_ttl = -1, $cache_key_override = '')
                                  {
                                      if ( ! strlen($class_name) || ! strlen($method_name)) {
                                          return false;
                                      }
                              Severity: Minor
                              Found in classes/yf_main.class.php - About 1 hr to fix

                                Method edit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function edit()
                                    {
                                        $id = (int) $_GET['id'];
                                        if ($id) {
                                            $a = from(self::table)->whereid($id)->get();
                                Severity: Minor
                                Found in plugins/content/admin_modules/yf_manage_faq.class.php - About 1 hr to fix

                                  Method test_real_escape_string has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

                                    Method import_base_db_structure has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function import_base_db_structure()
                                        {
                                            $import_tables = [
                                                'dashboards',
                                                'static_pages',
                                    Severity: Minor
                                    Found in .dev/install/install.php - About 1 hr to fix

                                      Function _url_control has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _url_control()
                                          {
                                              if ( ! $this->ALLOW_URL_CONTROL) {
                                                  return false;
                                              }
                                      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 15 (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_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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language