YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        validate: function () {
            var field = this.getElement();
            var fieldData = field.data();
            var fieldDateFormat = fieldData.dateFormat;
            var fieldInfo = fieldData.fieldinfo;
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

    Function modalView has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                static modalView(params = {}) {
                    var aDeferred = $.Deferred();
                    let url = 'index.php?module=AppComponents&view=MediaModal';
                    if (params && Object.keys(params).length) {
                        url = app.convertObjectToUrl(params, url);
    Severity: Minor
    Found in public_html/layouts/resources/app.js - About 1 hr to fix

      Function setPopoverPosition has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          setPopoverPosition(popoverElement, container = $(window)) {
              let popover = this.getBindedPopover(popoverElement);
              if (!popover.length) {
                  return;
              }
      Severity: Minor
      Found in public_html/layouts/resources/app.js - About 1 hr to fix

        Function serializeFormData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.fn.serializeFormData = function () {
                for (let instance in CKEDITOR.instances) {
                    CKEDITOR.instances[instance].updateElement();
                }
                const form = this,
        Severity: Minor
        Found in public_html/layouts/resources/app.js - About 1 hr to fix

          Method getContextMessage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function getContextMessage()
              {
                  if (ROOT_DIRECTORY !== getcwd()) {
                      chdir(ROOT_DIRECTORY);
                  }
          Severity: Minor
          Found in app/Log/FileTarget.php - About 1 hr to fix

            Method getDefaultCvId has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getDefaultCvId()
                {
                    $cacheName = $this->moduleName . $this->user->getId();
                    if (Cache::has('GetDefaultCvId', $cacheName)) {
                        return Cache::get('GetDefaultCvId', $cacheName);
            Severity: Minor
            Found in app/CustomView.php - About 1 hr to fix

              Method getParent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getParent(int $record, string $moduleName): ?array
                  {
                      if (0 === \App\ModuleHierarchy::getModuleLevel($moduleName)) {
                          return ['id' => $record, 'moduleName' => $moduleName];
                      }
              Severity: Minor
              Found in app/Components/InterestsConflict.php - About 1 hr to fix

                Method parseConditions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function parseConditions(?array $conditions): array
                    {
                        if (empty($conditions)) {
                            return [];
                        }
                Severity: Minor
                Found in app/QueryGenerator.php - About 1 hr to fix

                  Method checkCondition has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function checkCondition(array $rule, \Vtiger_Record_Model $recordModel): bool
                      {
                          [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);
                          if ($sourceFieldName) {
                              if ($recordModel->isEmpty($sourceFieldName)) {
                  Severity: Minor
                  Found in app/Condition.php - About 1 hr to fix

                    Method getQueryRelatedField has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getQueryRelatedField($relatedInfo, ?\Vtiger_Field_Model $field = null)
                        {
                            if (!\is_array($relatedInfo)) {
                                [$fieldName, $relatedModule, $sourceFieldName] = array_pad(explode(':', $relatedInfo), 3, false);
                                $relatedInfo = [
                    Severity: Minor
                    Found in app/QueryGenerator.php - About 1 hr to fix

                      Method getRecordNumberFromString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getRecordNumberFromString(string $value, string $moduleName, bool $multi = false)
                          {
                              $moduleData = \App\Fields\RecordNumber::getInstance($moduleName);
                              $prefix = str_replace(['\{\{YYYY\}\}', '\{\{YY\}\}', '\{\{MM\}\}', '\{\{DD\}\}', '\{\{M\}\}', '\{\{D\}\}'], ['\d{4}', '\d{2}', '\d{2}', '\d{2}', '\d{1,2}', '\d{1,2}'], preg_quote($moduleData->get('prefix'), '/'));
                              $postfix = str_replace(['\{\{YYYY\}\}', '\{\{YY\}\}', '\{\{MM\}\}', '\{\{DD\}\}', '\{\{M\}\}', '\{\{D\}\}'], ['\d{4}', '\d{2}', '\d{2}', '\d{2}', '\d{1,2}', '\d{1,2}'], preg_quote($moduleData->get('postfix'), '/'));
                      Severity: Minor
                      Found in app/Mail/RecordFinder.php - About 1 hr to fix

                        Method getLibraryValues has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function getLibraryValues($name, $dir): array
                            {
                                $library = ['name' => $name, 'version' => '', 'license' => '', 'homepage' => ''];
                                $existJsonFiles = true;
                                foreach (self::$jsonFiles as $file) {
                        Severity: Minor
                        Found in app/Installer/Credits.php - About 1 hr to fix

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

                              public function process(): string
                              {
                                  $html = '';
                                  $moduleName = 'Calendar';
                                  if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
                          Severity: Minor
                          Found in app/TextParser/UserCalendar.php - About 1 hr to fix

                            Method getConfirmQuery has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
                                {
                                    $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                                    $columns = [];
                                    foreach ($request->getArray('columns') as $key => $value) {
                            Severity: Minor
                            Found in app/Controller/Components/Action/InterestsConflict.php - About 1 hr to fix

                              Method fromArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function fromArray(array $data)
                                  {
                                      $name = $data['name'] ?? '';
                                      $self = new static($name);
                                      $self->label = \App\Purifier::purifyByType($data['label'] ?? '', \App\Purifier::TEXT);
                              Severity: Minor
                              Found in app/YetiForce/Shop/AbstractBaseProduct.php - About 1 hr to fix

                                Method getHtmlLink has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function getHtmlLink(int $id, ?string $moduleName = null, ?int $length = null, bool $fullUrl = false): string
                                    {
                                        $state = self::getState($id);
                                        if (null === $state) {
                                            return '<i class="color-red-500" title="' . $id . '">' . Language::translate('LBL_RECORD_DOES_NOT_EXIST') . '</i>';
                                Severity: Minor
                                Found in app/Record.php - About 1 hr to fix

                                  Method parseBusinessHoursToDays has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private static function parseBusinessHoursToDays(array $rows): array
                                      {
                                          $days = $holidays = [];
                                          foreach ($rows as $row) {
                                              foreach (explode(',', $row['working_days']) as $day) {
                                  Severity: Minor
                                  Found in app/Utils/ServiceContracts.php - About 1 hr to fix

                                    Method transferOwnership has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function transferOwnership($oldId, $newId)
                                        {
                                            $db = \App\Db::getInstance();
                                            //Updating the smcreatorid,smownerid, modifiedby, smcreatorid in vtiger_crmentity
                                            $db->createCommand()->update('vtiger_crmentity', ['smcreatorid' => $newId], ['smcreatorid' => $oldId, 'setype' => 'ModComments'])->execute();
                                    Severity: Minor
                                    Found in app/Fields/Owner.php - About 1 hr to fix

                                      Method validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function validate(?string $type = null): bool
                                          {
                                              $return = true;
                                              try {
                                                  if ($type && $this->getShortMimeType(0) !== $type) {
                                      Severity: Minor
                                      Found in app/Fields/File.php - About 1 hr to fix

                                        Method init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static function init()
                                            {
                                                $targets = [];
                                                if (\App\Config::debug('LOG_TO_FILE')) {
                                                    $levels = \App\Config::debug('LOG_LEVELS');
                                        Severity: Minor
                                        Found in app/Debuger.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language