YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method testAddRecord has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testAddRecord(): void
    {
        $recordModel = \Tests\Base\C_RecordActions::createAccountRecord();
        $request = $this->httpClient->post('HelpDesk/Record/', \App\Utils::merge(['json' => [
            'ticket_title' => 'Api HelpDesk',
Severity: Minor
Found in tests/Integrations/WebservicePremiumTest.php - About 1 hr to fix

    Method delete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function delete()
        {
            $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
            $focus = \CRMEntity::getInstance($this->name);
            if (isset($focus->table_name)) {
    Severity: Minor
    Found in vtlib/Vtiger/ModuleBasic.php - About 1 hr to fix

      Method testRelatedRecordsList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testRelatedRecordsList()
          {
              $text = '$(relatedRecordsList : Accounts|lead_no,lastname,phone,description|[[["company","a","Test"]]]|All|5)$';
              $result = \App\TextParser::getInstanceByModel(self::$recordLeads)
                  ->setContent($text)
      Severity: Minor
      Found in tests/App/TextParser.php - About 1 hr to fix

        Method testGeneral has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function testGeneral()
            {
                $this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
                    ->setContent('+ $(general : CurrentDate)$ +')
                    ->parse()
        Severity: Minor
        Found in tests/App/TextParser.php - About 1 hr to fix

          Method getByModule has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getByModule(int $tabId, ?int $gui = null): array
              {
                  if (Cache::has('FieldsDependency', $tabId)) {
                      $fields = Cache::get('FieldsDependency', $tabId);
                  } else {
          Severity: Minor
          Found in app/FieldsDependency.php - About 1 hr to fix

            Method getOrignOrDefaultImgPath has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getOrignOrDefaultImgPath($imageFileName, $defaultFileName)
                {
                    $basePath = '';
                    if (!IS_PUBLIC_DIR) {
                        $basePath = 'public_html/';
            Severity: Minor
            Found in include/runtime/Theme.php - About 1 hr to fix

              Method confReportAll has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function confReportAll(): void
                  {
                      \App\Process::$requestMode = 'Cron';
                      \App\Utils\ConfReport::$sapi = 'cron';
                      $all = \App\Utils\ConfReport::getAll();
              Severity: Minor
              Found in app/Cli/Environment.php - About 1 hr to fix

                Method getReceived has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getReceived(): array
                    {
                        $rows = [];
                        foreach ($this->mailMimeParser->getAllHeadersByName('Received') as $key => $received) {
                            $row = ['key' => $key, 'fromIP' => $received->getFromAddress() ?? ''];
                Severity: Minor
                Found in app/Mail/Rbl.php - About 1 hr to fix

                  Method verifySender has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function verifySender(): array
                      {
                          $from = $this->getHeaderEmail('from');
                          if (!$from) {
                              return ['status' => true, 'info' => ''];
                  Severity: Minor
                  Found in app/Mail/Rbl.php - About 1 hr to fix

                    Method validateSpace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static function validateSpace(string $name, array $row, string $sapi)
                        {
                            $dir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
                            switch ($name) {
                                case 'spaceStorage':
                    Severity: Minor
                    Found in app/Utils/ConfReport.php - About 1 hr to fix

                      Method getRoomsGlobal has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getRoomsGlobal(?int $userId = null): array
                          {
                              if (empty($userId)) {
                                  $userId = User::getCurrentUserId();
                              }
                      Severity: Minor
                      Found in app/Chat.php - About 1 hr to fix

                        Method getRoomsPrivate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function getRoomsPrivate(?int $userId = null): array
                            {
                                if (empty($userId)) {
                                    $userId = User::getCurrentUserId();
                                }
                        Severity: Minor
                        Found in app/Chat.php - About 1 hr to fix

                          Method calculate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function calculate()
                              {
                                  if (!\App\RequestUtil::isNetConnection()) {
                                      throw new \App\Exceptions\AppException('ERR_NO_INTERNET_CONNECTION');
                                  }
                          Severity: Minor
                          Found in app/Map/Routing/Osrm.php - About 1 hr to fix

                            Method getPicklistValueImage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function getPicklistValueImage($templateId, $moduleName, $treeId)
                                {
                                    $value = ['name' => ''];
                                    $rows = self::getValuesById((int) $templateId);
                                    if (empty($rows[$treeId])) {
                            Severity: Minor
                            Found in app/Fields/Tree.php - About 1 hr to fix

                              Method verifyDatabaseAccess has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function verifyDatabaseAccess(string $server, string $database, string $user, string $password, int $port): array
                                  {
                                      try {
                                          $db = self::connectToDatabase($server, $database, $user, $password, $port);
                                          if (0 === \count($db->getSchema()->getSchemaNames())) {
                              Severity: Minor
                              Found in app/Integrations/Wapro.php - About 1 hr to fix

                                Method getDataFromApi has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function getDataFromApi(array $query): void
                                    {
                                        $query['limit'] = self::LIMIT;
                                        try {
                                            $response = \App\RequestHttp::getClient()->request('GET', $this->url . '?' . http_build_query($query), [
                                Severity: Minor
                                Found in app/RecordCollectors/PlCeidg.php - About 1 hr to fix

                                  Method getQueryToUsersByMembers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function getQueryToUsersByMembers(array $members): Db\Query
                                      {
                                          $queryGenerator = (new \App\QueryGenerator('Users'))->setFields(['id']);
                                          $columName = $queryGenerator->getColumnName('id');
                                          $conditions = ['or'];
                                  Severity: Minor
                                  Found in app/PrivilegeUtil.php - About 1 hr to fix

                                    Method massReset has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function massReset(App\Request $request): void
                                        {
                                            $moduleName = $request->getModule();
                                            $recordsList = Vtiger_Mass_Action::getRecordsListFromRequest($request);
                                            foreach ($recordsList as $userId) {
                                    Severity: Minor
                                    Found in modules/Users/actions/Password.php - About 1 hr to fix

                                      Method step1 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function step1(App\Request $request)
                                          {
                                              $qualifiedModuleName = $request->getModule(false);
                                      
                                              $params = $request->getByType('param', 'Text');
                                      Severity: Minor
                                      Found in modules/Settings/MappedFields/actions/SaveAjax.php - About 1 hr to fix

                                        Method getPicklistValuesForRole has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function getPicklistValuesForRole($roleIdList, $groupMode = 'INTERSECTION')
                                            {
                                                if (!$this->isRoleBased()) {
                                                    $fieldModel = new Vtiger_Field_Model();
                                                    return $fieldModel->getPicklistValues();
                                        Severity: Minor
                                        Found in modules/Settings/Picklist/models/Field.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language