YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

Function get has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $pagingModel = new \Vtiger_Paging_Model();
        $limit = 100;
        $isMorePages = false;
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/RecordHistory.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

Method getTypeDetailsForAddField has 214 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTypeDetailsForAddField($fieldType, $params)
    {
        $displayType = 1;
        $importerType = new \App\Db\Importers\Base();
        switch ($fieldType) {
Severity: Major
Found in modules/Settings/LayoutEditor/models/Module.php - About 1 day to fix

    File Index.js has 519 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';
    
    Settings_Vtiger_Index_Js(
        'Settings_Colors_Index_Js',
    Severity: Major
    Found in public_html/layouts/basic/modules/Settings/Colors/resources/Index.js - About 1 day to fix

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

                          if (
                              container.find('[name="' + key + 'c"]').length != 0 &&
                              container.find('[name="' + key + 'c"]').val() == 0 &&
                              result['data'][key] != 0
                          ) {
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js and 2 other locations - About 1 day to fix
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 878..887
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 888..897

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

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

                          if (
                              container.find('[name="' + key + 'a"]').length != 0 &&
                              container.find('[name="' + key + 'a"]').val() == 0 &&
                              result['data'][key] != 0
                          ) {
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js and 2 other locations - About 1 day to fix
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 888..897
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 898..907

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

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

                          if (
                              container.find('[name="' + key + 'b"]').length != 0 &&
                              container.find('[name="' + key + 'b"]').val() == 0 &&
                              result['data'][key] != 0
                          ) {
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js and 2 other locations - About 1 day to fix
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 878..887
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 898..907

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

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

          protected function relatedRecord($params)
          {
              $params = explode('|', $params);
              $fieldName = array_shift($params);
              $relatedField = array_shift($params);
      Severity: Minor
      Found in app/TextParser.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 getRecordRelatedListViewLinksLeftSide has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getRecordRelatedListViewLinksLeftSide(Vtiger_RelationListView_Model $viewModel)
          {
              $links = [];
              if (!$this->isViewable()) {
                  return [];
      Severity: Minor
      Found in modules/Vtiger/models/Record.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 Item.php has 515 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Picklist value item.
       *
       * @package App
      Severity: Major
      Found in app/Fields/Picklist/Item.php - About 1 day to fix

        File logs.js has 513 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        (function ($) {
            var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
        
            /**
             * Replaces spaces with &nbsp; and line breaks with <br>
        Severity: Major
        Found in public_html/layouts/resources/debugbar/logs.js - About 1 day to fix

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

          Vtiger_Field_Js(
              'Vtiger_Recurrence_Field_Js',
              {},
              {
                  /**
          Severity: Major
          Found in public_html/layouts/resources/Field.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/Field.js on lines 168..200

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

          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

          Vtiger_Field_Js(
              'Vtiger_Picklist_Field_Js',
              {},
              {
                  /**
          Severity: Major
          Found in public_html/layouts/resources/Field.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/Field.js on lines 461..493

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

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

              public function save(App\Request $request): void
              {
                  $fieldId = $request->getInteger('fieldid');
                  if (empty($fieldId)) {
                      throw new \App\Exceptions\AppException('Empty field ID: ' . $fieldId);
          Severity: Minor
          Found in modules/Settings/LayoutEditor/actions/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

          Function getStructure has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getStructure()
              {
                  if (!empty($this->structuredValues)) {
                      return $this->structuredValues;
                  }
          Severity: Minor
          Found in modules/Settings/Workflows/models/FilterRecordStructure.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

                              let shortenXTicks = function shortenXTicks(data, options) {
                                  if (typeof options.scales === 'undefined') {
                                      options.scales = {};
                                  }
                                  if (typeof options.scales.xAxes === 'undefined') {
          public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 446..465

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

          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

                              let shortenYTicks = function shortenYTicks(data, options) {
                                  if (typeof options.scales === 'undefined') {
                                      options.scales = {};
                                  }
                                  if (typeof options.scales.yAxes === 'undefined') {
          public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 356..375

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

          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

                  deleteRecord: function (deleteRecordActionUrl) {
                      app.showConfirmModal({
                          title: app.vtranslate('JS_DELETE_USER_CONFIRMATION'),
                          confirmedCallback: () => {
                              AppConnector.request(deleteRecordActionUrl).done(function (data) {
          Severity: Major
          Found in public_html/layouts/basic/modules/Users/resources/List.js and 1 other location - About 1 day to fix
          public_html/layouts/basic/modules/Users/resources/Detail.js on lines 19..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 200.

          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

                  triggerDeleteUser: function (deleteUserUrl) {
                      app.showConfirmModal({
                          title: app.vtranslate('JS_DELETE_USER_CONFIRMATION'),
                          confirmedCallback: () => {
                              AppConnector.request(deleteUserUrl).done(function (data) {
          Severity: Major
          Found in public_html/layouts/basic/modules/Users/resources/Detail.js and 1 other location - About 1 day to fix
          public_html/layouts/basic/modules/Users/resources/List.js on lines 19..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 200.

          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 dialog.js has 510 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';
          
          CKEDITOR.dialog.add('base64image-dialog', function (editor) {
              let self = null,

            File Inventory.php has 510 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * Basic Inventory Model Class.
             *
            Severity: Major
            Found in modules/Vtiger/models/Inventory.php - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language