YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method getModules has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getModules(): array
    {
        $cacheName = 'InterestsConflict::getModules';
        if (\App\Cache::has($cacheName, '')) {
            return \App\Cache::get($cacheName, '');
Severity: Major
Found in app/Components/InterestsConflict.php - About 3 hrs to fix

    Method vtwsConvertlead has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
        {
            \App\Log::trace('Start ' . __METHOD__);
            if (empty($entityvalues['assignedTo'])) {
                $entityvalues['assignedTo'] = $user->id;
    Severity: Major
    Found in include/Webservices/ConvertLead.php - About 3 hrs to fix

      Method getExternalUrlForWidget has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
          {
              if (\is_object($record)) {
                  $body = $record->get('content');
                  $subject = $record->get('subject');
      Severity: Major
      Found in modules/OSSMail/models/Module.php - About 3 hrs to fix

        Method getDetailViewRelatedLinks has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getDetailViewRelatedLinks()
            {
                $recordModel = $this->getRecord();
                $parentModuleModel = $this->getModule();
                $this->getWidgets();
        Severity: Major
        Found in modules/Vtiger/models/DetailView.php - About 3 hrs to fix

          File Edit.js has 296 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*+***********************************************************************************
           * The contents of this file are subject to the vtiger CRM Public License Version 1.0
           * ("License"); You may not use this file except in compliance with the License
           * The Original Code is:  vtiger CRM Open Source
           * The Initial Developer of the Original Code is vtiger.

            File Record.php has 296 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Record basic file.
             *
             * @package App
            Severity: Minor
            Found in app/Record.php - About 3 hrs to fix

              File Privileges.php has 296 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /* +***********************************************************************************
               * The contents of this file are subject to the vtiger CRM Public License Version 1.0
               * ("License"); You may not use this file except in compliance with the License
               * The Original Code is:  vtiger CRM Open Source
              Severity: Minor
              Found in modules/Users/models/Privileges.php - About 3 hrs to fix

                Function importInventory has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function importInventory()
                    {
                        if (1 !== $this->moduleInstance->type) {
                            return false;
                        }
                Severity: Minor
                Found in vtlib/Vtiger/PackageImport.php - About 3 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 vtwsPopulateConvertLeadEntities has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
                    {
                        $targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);
                        $entityName = $entityvalue['name'];
                        $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();
                Severity: Minor
                Found in include/Webservices/ConvertLead.php - About 3 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 getDisplayValueByType has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function getDisplayValueByType($value, \Vtiger_Record_Model $recordModel, \Vtiger_Field_Model $fieldModel, $params)
                    {
                        switch ($fieldModel->getFieldDataType()) {
                            case 'boolean':
                                $value = (1 === $value) ? 'LBL_YES' : 'LBL_NO';
                Severity: Minor
                Found in app/TextParser.php - About 3 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 getErrors has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getErrors(string $type, bool $returnMore = false): array
                    {
                        $result = [];
                        foreach (static::get($type, true) as $param => $data) {
                            if (!$data['status'] && (empty($data['mode']) || 'showErrors' === $data['mode']) && empty($data['noParameter'])) {
                Severity: Minor
                Found in app/Utils/ConfReport.php - About 3 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 getHistoryByType has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getHistoryByType(string $roomType = 'global', ?int $messageId = null)
                    {
                        $columnMessage = static::COLUMN_NAME['message'][$roomType];
                        $columnRoomName = static::COLUMN_NAME['room_name'][$roomType];
                        $roomNameId = 'global' === $roomType || 'private' === $roomType ? static::COLUMN_NAME['room'][$roomType] : $columnMessage;
                Severity: Minor
                Found in app/Chat.php - About 3 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 getRulesForServiceContracts has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getRulesForServiceContracts(int $serviceContractId, \Vtiger_Record_Model $recordModel): array
                    {
                        $times = $businessHours = [];
                        foreach (self::getSlaPolicyForServiceContracts($serviceContractId, $recordModel->getModule()->getId()) as $row) {
                            switch ($row['policy_type']) {
                Severity: Minor
                Found in app/Utils/ServiceContracts.php - About 3 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 loadInventory has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function loadInventory(): void
                    {
                        $inventory = $this->getInventory();
                        if (!$this->recordModel->isNew()) {
                            $oldInventory = $this->recordModel->getInventoryData();
                Severity: Minor
                Found in app/Integrations/Wapro/Synchronizer/Invoice.php - About 3 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 generatePicklists has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static function generatePicklists()
                    {
                        $css = '';
                        foreach (Fields\Picklist::getModules() as $module) {
                            $fields = static::getPicklistFieldsByModule($module['tabname']);
                Severity: Minor
                Found in app/Colors.php - About 3 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 afterLogin has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function afterLogin(App\Request $request): void
                    {
                        \App\Controller\Headers::generateCspToken();
                        if (\Config\Security::$loginSessionRegenerate) {
                            \App\Session::regenerateId(true); // to overcome session id reuse.
                Severity: Minor
                Found in modules/Users/actions/Login.php - About 3 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 getDisplayValue has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getDisplayValue($name)
                    {
                        $value = $this->get($name);
                        switch ($name) {
                            case 'server_id':
                Severity: Minor
                Found in modules/Settings/WebserviceUsers/services/WebserviceStandard.php - About 3 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 parseToDisplay has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function parseToDisplay(array $menus): array
                    {
                        $userPrivilegesModel = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                        $data = [];
                        foreach ($menus as $key => $item) {
                Severity: Minor
                Found in modules/Settings/Menu/models/Record.php - About 3 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 save has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function save()
                    {
                        $db = App\Db::getInstance();
                        $roleId = $this->getId();
                        $mode = 'edit';
                Severity: Minor
                Found in modules/Settings/Roles/models/Record.php - About 3 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 mailScan has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function mailScan($mbox, array $account, string $folder, int $scan_id, int $countEmails)
                    {
                        $break = false;
                        $lastScanUid = self::getUidFolder($account['user_id'], $folder);
                        \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                Severity: Minor
                Found in modules/OSSMailScanner/models/Record.php - About 3 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

                Severity
                Category
                Status
                Source
                Language