YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function updateTables has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateTables(Base $importer)
    {
        $this->logs .= "> start update tables ({$importer->dbType})\n";
        $startMain = microtime(true);
        $schema = $importer->db->getSchema();
Severity: Minor
Found in app/Db/Importer.php - About 3 days 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 Chat.php has 1168 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Chat file.
 *
Severity: Major
Found in app/Chat.php - About 3 days to fix

    Function checkPermission has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
        {
            \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
            if (!$userId) {
                $userId = \App\User::getCurrentUserId();
    Severity: Minor
    Found in app/Privilege.php - About 2 days 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 getAllByType has a Cognitive Complexity of 122 (exceeds 5 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: Minor
    Found in vtlib/Vtiger/Link.php - About 2 days 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 Detail.php has 984 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: Major
    Found in modules/Vtiger/views/Detail.php - About 2 days to fix

      File PackageImport.php has 980 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: Major
      Found in vtlib/Vtiger/PackageImport.php - About 2 days to fix

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

            {
                form: false,
                discount: false,
                tax: false,
                inventoryContainer: false,
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 days to fix

          app has 119 functions (exceeds 20 allowed). Consider refactoring.
          Open

          const app = (window.app = {
              /**
               * variable stores client side language strings
               */
              languageString: [],
          Severity: Major
          Found in public_html/layouts/resources/app.js - About 2 days to fix

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

            <?php
            /**
             * Tool file for the field type `File`.
             *
             * @package App
            Severity: Major
            Found in app/Fields/File.php - About 2 days to fix

              Function importRecords has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function importRecords()
                  {
                      $moduleName = $this->module;
                      $tableName = Import_Module_Model::getDbTableName($this->user);
              
              
              Severity: Minor
              Found in modules/Import/actions/Data.php - About 2 days 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 checkCondition has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function checkCondition(Vtiger_Record_Model $recordModel, $cond, Vtiger_Record_Model $referredRecordModel = null)
                  {
                      $condition = $cond['operation'];
                      $fieldInstance = $recordModel->getModule()->getFieldByName($cond['fieldname']);
                      if (empty($condition) || false === $fieldInstance) {
              Severity: Minor
              Found in modules/com_vtiger_workflow/VTJsonCondition.php - About 2 days 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 QueryGenerator.php has 903 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Query generator file.
               *
               * @package App
              Severity: Major
              Found in app/QueryGenerator.php - About 2 days to fix

                Method getUserModuleSharingObjects has 432 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getUserModuleSharingObjects($module, $userid, $defOrgShare, $currentUserRoles, $parentRoles, $currentUserGroups)
                    {
                        $modTabId = Module::getModuleId($module);
                        $modShareWritePermission = $modShareReadPermission = ['ROLE' => [], 'GROUP' => []];
                        $modDefOrgShare = null;
                Severity: Major
                Found in app/PrivilegeUtil.php - About 2 days to fix

                  File Module.php has 881 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: Major
                  Found in modules/Vtiger/models/Module.php - About 2 days to fix

                    Function operationsAfterPicklistDelete has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function operationsAfterPicklistDelete($entityData)
                        {
                            $dbCommand = App\Db::getInstance()->createCommand();
                            $pickListFieldName = $entityData['fieldname'];
                            $valueToDelete = $entityData['valuetodelete'];
                    Severity: Minor
                    Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 2 days 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 jstree.checkbox.js has 848 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]} */
                    /*globals jQuery, define, exports, require, document */
                    (function (factory) {
                        'use strict';
                        if (typeof define === 'function' && define.amd) {
                    Severity: Major
                    Found in public_html/layouts/resources/libraries/jstree.checkbox.js - About 2 days to fix

                      File AdvanceFilter.js has 845 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.
                      Severity: Major
                      Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilter.js - About 2 days to fix

                        File Map.js has 839 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';
                        
                        jQuery.Class(
                            'OpenStreetMap_Map_Js',
                        Severity: Major
                        Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 2 days to fix

                          Function saveModulePermissions has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function saveModulePermissions($moduleModel, $permissions)
                              {
                                  $db = \App\Db::getInstance();
                                  $dbCommand = $db->createCommand();
                                  $profileId = $this->getId();
                          Severity: Minor
                          Found in modules/Settings/Profiles/models/Record.php - About 1 day 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

                          Method checkCondition has 377 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function checkCondition(Vtiger_Record_Model $recordModel, $cond, Vtiger_Record_Model $referredRecordModel = null)
                              {
                                  $condition = $cond['operation'];
                                  $fieldInstance = $recordModel->getModule()->getFieldByName($cond['fieldname']);
                                  if (empty($condition) || false === $fieldInstance) {
                          Severity: Major
                          Found in modules/com_vtiger_workflow/VTJsonCondition.php - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language