YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method getTreeEntries has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTreeEntries()
    {
        $relModuleName = $this->getRelatedModuleModel()->getName();
        $relationModelInstance = $this->getRelationModel();
        $template = $this->getTreeViewModel()->getTemplate();
Severity: Minor
Found in modules/Vtiger/models/RelationListView.php - About 1 hr to fix

    Method updateUploadFiles has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updateUploadFiles(array $value, Vtiger_Record_Model $recordModel)
        {
            $previousValue = $recordModel->get($this->getFieldModel()->getName());
            $previousValue = ($previousValue && !\App\Json::isEmpty($previousValue)) ? \App\Fields\File::parse(\App\Json::decode($previousValue)) : [];
            $value = \App\Fields\File::parse($value);
    Severity: Minor
    Found in modules/Vtiger/uitypes/MultiAttachment.php - About 1 hr to fix

      Method checkUserPermissions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function checkUserPermissions()
          {
              \App\Log::trace('Entering ' . __METHOD__ . '() method ...');
              $permissions = $this->get('permissions');
              if (empty($permissions)) {
      Severity: Minor
      Found in modules/Vtiger/models/MappedFields.php - About 1 hr to fix

        Method getAutoCompleteField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getAutoCompleteField($recordModel): array
            {
                $fields = [];
                $fieldsReferenceList = [];
                $excludedModules = ['Users'];
        Severity: Minor
        Found in modules/Vtiger/models/Relation.php - About 1 hr to fix

          Method getQuery has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getQuery(App\Request $request)
              {
                  $cvId = $request->isEmpty('viewname') ? '' : $request->getByType('viewname', 2);
                  $moduleName = $request->getByType('module', 'Alnum');
                  if (!empty($cvId) && 'undefined' === $cvId && 'Users' !== $request->getByType('source_module', 2)) {
          Severity: Minor
          Found in modules/Vtiger/actions/Mass.php - About 1 hr to fix

            Method getModalLinks has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getModalLinks(Vtiger_Record_Model $recordModel)
                {
                    $links = Vtiger_Link_Model::getAllByType($recordModel->getModule()->getId(), ['QUICK_DETAIL_MODAL_HEADER'])['QUICK_DETAIL_MODAL_HEADER'] ?? [];
                    if ($recordModel->isEditable()) {
                        $links[] = Vtiger_Link_Model::getInstanceFromValues([
            Severity: Minor
            Found in modules/Vtiger/views/QuickDetailModal.php - About 1 hr to fix

              Method showModuleBasicView has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function showModuleBasicView(App\Request $request)
                  {
                      $recordId = $request->getInteger('record');
                      $moduleName = $request->getModule();
                      $recordModel = $this->record->getRecord();
              Severity: Minor
              Found in modules/Vtiger/views/Detail.php - About 1 hr to fix

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

                    public function process(App\Request $request)
                    {
                        if ($mode = $request->getMode()) {
                            $this->invokeExposedMethod($mode, $request);
                            return;
                Severity: Minor
                Found in modules/Vtiger/actions/SaveAjax.php - About 1 hr to fix

                  Method getListRecord has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getListRecord($module, array $columnList, $limit)
                      {
                          $moduleList = [];
                          $recordList = [];
                          if (!$module) {
                  Severity: Minor
                  Found in modules/Vtiger/helpers/ListUpdatedRecord.php - About 1 hr to fix

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

                        public function process(App\Request $request)
                        {
                            $currentUser = Users_Record_Model::getCurrentUserModel();
                            $viewer = $this->getViewer($request);
                            $moduleName = $request->getModule();
                    Severity: Minor
                    Found in modules/Vtiger/dashboards/Calendar.php - About 1 hr to fix

                      Method getRecords has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getRecords(\App\QueryGenerator $mainQueryGenerator, int $parentId, string $type = 'child'): void
                          {
                              if (0 === $this->limit || isset($this->recursion[$parentId][$type])) {
                                  return;
                              }
                      Severity: Minor
                      Found in api/webservice/WebservicePremium/BaseModule/Hierarchy.php - About 1 hr to fix

                        Method get has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get(): array
                            {
                                $file = $pdfFiles = $increment = [];
                                $recordId = $this->controller->request->getInteger('record');
                                foreach ($this->controller->request->getArray('templates', 'Integer') as $templateId) {
                        Severity: Minor
                        Found in api/webservice/WebservicePremium/BaseModule/Pdf.php - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if ($itemPropertyModel && isset($this->{$name}) && ($this->getId() || (!$this->getId() && '' !== $this->{$name}))) {
                                          $this->validateValue($name, $this->{$name});
                                          $forSave[$itemPropertyModel->getTableName()][$itemPropertyModel->getColumnName()] = $this->{$name};
                                      } elseif (isset($this->{$name}) && ($this->getId() || (!$this->getId() && '' !== $this->{$name}))) {
                                          $this->validateValue($name, $this->{$name});
                          Severity: Critical
                          Found in app/Fields/Picklist/Item.php - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ($request->isEmpty('record', true)
                                    || (!$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule()))
                                    || !$recordModel->isPermitted('WorkflowTrigger')
                                    || !$recordModel->isPermitted('DetailView')
                                    || (!$recordModel->isPermitted('EditView') || ($recordModel->isPermitted('EditView') && !$recordModel->isPermitted('WorkflowTriggerWhenRecordIsBlocked') && !$recordModel->isBlocked()))) {
                            Severity: Critical
                            Found in modules/Vtiger/actions/Workflow.php - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      if ($request->isEmpty('record', true)
                                        || (!$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule()))
                                        || !$recordModel->isPermitted('WorkflowTrigger')
                                        || !$recordModel->isPermitted('DetailView')
                                        || (!$recordModel->isPermitted('EditView') || ($recordModel->isPermitted('EditView') && !$recordModel->isPermitted('WorkflowTriggerWhenRecordIsBlocked') && !$recordModel->isBlocked()))) {
                              Severity: Critical
                              Found in modules/Vtiger/views/WorkflowTrigger.php - About 1 hr to fix

                                Function registerInactiveFieldsEvent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        registerInactiveFieldsEvent: function () {
                                            var thisInstance = this;
                                            var contents = this.container.find('.contents');
                                            contents.on('click', '.js-inactive-fields-btn', function (e) {
                                                let currentTarget = $(e.currentTarget);

                                  Function saveCustomRule has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          saveCustomRule: function (form, e) {
                                              const thisInstance = this;
                                              let data = form.serializeFormData();
                                              if (typeof data === 'undefined') {
                                                  data = {};

                                    Function callBackFunction has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                        callBackFunction = function (data) {
                                                            data.find('.addBlockModal').removeClass('d-none').show();
                                                            App.Fields.Picklist.showSelect2ElementView(data.find('select'));
                                                            let form = data.find('.addCustomBlockForm');
                                                            thisInstance.setBlocksListArray(form);

                                      Function registerVaribleToParsers has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              registerVaribleToParsers: function (container) {
                                                  container.find('.configButton').on('click', function (e) {
                                                      container.find('.js-toggle-hide .js-base-element').each(function (n, e) {
                                                          var currentElement = $(e);
                                                          if (currentElement.hasClass('d-none')) {

                                        Function registerLoadData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                registerLoadData: function () {
                                                    const thisInstance = this;
                                                    this.getContainer().on('change', '.js-base-user', function (e) {
                                                        let selectElement = jQuery(e.currentTarget),
                                                            panel = selectElement.closest('.js-panel-item'),
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language