YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function addMiniListWidget has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        addMiniListWidget: function (element, url) {
            // 1. Show popup window for selection (module, filter, fields)
            // 2. Compute the dynamic mini-list widget url
            // 3. Add widget with URL to the page.
            const thisInstance = this;

    Function getDateRangeByType has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getDateRangeByType($type, $dateObject = null)
        {
            $currentUser = \App\User::getCurrentUserModel();
            $weekStartDay = $currentUser->getDetail('dayoftheweek');
    
    
    Severity: Minor
    Found in include/fields/DateTimeRange.php - About 5 hrs 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 getRelatedLevelVariable has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getRelatedLevelVariable($fieldType = false)
        {
            $cacheKey = "{$this->moduleName}|$fieldType";
            if (isset(static::$relatedVariableLevel[$cacheKey])) {
                return static::$relatedVariableLevel[$cacheKey];
    Severity: Minor
    Found in app/TextParser.php - About 5 hrs 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 getExpectedTimes has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function getExpectedTimes(int $id, \Vtiger_Record_Model $recordModel, array $type): array
        {
            $return = [];
            $date = new \DateTime();
            if ($id && ($rules = self::getRulesForServiceContracts($id, $recordModel)) || ($rules = self::getSlaPolicyRulesForModule($recordModel))) {
    Severity: Minor
    Found in app/Utils/ServiceContracts.php - About 5 hrs 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 doTask has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

        public function doTask($recordModel)
        {
            if (!empty($this->template)) {
                $mailerContent = [];
                if (!empty($this->smtp)) {
    Severity: Minor
    Found in modules/com_vtiger_workflow/tasks/VTEmailTemplateTask.php - About 5 hrs 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

    File Module.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Settings OSSMailView index view class.
     *
     * @copyright YetiForce S.A.
    Severity: Minor
    Found in modules/Settings/WidgetsManagement/models/Module.php - About 5 hrs to fix

      `` has 43 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default {
          setDialog(state, idOpen) {
              state.session.dialog = idOpen
          },
          miniMode(state, isMini) {
      Severity: Minor
      Found in public_html/src/layouts/basic/modules/Chat/store/mutations.js - About 5 hrs to fix

        PrivilegeUtil has 43 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PrivilegeUtil
        {
            /** @var int Allowed group nests */
            public const GROUP_LOOP_LIMIT = 5;
        
        
        Severity: Minor
        Found in app/PrivilegeUtil.php - About 5 hrs to fix

          Method purifyByType has 145 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function purifyByType($input, $type, $convert = false)
              {
                  if (\is_array($input)) {
                      $value = [];
                      foreach ($input as $k => $v) {
          Severity: Major
          Found in app/Purifier.php - About 5 hrs to fix

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

                public function process(App\Request $request)
                {
                    $moduleName = $request->getModule();
                    $relatedModuleName = $request->getByType('relatedModule', 2);
                    $parentId = $request->getInteger('record');
            Severity: Major
            Found in modules/Vtiger/views/RelatedList.php - About 5 hrs to fix

              File ServiceContracts.php has 408 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Service contracts utils file.
               *
               * @package App
              Severity: Minor
              Found in app/Utils/ServiceContracts.php - About 5 hrs to fix

                File CardDAV.php has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 * Api CardDAV Model Class.
                 *
                Severity: Minor
                Found in modules/API/models/CardDAV.php - About 5 hrs to fix

                  Method getFieldItemByName has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getFieldItemByName($name)
                      {
                          if (isset($this->items[$name])) {
                              return $this->items[$name];
                          }
                  Severity: Major
                  Found in modules/Settings/LayoutEditor/models/Field.php - About 5 hrs to fix

                    Method operationsAfterPicklistRename has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function operationsAfterPicklistRename($entityData)
                        {
                            $dbCommand = App\Db::getInstance()->createCommand();
                            $pickListFieldName = $entityData['fieldname'];
                            $oldValue = $entityData['oldvalue'];
                    Severity: Major
                    Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 5 hrs to fix

                      Function recordSaveAttendee has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function recordSaveAttendee(\Vtiger_Record_Model $record)
                          {
                              if ('VEVENT' === (string) $this->vcomponent->name) {
                                  $invities = $this->getInvitations($record->getId());
                                  $time = VObject\DateTimeParser::parse($this->vcomponent->DTSTAMP);
                      Severity: Minor
                      Found in app/Integrations/Dav/Calendar.php - About 5 hrs 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 saveLocks has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function saveLocks($data)
                          {
                              $oldValues = $this->getLocks();
                              $map = $toSave = [];
                              if (!empty($data)) {
                      Severity: Minor
                      Found in modules/Settings/Users/models/Module.php - About 5 hrs 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 getRates has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getRates($otherCurrencyCode, $dateParam, $cron = false)
                          {
                              $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
                              $selectedBank = $moduleModel->getActiveBankId();
                              $yesterday = date('Y-m-d', strtotime('-1 day'));
                      Severity: Minor
                      Found in modules/Settings/CurrencyUpdate/bankmodels/CBR.php - About 5 hrs 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 getNextTriggerTimeForWeekly has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getNextTriggerTimeForWeekly($scheduledDaysOfWeek, $scheduledTime)
                          {
                              $weekDays = ['1' => 'Monday', '2' => 'Tuesday', '3' => 'Wednesday', '4' => 'Thursday', '5' => 'Friday', '6' => 'Saturday', '7' => 'Sunday'];
                              $currentTime = time();
                              $currentWeekDay = date('N', $currentTime);
                      Severity: Minor
                      Found in modules/com_vtiger_workflow/Workflow.php - About 5 hrs 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 getListViewHeaders has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getListViewHeaders()
                          {
                              $headerFieldModels = [];
                              if ($this->isEmpty('viewId')) {
                                  $queryGenerator = $this->getQueryGenerator();
                      Severity: Minor
                      Found in modules/Vtiger/models/ListView.php - About 5 hrs 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 ProgressIndicatorHelper has 142 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var ProgressIndicatorHelper = function () {
                              var thisInstance = this;
                      
                              this.defaults = {
                                  position: 'append',
                      Severity: Major
                      Found in public_html/layouts/resources/ProgressIndicator.js - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language