YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Consider simplifying this complex logical expression.
Open

        if (null !== $value && (0 === $value || '0' === $value || 'off' === strtolower($value) || 'no' === strtolower($value) || false === $value)) {
            return App\Language::translate('LBL_NO', $this->getFieldModel()->getModuleName());
        }
Severity: Major
Found in modules/Vtiger/uitypes/Boolean.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

            if (!isset($this->privileges['Unlock'])) {
                $this->privileges['Unlock'] = !$this->isNew() && $this->isPermitted('EditView') && $this->isPermitted('OpenRecord')
                    && false === Users_Privileges_Model::checkLockEdit($this->getModuleName(), $this) && !$this->isLockByFields() && !empty($this->getUnlockFields(true));
            }
    Severity: Major
    Found in modules/Vtiger/models/Record.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (!(('Archived' === $request->getByType('state') && $this->record->privilegeToArchive()) ||
                  ('Trash' === $request->getByType('state') && $this->record->privilegeToMoveToTrash()) ||
                  ('Active' === $request->getByType('state') && $this->record->privilegeToActivate()))
              ) {
                  throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
      Severity: Major
      Found in modules/Vtiger/actions/State.php - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                        if ($attach || $emailPdf || ($countTemplates > 1 || (1 === $countTemplates && !isset($skip[$templateId]) && $countRecords > 1))) {
                            $fileName = ($pdf->getFileName() ?: time());
                            $increment[$fileName] = $increment[$fileName] ?? 0;
                            $fileName .= ($increment[$fileName]++ > 0 ? '_' . $increment[$fileName] : '') . '.pdf';
        
        
        Severity: Major
        Found in modules/Vtiger/actions/PDF.php - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                          if ($moduleField->isActiveField() &&
                              'vtiger_entity_stats' !== $moduleField->getTableName() &&
                              !\in_array($moduleField->getColumnName(), ['modifiedby', 'modifiedtime']) &&
                              !\in_array($moduleField->getUIType(), [70, 4]) &&
                              0 !== strcasecmp($moduleField->getFieldDataType(), 'autogenerated') &&
          Severity: Major
          Found in modules/Import/models/Module.php - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                        if ((!$recordModel->isEmpty('addresslevel5' . $typeAddress) || !$recordModel->isEmpty('addresslevel4' . $typeAddress) || !$recordModel->isEmpty('addresslevel3' . $typeAddress) || !$recordModel->isEmpty('addresslevel2' . $typeAddress)) && ($recordModel->isNew() || \in_array($typeAddress, $typeAddressToUpdate))) {
                            $isCoordinateExists = (new App\Db\Query())
                                ->from('u_#__openstreetmap_record_updater')
                                ->where(['type' => $typeAddress, 'crmid' => $recordModel->getId()])
                                ->exists();
            Severity: Major
            Found in modules/OpenStreetMap/handlers/OpenStreetMapHandler.php - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                          if (($isCreate = $recordModel->isCreate()) || $recordModel->isUpdate() || $recordModel->isTransferEdit()) {
                              $data = [];
                              foreach ($recordModel->getFieldInstances() as $fieldModel) {
                                  if ($fieldModel && ($fieldInstance = $fieldModel->getFieldInstance())) {
                                      \Api\WebserviceStandard\Fields::loadWebserviceByField($fieldInstance, $this);
              Severity: Major
              Found in api/webservice/WebserviceStandard/BaseModule/RecordHistory.php - About 40 mins to fix

                Function getInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        getInstance: function (parentId, parentModule, selectedRelatedTabElement, relatedModuleName, url) {
                Severity: Minor
                Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 35 mins to fix

                  Function addRelationBetweenRecords has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          addRelationBetweenRecords: function (relatedModule, relatedModuleRecordId, selectedTabElement, params = {}, url) {
                  Severity: Minor
                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 35 mins to fix

                    Function saveWidget has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            saveWidget: function (form, mode, sourceModule, linkid, type) {
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/DashBoard.js - About 35 mins to fix

                      Function enableCopyAddressFromModule has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              enableCopyAddressFromModule: function (moduleName, formElement, className, fieldName, label) {
                      Severity: Minor
                      Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 35 mins to fix

                        Method register has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public static function register(string $prefix, string $name = '', ?bool $isDefault = false, bool $isActive = true, int $progress = 0)
                        Severity: Minor
                        Found in vtlib/Vtiger/LanguageExport.php - About 35 mins to fix

                          Method register has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public static function register($name, $label = '', $isdefault = false, $isactive = true, $overrideCore = false)
                          Severity: Minor
                          Found in vtlib/Vtiger/LayoutExport.php - About 35 mins to fix

                            Method updateField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
                            Severity: Minor
                            Found in vtlib/Vtiger/PackageUpdate.php - About 35 mins to fix

                              Method saveRule has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  private function saveRule($forModule, $ruleId, $permission, $sourceId, $targetId)
                              Severity: Minor
                              Found in tests/Settings/SharingAccess.php - About 35 mins to fix

                                Method getAllModules has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
                                Severity: Minor
                                Found in vtlib/Vtiger/Functions.php - About 35 mins to fix

                                  Method getDisplayValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public function getDisplayValue(\Vtiger_Field_Model $fieldModel, $value, int $recordId, array $rowData, $length = 65000)
                                  Severity: Minor
                                  Found in app/Export/Records.php - About 35 mins to fix

                                    Method addCondition has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public function addCondition($fieldName, $value, $operator, $groupAnd = true, $userFormat = false)
                                    Severity: Minor
                                    Found in app/QueryGenerator.php - About 35 mins to fix

                                      Method translate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public static function translate(string $key, string $moduleName = '_Base', ?string $language = null, bool $encode = true, ?string $secondModuleName = null)
                                      Severity: Minor
                                      Found in app/Language.php - About 35 mins to fix

                                        Method populateSharingPrivileges has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                                        Severity: Minor
                                        Found in app/UserPrivilegesFile.php - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language