Showing 3,246 of 4,217 total issues

Method js_cors has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function js_cors()
    {
        $api = _class('api');
        echo <<<'EOS'
<!DOCTYPE html>
Severity: Major
Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

    Method provider has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method _pcntl_dispatch has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function _pcntl_dispatch($options = null)
          {
              $result = false;
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
      Severity: Major
      Found in plugins/sys/classes/yf_pcntl_signal.class.php - About 2 hrs to fix

        Method _recursive_get_menu_items has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _recursive_get_menu_items($menu_id = 0, $skip_item_id = 0)
            {
                if (empty($menu_id) || empty($this->_menu_items[$menu_id])) {
                    return false;
                }
        Severity: Major
        Found in plugins/sys/classes/yf_core_menu.class.php - About 2 hrs to fix

          Method __api_response__result has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __api_response__result($operation_id, $response)
              {
                  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 edit_stpl has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function edit_stpl()
                {
                    $theme_name = $_GET['theme'];
                    $stpl_name = $_GET['name'];
                    if ( ! validate([$theme_name, $stpl_name], 'trim|required')) {
            Severity: Major
            Found in plugins/tpl/admin_modules/yf_template_editor.class.php - About 2 hrs to fix

              Method form_begin has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function form_begin($name = '', $method = '', $extra = [], $replace = [])
                  {
                      if (is_array($name)) {
                          $extra = (array) $extra + $name;
                          $name = '';
              Severity: Major
              Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

                Method _validate_rules_process has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _validate_rules_process($validate_rules = [], &$data)
                    {
                        $validate_ok = true;
                        foreach ((array) $validate_rules as $name => $rules) {
                            $is_required = false;
                Severity: Major
                Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

                  Method postload has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function postload($params = [], $table)
                      {
                          $attr_postload_url = $params['attr_postload_url'] ?: 'postload-url';
                          $tr_id_key = $params['tr_id_key'] ?: 'name';
                  
                  
                  Severity: Major
                  Found in plugins/table2/classes/table2/yf_table2_postload.class.php - About 2 hrs to fix

                    Method get_shard_table_name has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function get_shard_table_name($table_name, $db)
                        {
                            $shard_table_name = '';
                            // Try sharding by year/month/day (example: db('currency_pairs_log_2013_07_01') from db('currency_pairs_log'))
                            if ( ! $shard_table_name && $this->SHARDING_BY_DAY) {
                    Severity: Major
                    Found in plugins/db/classes/db/yf_db_installer.class.php - About 2 hrs to fix

                      Method url_to_absolute has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function url_to_absolute($baseUrl, $relativeUrl)
                          {
                              // Remove several frag parts from URL
                              if (substr_count($baseUrl, '#') > 1) {
                                  $baseUrl = substr($baseUrl, 0, strpos($baseUrl, '#', strpos($baseUrl, '#') + 1));
                      Severity: Major
                      Found in plugins/common/classes/common/yf_url_to_absolute.class.php - About 2 hrs to fix

                        Method manufacturer_edit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function manufacturer_edit()
                            {
                                $_GET['id'] = (int) ($_GET['id']);
                                if (empty($_GET['id'])) {
                                    return _e('Empty ID!');

                          Method attribute_edit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function attribute_edit()
                              {
                                  if (empty($_GET['id'])) {
                                      return _e('no id');
                                  }

                            Method _get_git_details has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _get_git_details($FS_PATH, $as_submodule = false)
                                {
                                    $git_base_path = $FS_PATH . '.git';
                                    if ( ! file_exists($git_base_path)) {
                                        return [];
                            Severity: Major
                            Found in classes/yf_debug.class.php - About 2 hrs to fix

                              Method _do_rewrite has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function _do_rewrite()
                                  {
                                      $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                                      if ($this->is_console() || MAIN_TYPE_ADMIN || ! module_conf('tpl', 'REWRITE_MODE')) {
                                          return false;
                              Severity: Major
                              Found in classes/yf_main.class.php - About 2 hrs to fix

                                Method substr has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function substr($text, $start, $length = null)
                                    {
                                        if ($this->MULTIBYTE == $this->UNICODE_MULTIBYTE) {
                                            return $length === null ? mb_substr($text, $start) : mb_substr($text, $start, $length);
                                        }
                                Severity: Major
                                Found in classes/yf_utf8.class.php - About 2 hrs to fix

                                  Method test_complex has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function test_complex()
                                      {
                                          $per_page = 10;
                                          conf('per_page', $per_page);
                                          $this->assertEquals($per_page, conf('per_page'));
                                  Severity: Major
                                  Found in .dev/tests/unit/class_divide_pages_test.Test.php - About 2 hrs to fix

                                    Method _do_compress_php_file has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function _do_compress_php_file($file_to_open = '', $file_to_save = '')
                                    {
                                        $source = file_get_contents($file_to_open);
                                        // Removes comments
                                        foreach ((array) token_get_all($source) as $token) {
                                    Severity: Major
                                    Found in .dev/useful/php_compressor.php - About 2 hrs to fix

                                      File articles_texts.data.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      <?php
                                      
                                      return [
                                        2 => [
                                          'id' => '2',
                                      Severity: Minor
                                      Found in .dev/install/installer_data/db_tables_en/articles_texts.data.php - About 2 hrs to fix

                                        yf_remote_files has 21 functions (exceeds 20 allowed). Consider refactoring.
                                        Open

                                        class yf_remote_files
                                        {
                                            /** @var string SMTP host to verify emails from. Be sure to set this correctly! */
                                            public $SMTP_PROBE_HOST = 'mx.test.com';
                                            /** @var string */
                                        Severity: Minor
                                        Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language