YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getUserModuleSharingObjects has a Cognitive Complexity of 540 (exceeds 5 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: Minor
Found in app/PrivilegeUtil.php - About 1 wk 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 Widget.js has 3214 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 Fields.js has 3161 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.App.Fields = {
        Date: {
    Severity: Major
    Found in public_html/layouts/resources/Fields.js - About 1 wk to fix

      File app.js has 3102 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/resources/app.js - About 1 wk to fix

        File Detail.js has 2678 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/Detail.js - About 1 wk to fix

          File LayoutEditor.js has 2106 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 List.js has 1941 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/List.js - About 5 days to fix

              File Inventory.js has 1747 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';
              
              $.Class(
                  'Vtiger_Inventory_Js',
              Severity: Major
              Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 4 days to fix

                File Edit.js has 1608 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/Edit.js - About 4 days to fix

                  File RelatedList.js has 1549 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/RelatedList.js - About 4 days to fix

                    Function checkbox has 823 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        $.jstree.plugins.checkbox = function (options, parent) {
                            this.bind = function () {
                                parent.bind.call(this);
                                this._data.checkbox.uto = false;
                                this._data.checkbox.selected = [];
                    Severity: Major
                    Found in public_html/layouts/resources/libraries/jstree.checkbox.js - About 4 days to fix

                      Function getRelatedModuleSharingArray has a Cognitive Complexity of 191 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                          {
                              $relatedModSharingPermission = [];
                              $modShareReadPermission = [];
                              $modShareWritePermission = [];
                      Severity: Minor
                      Found in app/UserPrivilegesFile.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 FieldValidator.js has 1369 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/resources/validator/FieldValidator.js - About 3 days to fix

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

                        <?php
                        /**
                         * Main config.
                         *
                         * @copyright YetiForce S.A.
                        Severity: Major
                        Found in config/ConfigTemplates.php - About 3 days to fix

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

                          <?php
                          /**
                           * Text parser file.
                           *
                           * @package App
                          Severity: Major
                          Found in app/TextParser.php - About 3 days to fix

                            File Record.php has 1283 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
                            Severity: Major
                            Found in modules/Vtiger/models/Record.php - About 3 days to fix

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

                              <?php
                              
                              /**
                               * Conf report class.
                               *
                              Severity: Major
                              Found in app/Utils/ConfReport.php - About 3 days to fix

                                File Field.php has 1260 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/Field.php - About 3 days to fix

                                  Function getGlobalDefaultChartsOptions has 649 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          getGlobalDefaultChartsOptions: function getGlobalDefaultChartsOptions(chartSubType, chartData) {
                                              const options = {
                                                  bar: {
                                                      basic: {
                                                          maintainAspectRatio: false,

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

                                    <?php
                                    /**
                                     * Privilege Util basic class.
                                     *
                                     * @package App
                                    Severity: Major
                                    Found in app/PrivilegeUtil.php - About 3 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language