YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
        $currentUser = Users_Privileges_Model::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
Severity: Minor
Found in modules/Project/Project.php - About 4 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 getListSearchParams has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getListSearchParams: function (urlSearchParams) {
            let listViewPageDiv = this.getContainer();
            let listViewTable = listViewPageDiv.find('.listViewEntriesTable');
            let searchParams = [];
            listViewTable.find('.listSearchContributor').each(function (index, domElement) {
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/ListSearch.js - About 4 hrs to fix

    Method getAllByType has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getAllByType($tabid, $type = false, $parameters = false)
        {
            if (\App\Cache::has('AllLinks', 'ByType')) {
                $rows = \App\Cache::get('AllLinks', 'ByType');
            } else {
    Severity: Major
    Found in vtlib/Vtiger/Link.php - About 4 hrs to fix

      Method initializeListViewContents has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
          {
              $moduleName = $request->getModule();
              $pageNumber = $request->getInteger('page');
              $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
      Severity: Major
      Found in modules/Vtiger/views/List.php - About 4 hrs to fix

        Settings_LayoutEditor_Module_Model has 33 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
        {
            /** {@inheritdoc} */
            public $name = 'LayoutEditor';
            /** @var string Parent name */
        Severity: Minor
        Found in modules/Settings/LayoutEditor/models/Module.php - About 4 hrs to fix

          Vtiger_RelationListView_Model has 33 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Vtiger_RelationListView_Model extends \App\Base
          {
              /**
               * Relation model instance.
               *
          Severity: Minor
          Found in modules/Vtiger/models/RelationListView.php - About 4 hrs to fix

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

                public function process()
                {
                    $html = '';
                    $relationModuleName = 'Products';
                    // Products from main storage
            Severity: Major
            Found in modules/IStorages/textparsers/ProductsTableHierarchy.php - About 4 hrs to fix

              Function _request has 103 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _request: function (params, pjaxMode, rawData) {
                      const aDeferred = jQuery.Deferred();
                      if (typeof rawData === 'undefined') {
                          rawData = false;
                      }
              Severity: Major
              Found in public_html/layouts/resources/Connector.js - About 4 hrs to fix

                Method checkZip has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function checkZip($zipfile)
                    {
                        $manifestFound = $languagefile_found = $layoutfile_found = $updatefile_found = $extensionfile_found = $moduleVersionFound = $fontfile_found = false;
                        $moduleName = null;
                        $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
                Severity: Major
                Found in vtlib/Vtiger/PackageImport.php - About 4 hrs to fix

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

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

                    Method getListViewMassActions has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getListViewMassActions($linkParams)
                        {
                            $currentUser = Users_Record_Model::getCurrentUserModel();
                            $moduleModel = $this->getModule();
                            $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
                    Severity: Major
                    Found in modules/Vtiger/models/ListView.php - About 4 hrs to fix

                      Method isPermitted has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function isPermitted(string $moduleName, $actionName = null, $record = false, $userId = false)
                          {
                              if (!$userId) {
                                  $user = \App\User::getCurrentUserModel();
                              } else {
                      Severity: Major
                      Found in api/webservice/WebservicePremium/Privilege.php - About 4 hrs to fix

                        File Workflow.php has 338 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/com_vtiger_workflow/Workflow.php - About 4 hrs to fix

                          File Iframe.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
                          'use strict';
                          
                          window.MailIntegration_Iframe = {
                              mailId: 0,
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/MailIntegration/resources/Iframe.js - About 4 hrs to fix

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

                            <?php
                            
                            /**
                             * OSSMailView record model class.
                             *
                            Severity: Minor
                            Found in modules/OSSMailView/models/Record.php - About 4 hrs to fix

                              Function mapResultsToFields has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      mapResultsToFields: function (referenceModule, parentRow, responseData) {
                                          let unit,
                                              taxParam = [];
                                          let thisInstance = this;
                                          let isGroupTax = thisInstance.isGroupTaxMode();
                              Severity: Minor
                              Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 4 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 sanitizeInventoryValues has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
                                  {
                                      $inventoryEntries = [];
                                      foreach ($inventoryFields as $columnName => $field) {
                                          $value = $inventoryRow[$columnName];
                              Severity: Minor
                              Found in app/Export/Records.php - About 4 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 parseAdvFilter has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function parseAdvFilter($advFilterList = false)
                                  {
                                      if (!$advFilterList) {
                                          $advFilterList = $this->advFilterList;
                                      }
                              Severity: Minor
                              Found in app/QueryGenerator.php - About 4 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 import has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function import(): bool
                                  {
                                      $allChecked = false;
                                      try {
                                          if ($orders = $this->getOrdersFromApi()) {
                              Severity: Minor
                              Found in app/Integrations/Magento/Synchronizer/Order.php - About 4 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 getDenormalizedData has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getDenormalizedData($calendarData)
                                  {
                                      $vObject = VObject\Reader::read($calendarData);
                                      $uid = $lastOccurence = $firstOccurence = $component = $componentType = null;
                                      foreach ($vObject->getComponents() as $component) {
                              Severity: Minor
                              Found in app/Integrations/Dav/Calendar.php - About 4 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