YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

<?php
/**
 * TextParser test file.
 *
 * @package   Tests
Severity: Major
Found in tests/App/TextParser.php - About 1 day to fix

    File ListView.php has 536 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/ListView.php - About 1 day to fix

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

                      if (elem.is(':checked')) {
                          elem.closest('tr').addClass('highlightBackgroundColor');
                          if (selectedIds == 'all') {
                              excludedIds.splice($.inArray(elem.val(), excludedIds), 1);
                          } else if ($.inArray(elem.val(), selectedIds) == -1) {
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/List.js and 1 other location - About 1 day to fix
      public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 1436..1451

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

      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

                      if (elem.is(':checked')) {
                          elem.closest('tr').addClass('highlightBackgroundColor');
                          if (selectedIds == 'all') {
                              excludedIds.splice($.inArray(elem.val(), excludedIds), 1);
                          } else if ($.inArray(elem.val(), selectedIds) == -1) {
      public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1314..1329

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

      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 61 functions (exceeds 20 allowed). Consider refactoring.
      Open

          {
              selectedRelatedTabElement: false,
              parentRecordId: false,
              parentModuleName: false,
              moduleName: false,
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 1 day to fix

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

            {
                formElement: false,
                relationOperation: '',
                moduleName: app.getModuleName(),
                getForm: function () {
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 1 day to fix

          Function process has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
          Open

              public function process()
              {
                  $html = '';
                  if (!$this->textParser->recordModel->getModule()->isInventory()) {
                      return $html;
          Severity: Minor
          Found in app/TextParser/ProductsTableLongVTwoLang.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 process has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
          Open

              public function process()
              {
                  $html = '';
                  if (!$this->textParser->recordModel->getModule()->isInventory()) {
                      return $html;
          Severity: Minor
          Found in app/TextParser/ProductsTableNew.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 process has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
          Open

              public function process()
              {
                  $html = '';
                  if (!$this->textParser->recordModel->getModule()->isInventory()) {
                      return $html;
          Severity: Minor
          Found in app/TextParser/ProductsTableLongVersion.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 process has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
          Open

              public function process()
              {
                  $html = '';
                  if (!$this->textParser->recordModel->getModule()->isInventory()) {
                      return $html;
          Severity: Minor
          Found in app/TextParser/ProductsTableShortVersion.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

              registerSaveWorkingDays: function (content) {
                  content.find('.workignDaysField').on('change', function (e) {
                      var target = $(e.currentTarget);
                      var params = {};
                      params['type'] = target.data('type');
          public_html/layouts/basic/modules/Settings/Users/resources/Auth.js on lines 8..23

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

          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

                  registerChangeVal: function (content) {
                      content.find('.configField').on('change', function (e) {
                          var target = $(e.currentTarget);
                          var params = {};
                          params['type'] = target.data('type');
          public_html/layouts/basic/modules/Settings/Calendar/resources/UserColors.js on lines 50..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 210.

          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

                      form.find('.js-refresh-status').on('click', function () {
                          const progressIndicator = $.progressIndicator({
                              blockInfo: { enabled: true }
                          });
                          AppConnector.request({
          public_html/layouts/basic/modules/Settings/YetiForce/resources/Shop.js on lines 213..238

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

          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

                  this.container.find('.js-refresh-status').on('click', function () {
                      const progressIndicator = $.progressIndicator({
                          blockInfo: { enabled: true }
                      });
                      AppConnector.request({
          public_html/layouts/basic/modules/Settings/Companies/resources/Edit.js on lines 42..67

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

          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

          CustomView_Record_Model has 60 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class CustomView_Record_Model extends \App\Base
          {
              /** @var bool Is featured */
              protected $isFeatured;
              /** @var bool Is default */
          Severity: Major
          Found in modules/CustomView/models/Record.php - About 1 day to fix

            Vtiger_Relation_Model has 60 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Vtiger_Relation_Model extends \App\Base
            {
                /**
                 *  Cached instances.
                 *
            Severity: Major
            Found in modules/Vtiger/models/Relation.php - About 1 day to fix

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

              <?php
              
              namespace App;
              
              /**
              Severity: Major
              Found in app/Language.php - About 1 day to fix

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

                <?php
                /**
                 * IncidentRegister crmentity class.
                 *
                 * @copyright YetiForce S.A.
                Severity: Major
                Found in modules/IncidentRegister/IncidentRegister.php and 1 other location - About 1 day to fix
                modules/DataSetRegister/DataSetRegister.php on lines 1..123

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

                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
                /**
                 * DataSetRegister crmentity class.
                 *
                 * @copyright YetiForce S.A.
                Severity: Major
                Found in modules/DataSetRegister/DataSetRegister.php and 1 other location - About 1 day to fix
                modules/IncidentRegister/IncidentRegister.php on lines 1..123

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

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

                    public static function maximumFieldsLength(array $conditions = []): array
                    {
                        $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
                        $uiTypeNotSupported = [30];
                        $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
                Severity: Minor
                Found in app/Db/Fixer.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