YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method getCVModelFromRequest has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getCVModelFromRequest(App\Request $request)
    {
        $cvId = $request->getInteger('record');
        if (!empty($cvId)) {
            $customViewModel = CustomView_Record_Model::getInstanceById($cvId);
Severity: Minor
Found in modules/CustomView/actions/Save.php - About 1 hr to fix

    Method getListViewDisplayValue has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getListViewDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
        {
            $values = \App\Fields\SharedOwner::getById($record);
            if (empty($values)) {
                return '';
    Severity: Minor
    Found in modules/Vtiger/uitypes/SharedOwner.php - About 1 hr to fix

      Method getDisplayValue has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
          {
              $isAdmin = \App\User::getCurrentUserModel()->isAdmin();
              if (empty($value)) {
                  return '';
      Severity: Minor
      Found in modules/Vtiger/uitypes/SharedOwner.php - About 1 hr to fix

        Method getActivities has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getActivities(App\Request $request)
            {
                $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                if (!$userPrivilegesModel->hasModulePermission('Calendar')) {
                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
        Severity: Minor
        Found in modules/Vtiger/views/Detail.php - About 1 hr to fix

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

              public function getQuery(App\Request $request): App\Db\Query
              {
                  $moduleName = $request->getModule();
                  $sourceModule = $request->getByType('sourceModule', 2);
                  if ($sourceModule) {
          Severity: Minor
          Found in modules/Vtiger/actions/Mail.php - About 1 hr to fix

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

                public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
                {
                    \App\Log::trace('Entering getParent(' . $id . ') method ...');
                    if ($depthBase === \App\Config::module('HelpDesk', 'MAX_HIERARCHY_DEPTH')) {
                        \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
            Severity: Minor
            Found in modules/HelpDesk/models/Module.php - About 1 hr to fix

              Method read has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function read()
                  {
                      $defaultCharset = App\Config::main('default_charset');
                      $this->createTable();
              
              
              Severity: Minor
              Found in modules/Import/readers/XmlReader.php - About 1 hr to fix

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

                    public function process(App\Request $request)
                    {
                        $currentUser = Users_Record_Model::getCurrentUserModel();
                        $moduleName = 'Home';
                        $page = $request->getInteger('page');
                Severity: Minor
                Found in modules/Vtiger/dashboards/OverdueActivities.php - About 1 hr to fix

                  Method getTicketsByUser has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getTicketsByUser($time)
                      {
                          $moduleName = 'HelpDesk';
                          $ticketStatus = Settings_SupportProcesses_Module_Model::getTicketStatusNotModify();
                          $listViewUrl = Vtiger_Module_Model::getInstance($moduleName)->getListViewUrl();
                  Severity: Minor
                  Found in modules/HelpDesk/dashboards/ClosedTicketsByUser.php - About 1 hr to fix

                    Function checkPrefix has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            checkPrefix() {
                                let sequenceExists = false;
                                const editViewForm = this.getForm();
                                const value = editViewForm.find('[name="reset_sequence"]').val();
                                const prefix = editViewForm.find('[name="prefix"]').val();

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

                            registerSplit: function (container) {
                                let rightSplitMaxWidth = (400 / this.windowW) * 100;
                                const splitSizes = this.getSplitSizes();
                                app.moduleCacheSet('gutterRelatedMidPosition', splitSizes);
                                let split = Split([this.list[0], this.preview[0]], {
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.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 setDefaultEndTime has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            setDefaultEndTime: function (container) {
                                const self = this;
                                if (container.find('.js-autofill').is(':checked')) {
                                    self.getFreeTime(container);
                                } else {
                    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 pageJumpHandler has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            pageJumpHandler: function (e) {
                                let aDeferred = jQuery.Deferred();
                                let thisInstance = this;
                                if (e.which == 13) {
                                    let element = jQuery(e.currentTarget);
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.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 mapAddressDetails has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            mapAddressDetails: function (result, container) {
                                for (let key in result) {
                                    if (key.indexOf('addresslevel') != -1) {
                                        if (container.find('[name="' + key + '"]').length != 0) {
                                            container.find('[name="' + key + '"]').val(result['data'][key]);
                    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 calculateDiscount has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            calculateDiscount: function (_row, modal) {
                                const netPriceBeforeDiscount = App.Fields.Double.formatToDb(modal.find('.valueTotalPrice').text()),
                                    discountsType = modal.find('.discountsType').val();
                                let valuePrices = netPriceBeforeDiscount,
                                    globalDiscount = 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 convertOptionsToJSONArray has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            convertOptionsToJSONArray: function (objName, targetObjName) {
                                let obj = jQuery(objName);
                                let arr = [];
                                if (typeof obj !== 'undefined' && obj[0] != '') {
                                    for (let i = 0; i < obj[0].length; ++i) {
                    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 loadFieldSpecificUi has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            loadFieldSpecificUi: function (fieldSelect) {
                                const selectedOption = fieldSelect.find('option:selected');
                                const row = fieldSelect.closest('div.js-conditions-row');
                                const fieldUiHolder = row.find('.fieldUiHolder');
                                const conditionSelectElement = row.find('select[name="comparator"]');
                    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 setCalendarBasicOptions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        setCalendarBasicOptions() {
                            let eventLimit = app.getMainParams('eventLimit'),
                                userView = app.getMainParams('activity_view'),
                                defaultView = app.moduleCacheGet('defaultView'),
                                userTimeFormat = CONFIG.hourFormat;
                    Severity: Minor
                    Found in public_html/layouts/resources/Calendar.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 setMarkers has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            setMarkers: function (data) {
                                var thisInstance = this;
                                var markerArray = [];
                                var container = this.container;
                                var map = this.mapInstance;
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.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 playNotificationSound has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        playNotificationSound({ getters }, { roomList, firstFetch }) {
                            if (getters.isSoundNotification) {
                                let areNewMessagesForRoom = (roomType, room) => roomList[roomType][room].cnt_new_message > getters.data.roomList[roomType][room].cnt_new_message
                                if (firstFetch) {
                                    areNewMessagesForRoom = (roomType, room) => roomList[roomType][room].cnt_new_message >= getters.data.roomList[roomType][room].cnt_new_message
                    Severity: Minor
                    Found in public_html/src/layouts/basic/modules/Chat/store/actions.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