YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

        registerChangeFieldEvent: function (data) {
            jQuery('.textType', data).on('change', function (e) {
                var valueType = jQuery(e.currentTarget).val();
                var useFieldContainer = jQuery('.useFieldContainer', data);
                var useFunctionContainer = jQuery('.useFunctionContainer', data);
public_html/layouts/basic/modules/Settings/Workflows/resources/Edit.js on lines 292..314

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

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 (target.data('type') === 'modal') {
                        let params = self.getSelectedParams();
                        target.data('url').replace(/[?&]+([^=&]+)=([^&]*)/gi, function (_m, key, value) {
                            params[key] = value;
                        });
public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1578..1621

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

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 (target.data('type') === 'modal') {
                        let vars = {};
                        target.data('url').replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                            vars[key] = value;
                        });
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 1542..1585

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

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 Module.php has 720 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.1
 * ("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/LayoutEditor/models/Module.php - About 1 day to fix

    Function getValuesFromSource has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getValuesFromSource(App\Request $request, $moduleName = false)
        {
            $sourceModule = $request->getByType('sourceModule', 2);
            if (
                empty($sourceModule)
    Severity: Minor
    Found in modules/Vtiger/models/Module.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 82 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getStructure()
        {
            if (!empty($this->structuredValues)) {
                return $this->structuredValues;
            }
    Severity: Minor
    Found in modules/Users/models/EditRecordStructure.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 getRates has a Cognitive Complexity of 82 (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/NBR.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

    Vtiger_RelatedList_Js('IStorages_RelatedList_Js', {
        registerEditQty: function () {
            let thisInstance = this;
            let element = this.content.find('.js-edit-qtyproductinstock');
            element.validationEngine(app.validationEngineOptions);
    public_html/layouts/basic/modules/PriceBooks/resources/RelatedList.js on lines 48..81

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

    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

        {
            registerEditListPrice: function () {
                let thisInstance = this;
                let element = this.content.find('.js-edit-listprice');
                element.validationEngine(app.validationEngineOptions);
    public_html/layouts/basic/modules/IStorages/resources/RelatedList.js on lines 4..37

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

    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
    /**
     * @copyright YetiForce S.A.
     * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
     * @author    Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
    Severity: Major
    Found in modules/SQuotes/SQuotes.php and 1 other location - About 1 day to fix
    modules/SSingleOrders/SSingleOrders.php on lines 1..87

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

    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
    /**
     * @copyright YetiForce S.A.
     * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
     * @author    Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
    Severity: Major
    Found in modules/SSingleOrders/SSingleOrders.php and 1 other location - About 1 day to fix
    modules/SQuotes/SQuotes.php on lines 1..87

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

    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 Rbl.php has 693 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Mail RBL file.
     *
     * @package App
    Severity: Major
    Found in app/Mail/Rbl.php - About 1 day to fix

      Vtiger_Record_Model has 83 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Vtiger_Record_Model extends \App\Base
      {
          /**
           * @var string Record label
           */
      Severity: Major
      Found in modules/Vtiger/models/Record.php - About 1 day to fix

        Vtiger_Module_Model has 83 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Vtiger_Module_Model extends \vtlib\Module
        {
            /** Standard module type */
            const STANDARD_TYPE = 0;
            /** Advanced module type */
        Severity: Major
        Found in modules/Vtiger/models/Module.php - About 1 day to fix

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

                                          while (p && p.id !== $.jstree.root && !p.state[t ? 'selected' : 'checked']) {
                                              c = 0;
                                              for (i = 0, j = p.children.length; i < j; i++) {
                                                  c += m[p.children[i]].state[t ? 'selected' : 'checked'];
                                              }
          Severity: Major
          Found in public_html/layouts/resources/libraries/jstree.checkbox.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/libraries/jstree.checkbox.js on lines 320..339

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

          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

                                      while (p && p.id !== $.jstree.root && !p.state[t ? 'selected' : 'checked']) {
                                          c = 0;
                                          for (i = 0, j = p.children.length; i < j; i++) {
                                              c += m[p.children[i]].state[t ? 'selected' : 'checked'];
                                          }
          Severity: Major
          Found in public_html/layouts/resources/libraries/jstree.checkbox.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/libraries/jstree.checkbox.js on lines 358..377

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

          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 registerBasicEvents has 311 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerBasicEvents: function () {
                      let thisInstance = this;
                      let detailContentsHolder = thisInstance.getContentHolder();
                      let selectedTabElement = thisInstance.getSelectedTab();
                      //register all the events for summary view container
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 day to fix

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

                {
                    //contains the List View element.
                    listViewContainer: false,
                    //Contains list view top menu element
                    listViewTopMenuContainer: false,
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/List.js - About 1 day to fix

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

                  registerBlockToggleEvent(container) {
                      container.on('click', '.js-block-header', function (e) {
                          const target = $(e.target);
                          if (
                              target.is('input') ||
              Severity: Major
              Found in public_html/layouts/resources/app.js and 1 other location - About 1 day to fix
              public_html/layouts/resources/Tools.js on lines 32..55

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

              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

                      registerBlockToggle(container) {
                          container.on('click', '.js-toggle-block', function (e) {
                              const target = $(e.target);
                              if (
                                  target.is('input') ||
              Severity: Major
              Found in public_html/layouts/resources/Tools.js and 1 other location - About 1 day to fix
              public_html/layouts/resources/app.js on lines 2034..2057

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

              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