YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

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

          public function getParent($id, &$parent, &$encountered, $depthBase = 0)
          {
              \App\Log::trace('Entering getParent(' . $id . ') method ...');
              if ($depthBase == App\Config::module('MultiCompany', 'MAX_HIERARCHY_DEPTH')) {
                  \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
      Severity: Major
      Found in modules/MultiCompany/MultiCompany.php and 1 other location - About 2 days to fix
      modules/Competition/Competition.php on lines 274..323

      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 448.

      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 getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0)
          {
              \App\Log::trace('Entering getParent(' . $id . ') method ...');
              if ($depthBase == App\Config::module('Competition', 'MAX_HIERARCHY_DEPTH')) {
                  \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
      Severity: Major
      Found in modules/Competition/Competition.php and 1 other location - About 2 days to fix
      modules/MultiCompany/MultiCompany.php on lines 169..218

      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 448.

      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 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

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

                    foreach (static::getDatashare('group2role', $modTabId, $currentUserRoles) as $row) {
                        $shareGrpId = (int) $row['share_groupid'];
                        $shareIdGrps = [];
                        $shareIdGrps[] = $shareGrpId;
                        if (1 === (int) $row['permission']) {
        Severity: Major
        Found in app/PrivilegeUtil.php and 3 other locations - About 2 days to fix
        app/PrivilegeUtil.php on lines 1027..1071
        app/PrivilegeUtil.php on lines 1073..1117
        app/PrivilegeUtil.php on lines 1119..1163

        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 445.

        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 4 locations. Consider refactoring.
        Open

                    foreach (static::getDatashare('group2group', $modTabId, $groupList) as $row) {
                        $shareGrpId = (int) $row['share_groupid'];
                        $shareIdGrps = [];
                        $shareIdGrps[] = $shareGrpId;
                        if (1 === (int) $row['permission']) {
        Severity: Major
        Found in app/PrivilegeUtil.php and 3 other locations - About 2 days to fix
        app/PrivilegeUtil.php on lines 981..1025
        app/PrivilegeUtil.php on lines 1027..1071
        app/PrivilegeUtil.php on lines 1073..1117

        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 445.

        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 4 locations. Consider refactoring.
        Open

                    foreach (static::getDatashare('group2rs', $modTabId, $parRoleList) as $row) {
                        $shareGrpId = (int) $row['share_groupid'];
                        $shareIdGrps = [];
                        $shareIdGrps[] = $shareGrpId;
                        if (1 === (int) $row['permission']) {
        Severity: Major
        Found in app/PrivilegeUtil.php and 3 other locations - About 2 days to fix
        app/PrivilegeUtil.php on lines 981..1025
        app/PrivilegeUtil.php on lines 1073..1117
        app/PrivilegeUtil.php on lines 1119..1163

        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 445.

        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 4 locations. Consider refactoring.
        Open

                    foreach (static::getDatashare('group2user', $modTabId, $userid) as $row) {
                        $shareGrpId = (int) $row['share_groupid'];
                        $shareIdGrps = [];
                        $shareIdGrps[] = $shareGrpId;
                        if (1 === (int) $row['permission']) {
        Severity: Major
        Found in app/PrivilegeUtil.php and 3 other locations - About 2 days to fix
        app/PrivilegeUtil.php on lines 981..1025
        app/PrivilegeUtil.php on lines 1027..1071
        app/PrivilegeUtil.php on lines 1119..1163

        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 445.

        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

        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

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

            <?php
            
            /**
             * Reservations QuickCreate view file.
             *
            Severity: Major
            Found in modules/Reservations/views/QuickCreateAjax.php and 1 other location - About 2 days to fix
            modules/Occurrences/views/QuickCreateAjax.php on lines 1..65

            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 434.

            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
            
            /**
             * QuickCreate view.
             *
            Severity: Major
            Found in modules/Occurrences/views/QuickCreateAjax.php and 1 other location - About 2 days to fix
            modules/Reservations/views/QuickCreateAjax.php on lines 1..65

            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 434.

            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 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

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

                      public function getChild(int $id, array &$childRow, int $depthBase)
                      {
                          \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
                          if (empty($id) || $depthBase == App\Config::module('Competition', 'MAX_HIERARCHY_DEPTH')) {
                              \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
                  Severity: Major
                  Found in modules/Competition/Competition.php and 1 other location - About 2 days to fix
                  modules/MultiCompany/MultiCompany.php on lines 229..274

                  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 412.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language