Showing 3,246 of 4,217 total issues

Method _get_methods has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _get_methods($params = [])
    {
        $ONLY_PRIVATE_METHODS = [];
        if (isset($params['private'])) {
            $ONLY_PRIVATE_METHODS = $params['private'];
Severity: Major
Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 3 hrs to fix

    Method _render_as_html has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _render_as_html(&$params, &$a, &$to_hide)
        {
            $body = '';
            $header_links = [];
            if (MAIN_TYPE_ADMIN && ! $params['no_pages'] && ! $params['no_total'] && $a['total']) {
    Severity: Major
    Found in plugins/table2/classes/yf_table2.class.php - About 3 hrs to fix

      Method cancel has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function cancel($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              // var
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api.class.php - About 3 hrs to fix

        Method deposition has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method add has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function add($object_name, $ids = [], $action = null, $extra = [])
              {
                  if ( ! $this->ENABLED) {
                      return false;
                  }
          Severity: Major
          Found in plugins/db/admin_modules/yf_manage_revisions.class.php - About 3 hrs to fix

            Method upload_images has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function upload_images()
                {
                    $SUPPLIER_ID = $this->SUPPLIER_ID;
                    $ADMIN_INFO = db()->query_fetch('SELECT * FROM ' . db('sys_admin') . ' WHERE id=' . (int) (main()->ADMIN_ID));
                    $SUPPLIER_INFO = db()->query_fetch('SELECT * FROM ' . db('shop_suppliers') . ' WHERE id=' . (int) $SUPPLIER_ID);

              Method _get_methods has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _get_methods($params = [])
                  {
                      $ONLY_PRIVATE_METHODS = [];
                      if (isset($params['private'])) {
                          $ONLY_PRIVATE_METHODS = $params['private'];
              Severity: Major
              Found in plugins/user/admin_modules/yf_user_modules.class.php - About 3 hrs to fix

                yf_module has 27 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class yf_module
                {
                    /** @var bool */
                    public $USE_CAPTCHA = true;
                    /** @var bool Force stripslashes on '_format_text' method */
                Severity: Minor
                Found in classes/yf_module.class.php - About 3 hrs to fix

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

                      public function go($new_file_path, $name_in_form = 'image', $max_image_size = 0, $is_local = false)
                      {
                          // We do not want to user break our operation
                          ignore_user_abort(true);
                          // New name is required
                  Severity: Major
                  Found in plugins/common/classes/common/yf_upload_image.class.php - About 3 hrs to fix

                    Method ajax_city has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function ajax_city()
                        {
                            main()->NO_GRAPHICS = true;
                            // Check input
                            if (isset($_REQUEST['country'])) {
                    Severity: Major
                    Found in plugins/geo/modules/yf_geo_content.class.php - About 3 hrs to fix

                      Method html_out has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function html_out($out_type, $content_type, $str, $params = [])
                          {
                              if ( ! $out_type || ! $content_type || ! strlen($str)) {
                                  return false;
                              }
                      Severity: Major
                      Found in plugins/assets/classes/yf_assets.class.php - About 3 hrs to fix

                        Method show has 78 lines of code (exceeds 25 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: Major
                        Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 3 hrs to fix

                          Method add has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function add($params = [])
                              {
                                  if (is_string($params)) {
                                      $params = ['table' => $params];
                                  }
                          Severity: Major
                          Found in plugins/sys/classes/yf_admin_methods.class.php - About 3 hrs to fix

                            Method generate_up has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function generate_up($params = [])
                                {
                                    if ( ! isset($report)) {
                                        $report = $this->compare($params);
                                    }
                            Severity: Major
                            Found in plugins/db/classes/db/yf_db_migrator.class.php - About 3 hrs to fix

                              Method render_type_slide has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function render_type_slide($params = [])
                                  {
                                      $total_records = $params['total_records'];
                                      $per_page = $params['per_page'];
                                      $requested_page = $params['requested_page'];
                              Severity: Major
                              Found in plugins/common/classes/common/yf_divide_pages.class.php - About 3 hrs to fix

                                Method _order_step_finish has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function _order_step_finish($FORCE_DISPLAY_FORM = false)
                                    {
                                        module('shop')->_basket_api()->clean();
                                
                                        if (isset($_GET['page'])) {
                                Severity: Major
                                Found in plugins/shop/modules/shop/yf_shop__order_step_finish.class.php - About 3 hrs to fix

                                  Function get_asset has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function get_asset($name, $asset_type, $version = '')
                                      {
                                          if ( ! $name) {
                                              return null;
                                          }
                                  Severity: Minor
                                  Found in plugins/assets/classes/yf_assets.class.php - About 3 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_current_lang has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function _get_current_lang($force = false)
                                      {
                                          $langs = $this->LANGUAGES ?: $this->_get_langs();
                                  
                                          $FORCE_LOCALE = conf('FORCE_LOCALE');
                                  Severity: Minor
                                  Found in plugins/locale/classes/yf_i18n.class.php - About 3 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 dd_table has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function dd_table($replace = [], $field_types = [], $extra = [])
                                      {
                                          $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                          if (DEBUG_MODE) {
                                              $ts = microtime(true);
                                  Severity: Minor
                                  Found in plugins/html/classes/yf_html.class.php - About 3 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 _combine_content has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function _combine_content(array $out, $out_type, array $to_combine, $combined_file, array $md5_inside_combined)
                                      {
                                          if ( ! file_exists($combined_file)) {
                                              $divider = PHP_EOL;
                                              if ($out_type === 'js') {
                                  Severity: Minor
                                  Found in plugins/assets/classes/yf_assets.class.php - About 3 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