YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method preProcessAjax has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function preProcessAjax(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $sourceModule = $request->getByType('sourceModule', 2);
Severity: Minor
Found in modules/Vtiger/views/DashBoard.php - About 1 hr to fix

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

        public function process(App\Request $request)
        {
            $moduleModel = Vtiger_Module_Model::getInstance($request->getModule());
            $primaryRecord = $request->getInteger('record');
            $migrate = [];
    Severity: Minor
    Found in modules/Vtiger/actions/MergeRecords.php - About 1 hr to fix

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

          public function process()
          {
              $html = '';
              foreach (\App\SystemWarnings::getWarnings('all') as $warning) {
                  if ('YetiForce' === $warning->getFolder()) {
      Severity: Minor
      Found in modules/Vtiger/crons/SystemWarnings.php - About 1 hr to fix

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

            public function get(App\Request $request)
            {
                if ($request->isEmpty('key', 2)) {
                    throw new \App\Exceptions\NoPermitted('Not Acceptable', 406);
                }
        Severity: Minor
        Found in modules/Vtiger/files/MultiImage.php - About 1 hr to fix

          Method saveHistory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function saveHistory($title)
              {
                  if (empty(App\User::getCurrentUserId())) {
                      return false;
                  }
          Severity: Minor
          Found in modules/Vtiger/helpers/BrowsingHistory.php - About 1 hr to fix

            Method getImportDetails has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getImportDetails(App\User $user, $forModule)
                {
                    $db = App\Db::getInstance();
                    $importRecords = [];
                    $tableName = Import_Module_Model::getDbTableName($user);
            Severity: Minor
            Found in modules/Import/actions/Data.php - About 1 hr to fix

              Method add has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function add(App\Request $request, App\User $user)
                  {
                      if ($request->get('is_scheduled')) {
                          $temp_status = self::$IMPORT_STATUS_SCHEDULED;
                      } else {
              Severity: Minor
              Found in modules/Import/actions/Queue.php - About 1 hr to fix

                Method getFilterFields has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getFilterFields($moduleName): array
                    {
                        if (!isset($this->filterFields)) {
                            $this->filterFields = [];
                            $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
                Severity: Minor
                Found in modules/FInvoice/dashboards/SummationByMonths.php - About 1 hr to fix

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

                      public function get(): array
                      {
                          $parentId = \App\Record::getParentRecord($this->getUserCrmId());
                          if (\in_array($this->getPermissionType(), [\Api\WebservicePremium\Privilege::ACCOUNTS_RELATED_RECORDS_IN_HIERARCHY, \Api\WebservicePremium\Privilege::ACCOUNTS_RELATED_RECORDS_AND_LOWER_IN_HIERARCHY])) {
                              $fields = \App\Field::getRelatedFieldForModule($this->moduleName);
                  Severity: Minor
                  Found in api/webservice/WebservicePremium/BaseModule/Hierarchy.php - About 1 hr to fix

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

                        public function get(): array
                        {
                            $limit = 50;
                            if ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {
                                $limit = (int) $requestLimit;
                    Severity: Minor
                    Found in api/webservice/WebserviceStandard/Users/AccessActivityHistory.php - About 1 hr to fix

                      Method checkAccess has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function checkAccess(): void
                          {
                              $db = \App\Db::getInstance('webservice');
                              $userData = (new \App\Db\Query())->from($this->controller->app['tables']['user'])
                                  ->where(['server_id' => $this->controller->app['id'], 'user_name' => $this->controller->request->get('userName'), 'status' => 1])
                      Severity: Minor
                      Found in api/webservice/WebserviceStandard/Users/Login.php - About 1 hr to fix

                        Method preProcess has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function preProcess(): bool
                            {
                                register_shutdown_function(function () {
                                    if ($error = error_get_last()) {
                                        $this->errorHandler($error['type'], $error['message'], $error['file'], $error['line']);
                        Severity: Minor
                        Found in api/webservice/Controller.php - About 1 hr to fix

                          Function registerUserList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function registerUserList() {
                              var selectUsers = $('.js-header__btn--mail select');
                              if (selectUsers.data('select2')) {
                                  selectUsers.select2('destroy');
                              } else {
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/OSSMail/resources/checkmails.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 widgetRelatedRecordView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  widgetRelatedRecordView: function (container, load) {
                                      let cacheKey = this.getRecordId() + '_' + container.data('id');
                                      let relatedRecordCacheID = app.moduleCacheGet(cacheKey);
                                      if (relatedRecordCacheID !== null) {
                                          let newActive = container.find(".js-carousel-item[data-id = '" + relatedRecordCacheID + "']");
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Vtiger/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 toggleTimesInputs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  toggleTimesInputs: function (container) {
                                      container.find(':checkbox').on('change', function () {
                                          var checkboxName = $(this).attr('name');
                                          if ('allday' == checkboxName) {
                                              var checkboxIsChecked = $(this).is(':checked');
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Calendar/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 changeCustomFilterElementView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  changeCustomFilterElementView: function () {
                                      const thisInstance = this;
                                      let filterSelectElement = this.getFilterSelectElement();
                                      if (filterSelectElement.length > 0 && filterSelectElement.is('select')) {
                                          App.Fields.Picklist.showSelect2ElementView(filterSelectElement, {
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Vtiger/resources/List.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 calculatePages has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  calculatePages: function () {
                                      let aDeferred = $.Deferred();
                                      let element = $('#totalPageCount');
                                      let totalPageNumber = element.text();
                                      if (totalPageNumber == '') {
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Vtiger/resources/List.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 jumpToPage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  jumpToPage(e) {
                                      const self = this,
                                          listViewPageDiv = this.getListViewContainer();
                                      if (13 === e.which) {
                                          e.stopImmediatePropagation();
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Vtiger/resources/List.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 getFieldSpecificUi has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  getFieldSpecificUi: function (fieldSelectElement) {
                                      let fieldModel = this.fieldModelInstance,
                                          html;
                                      if (fieldModel.get('comparatorElementVal') === 'd') {
                                          html = '<div class="checkbox"><label><input type="checkbox" name="' + fieldModel.getName() + '" value="0" ';
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilter.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 exportSharingAccess has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function exportSharingAccess(ModuleBasic $moduleInstance)
                              {
                                  $permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
                                  if (empty($permission)) {
                                      return;
                          Severity: Minor
                          Found in vtlib/Vtiger/PackageExport.php - 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