YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

Function registerBasicModal has 305 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerBasicModal: function () {
            var thisInstance = this;
            var container = this.container;
            var map = thisInstance.mapInstance;
            var layer, description;
Severity: Major
Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 1 day to fix

    File Record.php has 672 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/Settings/Profiles/models/Record.php - About 1 day to fix

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

              registerBlockToggleEvent() {
                  this.container.on('click', '.blockHeader', function (e) {
                      const target = $(e.target);
                      if (
                          target.is('input') ||
      public_html/layouts/basic/modules/Settings/PickListDependency/resources/Edit.js on lines 175..198

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

      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

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

          registerBlockToggleEvent() {
              this.container.on('click', '.blockHeader', function (e) {
                  const target = $(e.target);
                  if (
                      target.is('input') ||
      public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 21..44

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

      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 getRates has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getRates($otherCurrencyCode, $dateParam, $cron = false)
          {
              $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
              $selectedBank = $moduleModel->getActiveBankId();
              $yesterday = date('Y-m-d', strtotime('-1 day'));
      Severity: Minor
      Found in modules/Settings/CurrencyUpdate/bankmodels/ECB.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

      File AdvanceFilterEx.js has 667 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/AdvanceFilterEx.js - About 1 day to fix

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

        <?php
        /**
         * File that imports structure and data to database.
         *
         * @package App
        Severity: Major
        Found in app/Db/Importer.php - About 1 day to fix

          Function getParentRecord has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getParentRecord($record, $moduleName = false, $type = 1, $actionid = false)
              {
                  $cacheKey = "$record,$moduleName,$type,$actionid";
                  if (\App\Cache::staticHas('PrivilegesParentRecord', $cacheKey)) {
                      return \App\Cache::staticGet('PrivilegesParentRecord', $cacheKey);
          Severity: Minor
          Found in modules/Users/models/Privileges.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

          Function operationsAfterPicklistRename has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
          Open

              public function operationsAfterPicklistRename($entityData)
              {
                  $dbCommand = App\Db::getInstance()->createCommand();
                  $pickListFieldName = $entityData['fieldname'];
                  $oldValue = $entityData['oldvalue'];
          Severity: Minor
          Found in modules/Settings/Picklist/handlers/PickListHandler.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

          Function getDetailViewLinks has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getDetailViewLinks(array $linkParams): array
              {
                  if ($this->has('Links')) {
                      return $this->get('Links');
                  }
          Severity: Minor
          Found in modules/Vtiger/models/DetailView.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

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

                      blackList: {
                          columns: [
                              { data: 'ip' },
                              { data: 'status' },
                              {
          public_html/layouts/basic/modules/Settings/MailRbl/resources/Index.js on lines 194..239

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

          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

                      whiteList: {
                          columns: [
                              { data: 'ip' },
                              { data: 'status' },
                              {
          public_html/layouts/basic/modules/Settings/MailRbl/resources/Index.js on lines 148..193

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

          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 evaluate has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
          Open

              public function evaluate($condition, Vtiger_Record_Model $recordModel)
              {
                  $expr = \App\Json::decode($condition);
                  $finalResult = true;
                  if (\is_array($expr)) {
          Severity: Minor
          Found in modules/com_vtiger_workflow/VTJsonCondition.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

          Function getFieldDataType has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getFieldDataType()
              {
                  if (!isset($this->fieldDataType)) {
                      $uiType = $this->getUIType();
                      if (55 === $uiType) {
          Severity: Minor
          Found in modules/Vtiger/models/Field.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

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

                      this.bindAttr(['exclude', 'search'], function () {
                          var data = this.get('data'),
                              exclude = this.get('exclude'),
                              search = this.get('search'),
                              caseless = false,
          Severity: Major
          Found in public_html/layouts/resources/debugbar/logs.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/debugbar/logs.js on lines 370..393

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

          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

                      this.bindAttr(['exclude', 'search'], function () {
                          var data = this.get('data'),
                              exclude = this.get('exclude'),
                              search = this.get('search'),
                              caseless = false,
          Severity: Major
          Found in public_html/layouts/resources/debugbar/logs.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/debugbar/logs.js on lines 681..704

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

          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

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

              {
                  container: false,
                  updatedBlockSequence: {},
                  inActiveFieldsList: false,
                  updatedBlockFieldsList: [],

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

                        modal.on('change', '.activeCheckbox[name="aggregationType"]', function (e) {
                            let element = $(e.currentTarget);
                            if (element.attr('type') == 'checkbox' && this.checked) {
                                element.closest('.js-panel').find('.js-panel__body').removeClass('d-none');
                                element.closest('.js-panel').addClass('js-active');
            public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1604..1619

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

            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

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

                        modal.on('change', '.activeCheckbox[name="aggregationType"]', function (e) {
                            let element = $(e.currentTarget);
            
                            if (element.attr('type') == 'checkbox' && this.checked) {
                                element.closest('.js-panel').find('.js-panel__body').removeClass('d-none');
            public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1715..1729

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

            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 purifyByType has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function purifyByType($input, $type, $convert = false)
                {
                    if (\is_array($input)) {
                        $value = [];
                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.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

            Severity
            Category
            Status
            Source
            Language