YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function process(App\Request $request)
    {
        $this->initMeetingData($request);
        $url = $this->meetingUrl;
        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Vtiger/views/MeetingModal.php - About 1 hr to fix

    Method loadFieldValuesFromSource has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function loadFieldValuesFromSource(App\Request $request): array
        {
            $this->hiddenInput['sourceView'] = $request->getByType('sourceView');
            $this->hiddenInput['sourceModule'] = $request->getByType('sourceModule', 'Alnum');
            $this->hiddenInput['entityState'] = $request->getByType('entityState', 'Alnum');
    Severity: Minor
    Found in modules/Vtiger/views/MassQuickCreateModal.php - About 1 hr to fix

      Method checkImportStatus has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function checkImportStatus(App\Request $request)
          {
              $moduleName = $request->getModule();
              $user = \App\User::getCurrentUserModel();
              // Check if import on the module is locked
      Severity: Minor
      Found in modules/Vtiger/views/Import.php - About 1 hr to fix

        Method getReference has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getReference(App\Request $request): void
            {
                if ($request->has('fieldName')) {
                    $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
                    if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
        Severity: Minor
        Found in modules/Vtiger/actions/Fields.php - About 1 hr to fix

          Method getDefaultFieldValues has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getDefaultFieldValues()
              {
                  $key = $this->module . '_' . $this->user->getId();
                  if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                      return \App\Cache::staticGet('DefaultFieldValues', $key);
          Severity: Minor
          Found in modules/Import/actions/Data.php - About 1 hr to fix

            Method getQueryByModuleField has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
                {
                    if ('SRecurringOrders' === $sourceModule && $record) {
                        $queryGenerator->addJoin(['INNER JOIN', 'u_#__srecurringorders', 'u_#__srecurringorders.accountid = vtiger_contactdetails.parentid AND u_#__srecurringorders.srecurringordersid = :records', [':records' => $record]]);
                    }
            Severity: Minor
            Found in modules/Contacts/models/Module.php - About 1 hr to fix

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

                  public function get(): array
                  {
                      $this->createQuery();
                      $limit = $this->queryGenerator->getLimit();
                      $isRawData = $this->isRawData();
              Severity: Minor
              Found in api/webservice/WebserviceStandard/BaseModule/RecordsList.php - About 1 hr to fix

                Method post has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function setCalendarModuleOptions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      setCalendarModuleOptions() {
                          const self = this;
                          return {
                              allDaySlot: app.getMainParams('allDaySlot'),
                              dateClick: (args) => {

                  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 getRule has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          getRule: function () {
                              var form = this.getForm();
                              var freq = form.find('.recurringType').val();
                              var rule = 'FREQ=' + freq;
                              rule += ';INTERVAL=' + form.find('.repeatFrequency').val();
                  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 getUi has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          getUi: function () {
                              let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
                                  html = '',
                                  selectContainer;
                              if (
                  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 calculateTax has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          calculateTax: function (_row, modal) {
                              let netPriceWithoutTax = App.Fields.Double.formatToDb(modal.find('.valueNetPrice').text()),
                                  valuePrices = netPriceWithoutTax,
                                  globalTax = 0,
                                  groupTax = 0,
                  Severity: Minor
                  Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.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 validateCustomMap has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          validateCustomMap: function () {
                              var errorMessage;
                              var params = {};
                              var saveMap = jQuery('#save_map').is(':checked');
                              if (saveMap) {
                  Severity: Minor
                  Found in public_html/layouts/basic/modules/Import/resources/Import.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 getDateInstance has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          getDateInstance: function (dateTime, dateFormat = CONFIG.dateFormat) {
                              let dateTimeComponents = dateTime.split(' '),
                                  dateComponent = dateTimeComponents[0],
                                  timeComponent = dateTimeComponents[1],
                                  seconds = '00',
                  Severity: Minor
                  Found in public_html/layouts/resources/Fields.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 validate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          validate: function (dependentFieldList) {
                              var field = this.getElement();
                              var fieldInfo = field.data('fieldinfo');
                              var fieldLabel;
                              if (typeof fieldInfo === 'undefined') {
                  Severity: Minor
                  Found in public_html/layouts/resources/validator/FieldValidator.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 registerModalController has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      registerModalController: function (modalId, modalContainer, cb) {
                          let windowParent = this.childFrame ? window.parent : window;
                          if (!modalId) {
                              modalId = Window.lastModalId;
                          }
                  Severity: Minor
                  Found in public_html/layouts/resources/app.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 sidebarKeyboard has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      sidebarKeyboard: function (e) {
                          let target = $(e.target);
                          if (e.which == this.keyboard.LEFT) {
                              if (target.hasClass('js-submenu-toggler') && !target.hasClass('collapsed')) {
                                  target.click();
                  Severity: Minor
                  Found in public_html/layouts/resources/app.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 testCreateNewField has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function testCreateNewField($type, $param, $suffix = '')
                      {
                          $key = $type . $suffix;
                          $param['fieldType'] = $type;
                          $param['fieldLabel'] = $type . 'FL' . $suffix;
                  Severity: Minor
                  Found in tests/Settings/ModuleManager.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

                  Function deleteModuleTables has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function deleteModuleTables()
                      {
                          \App\Log::trace('Start', __METHOD__);
                          $db = \App\Db::getInstance();
                          $db->createCommand()->checkIntegrity(false)->execute();
                  Severity: Minor
                  Found in vtlib/Vtiger/ModuleBasic.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

                  Function getAllModuleFieldsAsHeaders has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getAllModuleFieldsAsHeaders(): array
                      {
                          $headers = [];
                          $exportBlockName = \App\Config::component('Export', 'BLOCK_NAME');
                          foreach ($this->moduleFieldInstances as $fieldModel) {
                  Severity: Minor
                  Found in app/Export/Records.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