YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Notifications Dashboard Class.
                   *
                  Severity: Major
                  Found in modules/Notification/dashboards/NotificationsBySender.php and 1 other location - About 4 days to fix
                  modules/Notification/dashboards/NotificationsByRecipient.php on lines 1..107

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 786.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Notifications Dashboard Class.
                   *
                  Severity: Major
                  Found in modules/Notification/dashboards/NotificationsByRecipient.php and 1 other location - About 4 days to fix
                  modules/Notification/dashboards/NotificationsBySender.php on lines 1..107

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 786.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public function getQuery()
                          {
                              $queryGenerator = new App\QueryGenerator($this->getModuleName());
                              if ($this->has('customFilter')) {
                                  $queryGenerator->initForCustomViewById($this->get('customFilter'));
                      Severity: Major
                      Found in modules/Reservations/models/Calendar.php and 1 other location - About 3 days to fix
                      modules/OSSTimeControl/models/Calendar.php on lines 38..104

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 731.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public function getQuery()
                          {
                              $queryGenerator = new App\QueryGenerator($this->getModuleName());
                              if ($this->has('customFilter')) {
                                  $queryGenerator->initForCustomViewById($this->get('customFilter'));
                      Severity: Major
                      Found in modules/OSSTimeControl/models/Calendar.php and 1 other location - About 3 days to fix
                      modules/Reservations/models/Calendar.php on lines 37..103

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 731.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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
                              Severity
                              Category
                              Status
                              Source
                              Language