YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method setDataFromRequest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        foreach (array_keys($this->getEditFields()) as $field) {
            if ($request->has($field)) {
                switch ($field) {
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/WebserviceStandard.php - About 1 hr to fix

    Method getFieldInstanceByName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getFieldInstanceByName($name)
        {
            $moduleName = $this->getModule()->getName(true);
            $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
            switch ($name) {
    Severity: Minor
    Found in modules/Settings/SMSNotifier/models/Record.php - About 1 hr to fix

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

          public function process(App\Request $request)
          {
              $qualifiedModuleName = $request->getModule(false);
              $recordId = $request->isEmpty('record', true) ? 0 : $request->getInteger('record');
              $moduleModelList = Settings_PickListDependency_Module_Model::getPicklistSupportedModules();
      Severity: Minor
      Found in modules/Settings/PickListDependency/views/Edit.php - About 1 hr to fix

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

            public function process(App\Request $request)
            {
                $qualifiedModuleName = $request->getModule(false);
                $supportedModules = Settings_RecordNumbering_Module_Model::getSupportedModules();
                $sourceModule = $request->getByType('sourceModule', 2);
        Severity: Minor
        Found in modules/Settings/RecordNumbering/views/CustomRecordNumbering.php - About 1 hr to fix

          Method getRenewalValue has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getRenewalValue()
              {
                  if ($this->isEmpty('product') || !\App\Record::isExists($this->get('product'), 'Products')) {
                      return 'PLL_NOT_APPLICABLE_VERIFICATION';
                  }
          Severity: Minor
          Found in modules/Assets/models/Record.php - About 1 hr to fix

            Method getRecordsByStatus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getRecordsByStatus(array $params, Vtiger_Paging_Model $pagingModel, $user): array
                {
                    if (!$user) {
                        $user = \App\User::getCurrentUserId();
                    }
            Severity: Minor
            Found in modules/ProjectTask/models/Module.php - About 1 hr to fix

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

                  public function process(App\Request $request)
                  {
                      $viewer = $this->getViewer($request);
                      $moduleName = $request->getModule();
                      $widget = Vtiger_Widget_Model::getInstance($request->getInteger('linkid'), \App\User::getCurrentUserId());
              Severity: Minor
              Found in modules/ProjectTask/dashboards/UpcomingProjectTasks.php - About 1 hr to fix

                Method downloadFiles has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function downloadFiles($recordsIds)
                    {
                        $zip = new ZipArchive();
                        $postfix = time() . '_' . random_int(0, 1000);
                        $zipPath = ROOT_DIRECTORY . '/cache/';
                Severity: Minor
                Found in modules/Documents/models/Record.php - About 1 hr to fix

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

                      public function validate($value, $isUserFormat = false)
                      {
                          $hashValue = \is_array($value) ? md5(print_r($value, true)) : $value;
                          if (isset($this->validate[$hashValue]) || empty($value)) {
                              return;
                  Severity: Minor
                  Found in modules/Vtiger/uitypes/MultiAttachment.php - About 1 hr to fix

                    Method getCustomViewList has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getCustomViewList(): array
                        {
                            if (isset($this->customViewList)) {
                                return $this->customViewList;
                            }
                    Severity: Minor
                    Found in modules/Vtiger/models/Relation.php - About 1 hr to fix

                      Method reloadCache has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function reloadCache()
                          {
                              $members = $users = [];
                              $dataReader = (new App\Db\Query())->from('u_#__watchdog_module')->createCommand()->query();
                              while ($row = $dataReader->read()) {
                      Severity: Minor
                      Found in modules/Vtiger/models/Watchdog.php - About 1 hr to fix

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

                            public function checkUserPermissions()
                            {
                                $permissions = $this->get('template_members');
                                if (empty($permissions)) {
                                    return true;
                        Severity: Minor
                        Found in modules/Vtiger/models/PDF.php - About 1 hr to fix

                          Method showTaxes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function showTaxes(App\Request $request)
                              {
                                  $moduleName = $request->getModule();
                                  $record = $request->getInteger('record');
                                  $recordModule = $request->getByType('recordModule', 'Alnum');
                          Severity: Minor
                          Found in modules/Vtiger/views/Inventory.php - About 1 hr to fix

                            Method getFieldInstanceByName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getFieldInstanceByName($name)
                                {
                                    if (!isset($this->customFields[$name])) {
                                        return parent::getFieldInstanceByName($name);
                                    }
                            Severity: Minor
                            Found in modules/Vtiger/dashboards/MiniListModel.php - About 1 hr to fix

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

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

                                Method handleError has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function handleError(): void
                                    {
                                        if (\App\Config::debug('apiLogException')) {
                                            $request = Request::init();
                                            $error = "code: {$this->getCode()} | message: {$this->getMessage()}\n";
                                Severity: Minor
                                Found in api/webservice/Core/Exception.php - About 1 hr to fix

                                  Function loadFieldSpecificUi has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          loadFieldSpecificUi(fieldSelect) {
                                              const selectedOption = fieldSelect.find('option:selected');
                                              const row = fieldSelect.closest('div.js-conditions-row');
                                              const fieldUiHolder = row.find('.fieldUiHolder');
                                              const fieldInfo = selectedOption.data('fieldinfo');

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function saveFieldValues has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          saveFieldValues: function (fieldDetailList) {
                                              var aDeferred = jQuery.Deferred();
                                              var recordId = this.getRecordId();
                                  
                                              var data = {};
                                  Severity: Minor
                                  Found in public_html/layouts/basic/modules/Leads/resources/Detail.js - About 1 hr to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function getRecordsListParams has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          getRecordsListParams: function (container) {
                                              let formElement = container.closest('form');
                                              let sourceModule = $('input[name="module"]', formElement).val();
                                              let popupReferenceModule = $('input[name="popupReferenceModule"]', container).val();
                                              let sourceFieldElement = $('input[class="sourceField"]', container);
                                  Severity: Minor
                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 1 hr to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function registerKeyboardShortcutsEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          registerKeyboardShortcutsEvent: function () {
                                              document.addEventListener('keydown', (event) => {
                                                  if (event.shiftKey && event.ctrlKey && event.code === 'KeyS') {
                                                      let form = event.target.closest('form');
                                                      if (form) {
                                  Severity: Minor
                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 1 hr to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language