YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Vtiger/resources/Inventory.js

Summary

Maintainability
F
3 wks
Test Coverage

File Inventory.js has 1747 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';

$.Class(
    'Vtiger_Inventory_Js',
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 4 days to fix

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

        {
            form: false,
            discount: false,
            tax: false,
            inventoryContainer: false,
    Severity: Major
    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 days to fix

      Function mapResultsToFields has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

              mapResultsToFields: function (referenceModule, parentRow, responseData) {
                  let unit,
                      taxParam = [];
                  let thisInstance = this;
                  let isGroupTax = thisInstance.isGroupTaxMode();
      Severity: Minor
      Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 4 hrs 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 mapResultsToFields has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              mapResultsToFields: function (referenceModule, parentRow, responseData) {
                  let unit,
                      taxParam = [];
                  let thisInstance = this;
                  let isGroupTax = thisInstance.isGroupTaxMode();
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 hrs to fix

        Function loadInventoryData has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                loadInventoryData(recordId, sourceModule, success = false, fail = false) {
                    const progressLoader = $.progressIndicator({ blockInfo: { enabled: true } });
                    return new Promise((resolve, reject) => {
                        AppConnector.request({
                            module: app.getModuleName(),
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 hrs to fix

          Function calculateDiscount has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  calculateDiscount: function (_row, modal) {
                      const netPriceBeforeDiscount = App.Fields.Double.formatToDb(modal.find('.valueTotalPrice').text()),
                          discountsType = modal.find('.discountsType').val();
                      let valuePrices = netPriceBeforeDiscount,
                          globalDiscount = 0,
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 hrs to fix

            Function registerChangeTaxModal has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    registerChangeTaxModal: function (modal, parentRow, params) {
                        let thisInstance = this;
                        let form = modal.find('form');
                        form.validationEngine(app.validationEngineOptions);
                        modal.on('change', '.individualTaxType', function (e) {
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 hrs to fix

              Function registerChangeDiscountModal has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerChangeDiscountModal: function (modal, parentRow, params) {
                          let thisInstance = this;
                          let form = modal.find('form');
                          form.validationEngine(app.validationEngineOptions);
                          modal.on('change', '.individualDiscountType', function (e) {
              Severity: Minor
              Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                Function calculateTax has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        calculateTax: function (_row, modal) {
                            let netPriceWithoutTax = App.Fields.Double.formatToDb(modal.find('.valueNetPrice').text()),
                                valuePrices = netPriceWithoutTax,
                                globalTax = 0,
                                groupTax = 0,
                Severity: Minor
                Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                  Function calculateDiscount has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                          calculateDiscount: function (_row, modal) {
                              const netPriceBeforeDiscount = App.Fields.Double.formatToDb(modal.find('.valueTotalPrice').text()),
                                  discountsType = modal.find('.discountsType').val();
                              let valuePrices = netPriceBeforeDiscount,
                                  globalDiscount = 0,
                  Severity: Minor
                  Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr 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 showCurrencyChangeModal has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          showCurrencyChangeModal: function (select, option) {
                              let thisInstance = this;
                              if (thisInstance.lockCurrencyChange == true) {
                                  return;
                              }
                  Severity: Minor
                  Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                    Function registerChangeTax has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            registerChangeTax: function () {
                                const thisInstance = this;
                                thisInstance.form.on('click', '.changeTax', function (e) {
                                    let parentRow;
                                    let element = $(e.currentTarget);
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                      Function initTaxParameters has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              initTaxParameters: function (parentRow, modal) {
                                  let parameters;
                                  if (parentRow.data('taxParam')) {
                                      parameters = parentRow.data('taxParam');
                                  } else {
                      Severity: Minor
                      Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                        Function getDiscount has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                getDiscount: function (row) {
                                    let discountParams = row.find('.discountParam').val();
                                    if (discountParams == '' || discountParams == 'null' || discountParams == '[]' || discountParams == undefined) {
                                        return 0;
                                    }
                        Severity: Minor
                        Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                          Function registerChangeDiscount has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  registerChangeDiscount: function () {
                                      this.form.on('click', '.js-change-discount', (e) => {
                                          let parentRow;
                                          const element = $(e.currentTarget);
                                          let params = {
                          Severity: Minor
                          Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                            Function calculateTax has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    calculateTax: function (_row, modal) {
                                        let netPriceWithoutTax = App.Fields.Double.formatToDb(modal.find('.valueNetPrice').text()),
                                            valuePrices = netPriceWithoutTax,
                                            globalTax = 0,
                                            groupTax = 0,
                            Severity: Minor
                            Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr 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 saveDiscountsParameters has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    saveDiscountsParameters: function (parentRow, modal) {
                                        const typeName = 'aggregationType',
                                            panels = modal.find('[name="' + typeName + '"]:checked');
                                        let info = {};
                                        info[typeName] = [];
                            Severity: Minor
                            Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                              Function initDiscountsParameters has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      initDiscountsParameters: function (parentRow, modal) {
                                          let parameters = parentRow.find('.discountParam').val();
                                          if (parameters == '' || parameters == undefined) {
                                              return;
                                          }
                              Severity: Minor
                              Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                Function getTax has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        getTax: function (row) {
                                            const self = this;
                                            let taxParams = row.find('.taxParam').val();
                                            if (taxParams == '' || taxParams == '[]' || taxParams == undefined) return 0;
                                            taxParams = JSON.parse(taxParams);
                                Severity: Minor
                                Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                  Function loadSubProducts has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          loadSubProducts: function (parentRow, indicator) {
                                              let thisInstance = this;
                                              let progressInstace;
                                              let recordId = $('input.sourceField', parentRow).val();
                                              let recordModule = parentRow.find('.rowName input[name="popupReferenceModule"]').val();
                                  Severity: Minor
                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                    Function getAllTaxes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            getAllTaxes: function () {
                                                let thisInstance = this;
                                                let tax = [];
                                                let typeSummary = $('.aggregationTypeTax').val();
                                                this.getInventoryItemsContainer()
                                    Severity: Minor
                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                      Function registerSortableItems has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              registerSortableItems: function () {
                                                  let thisInstance = this;
                                                  let items = thisInstance.getInventoryItemsContainer();
                                                  items.sortable({
                                                      handle: '.dragHandle',
                                      Severity: Minor
                                      Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                        Function checkLimits has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                checkLimits: function () {
                                                    const account = this.getAccountId(),
                                                        limit = parseInt(app.getMainParams('inventoryLimit'));
                                                    let response = true;
                                                    if (account == '' || this.limitEnableSave || !limit) {
                                        Severity: Minor
                                        Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                          Function pricebooksModalHandler has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                  pricebooksModalHandler: function (element) {
                                                      const thisInstance = this;
                                                      let lineItemRow = element.closest(this.rowClass);
                                                      let rowName = lineItemRow.find('.rowName');
                                                      app.showRecordsList(
                                          Severity: Minor
                                          Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                            Function setDefaultGlobalTax has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    setDefaultGlobalTax: function () {
                                                        let thisInstance = this;
                                                        let parentRow = thisInstance.getInventoryItemsContainer();
                                                        let taxDefaultValue = thisInstance
                                                            .getInventorySummaryTaxesContainer()
                                            Severity: Minor
                                            Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                              Function registerRowChangeEvent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      registerRowChangeEvent: function (container) {
                                                          container.on('focusout', '.qty', (e) => {
                                                              let element = $(e.currentTarget);
                                                              element.formatNumber();
                                                              this.quantityChangeActions(this.getClosestRow(element));
                                              Severity: Minor
                                              Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                                Function addItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        addItem(module, baseTableId, rowData = false) {
                                                            const items = this.getInventoryItemsContainer();
                                                            let newRow = this.getBasicRow();
                                                            const sequenceNumber = this.getNextLineItemRowNumber();
                                                            const replaced = newRow.html().replace(/\_NUM_/g, sequenceNumber);
                                                Severity: Minor
                                                Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                                  Function registerRowAutoComplete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          registerRowAutoComplete: function (container) {
                                                              const thisInstance = this;
                                                              let sourceFieldElement = container.find('.sourceField.js-name');
                                                              sourceFieldElement.on(Vtiger_Edit_Js.referenceSelectionEvent, function (e, params) {
                                                                  let record = params.record;
                                                  Severity: Minor
                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 1 hr to fix

                                                    Function setDefaultGlobalTax has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                            setDefaultGlobalTax: function () {
                                                                let thisInstance = this;
                                                                let parentRow = thisInstance.getInventoryItemsContainer();
                                                                let taxDefaultValue = thisInstance
                                                                    .getInventorySummaryTaxesContainer()
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 35 mins 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 registerChangeDiscount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                            registerChangeDiscount: function () {
                                                                this.form.on('click', '.js-change-discount', (e) => {
                                                                    let parentRow;
                                                                    const element = $(e.currentTarget);
                                                                    let params = {
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 35 mins 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

                                                    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

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

                                                            hideExpandedRow: function (row) {
                                                                const inventoryRowExpanded = this.getInventoryItemsContainer().find('[numrowex="' + row.attr('numrow') + '"]');
                                                                const element = row.find('.toggleVisibility');
                                                                element.data('status', '0');
                                                                inventoryRowExpanded.addClass('d-none');
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1146..1151

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

                                                    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

                                                            showExpandedRow: function (row) {
                                                                const inventoryRowExpanded = this.getInventoryItemsContainer().find('[numrowex="' + row.attr('numrow') + '"]');
                                                                const element = row.find('.toggleVisibility');
                                                                element.data('status', '1');
                                                                inventoryRowExpanded.removeClass('d-none');
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1152..1157

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

                                                    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

                                                                    if (modal.find('.js-active .groupTax').length > 0) {
                                                                        groupTax = App.Fields.Double.formatToDb(modal.find('.groupTax').val());
                                                                        groupTax = netPriceWithoutTax * (groupTax / 100);
                                                                    }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 860..863

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

                                                    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

                                                                    if (modal.find('.js-active .regionalTax').length > 0) {
                                                                        regionalTax = App.Fields.Double.formatToDb(modal.find('.regionalTax').val());
                                                                        regionalTax = netPriceWithoutTax * (regionalTax / 100);
                                                                    }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 856..859

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

                                                    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 rate =
                                                                            App.Fields.Double.formatToDb(modal.find('.valueTax').text()) /
                                                                            App.Fields.Double.formatToDb(modal.find('.valueNetPrice').text());
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1636..1638

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

                                                    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 rate =
                                                                            App.Fields.Double.formatToDb(modal.find('.valueDiscount').text()) /
                                                                            App.Fields.Double.formatToDb(modal.find('.valueTotalPrice').text());
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1743..1745

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

                                                    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

                                                            setTotalPrice: function (row, val) {
                                                                val = App.Fields.Double.formatToDisplay(val);
                                                                $('.totalPriceText', row).text(val);
                                                                $('.totalPrice', row).val(val);
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 494..498
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 504..508

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

                                                    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

                                                                    helper: function (e, ui) {
                                                                        ui.children().each(function (_, element) {
                                                                            element = $(element);
                                                                            element.width(element.width());
                                                                        });
                                                    public_html/layouts/basic/modules/Settings/Picklist/resources/Index.js on lines 276..282
                                                    public_html/layouts/basic/modules/Settings/Workflows/resources/Edit3.js on lines 800..806

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

                                                    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

                                                            setNetPrice: function (row, val) {
                                                                val = App.Fields.Double.formatToDisplay(val);
                                                                $('.netPriceText', row).text(val);
                                                                $('.netPrice', row).val(val);
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 504..508
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 514..518

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

                                                    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

                                                            setGrossPrice: function (row, val) {
                                                                val = App.Fields.Double.formatToDisplay(val);
                                                                $('.grossPriceText', row).text(val);
                                                                $('.grossPrice', row).val(val);
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 494..498
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 514..518

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

                                                    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

                                                                container.on('focusout', '.purchase', (e) => {
                                                                    let element = $(e.currentTarget);
                                                                    element.formatNumber();
                                                                    this.quantityChangeActions(this.getClosestRow(element));
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1476..1480
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1481..1485

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

                                                    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

                                                                headContainer.on('change', '.js-taxmode', (e) => {
                                                                    let element = $(e.currentTarget);
                                                                    this.showIndividualTax(this.getClosestRow(element));
                                                                    this.rowsCalculations();
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1497..1501

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

                                                    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

                                                                container.on('focusout', '.unitPrice', (e) => {
                                                                    let element = $(e.currentTarget);
                                                                    element.formatNumber();
                                                                    this.quantityChangeActions(this.getClosestRow(element));
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1476..1480
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1486..1490

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

                                                    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

                                                                container.on('focusout', '.qty', (e) => {
                                                                    let element = $(e.currentTarget);
                                                                    element.formatNumber();
                                                                    this.quantityChangeActions(this.getClosestRow(element));
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1481..1485
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1486..1490

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

                                                    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

                                                                headContainer.on('change', '.js-discountmode', (e) => {
                                                                    let element = $(e.currentTarget);
                                                                    this.showIndividualDiscount(this.getClosestRow(element));
                                                                    this.rowsCalculations();
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1492..1496

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

                                                    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 (modal.find('.js-active .additionalDiscountValue').length > 0) {
                                                                        additionalDiscount = App.Fields.Double.formatToDb(modal.find('.js-active .additionalDiscountValue').val());
                                                                    }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 790..792
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 849..851

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

                                                    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 (modal.find('.js-active .globalTax').length > 0) {
                                                                        globalTax = App.Fields.Double.formatToDb(modal.find('.js-active .globalTax').val());
                                                                    }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 790..792
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 793..795

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

                                                    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

                                                                modal.on('change', '.individualDiscountType', function (e) {
                                                                    let element = $(e.currentTarget);
                                                                    modal.find('.individualDiscountContainer .input-group-text').text(element.data('symbol'));
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1711..1714

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

                                                    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 (modal.find('.js-active .globalDiscount').length > 0) {
                                                                        globalDiscount = App.Fields.Double.formatToDb(modal.find('.js-active .globalDiscount').val());
                                                                    }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 793..795
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 849..851

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

                                                    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

                                                                modal.on('change', '.individualTaxType', function (e) {
                                                                    let element = $(e.currentTarget);
                                                                    modal.find('.individualTaxContainer .input-group-text').text(element.data('symbol'));
                                                                });
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1600..1603

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

                                                    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

                                                                            if (param === 'aggregationType') {
                                                                                value.closest('.js-panel').find('.js-panel__body').removeClass('d-none');
                                                                                value.closest('.js-panel').addClass('js-active');
                                                                            }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1178..1181

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

                                                    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

                                                                            if (param == 'aggregationType') {
                                                                                value.closest('.js-panel').find('.js-panel__body').removeClass('d-none');
                                                                                value.closest('.js-panel').addClass('js-active');
                                                                            }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1217..1220

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

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

                                                                        if (panel.find('.globalTax').length > 0) {
                                                                            valuePrices = valuePrices * ((100 + App.Fields.Double.formatToDb(panel.find('.globalTax').val())) / 100);
                                                                        } else if (panel.find('.groupTax').length > 0) {
                                                                            valuePrices = valuePrices * ((100 + App.Fields.Double.formatToDb(panel.find('.groupTax').val())) / 100);
                                                                        } else if (panel.find('.regionalTax').length > 0) {
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 818..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 821..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 830..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 874..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 876..881

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

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

                                                                        } else if (panel.find('.additionalDiscountValue').length > 0) {
                                                                            valuePrices =
                                                                                valuePrices * ((100 - App.Fields.Double.formatToDb(panel.find('.additionalDiscountValue').val())) / 100);
                                                                        }
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 818..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 821..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 872..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 874..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 876..881

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

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

                                                                        } else if (panel.find('.groupTax').length > 0) {
                                                                            valuePrices = valuePrices * ((100 + App.Fields.Double.formatToDb(panel.find('.groupTax').val())) / 100);
                                                                        } else if (panel.find('.regionalTax').length > 0) {
                                                                            valuePrices = valuePrices * ((100 + App.Fields.Double.formatToDb(panel.find('.regionalTax').val())) / 100);
                                                                        } else if (panel.find('.individualTaxValue').length > 0) {
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 818..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 821..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 830..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 872..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 876..881

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

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

                                                                        } else if (panel.find('.groupCheckbox').length > 0 && panel.find('.groupCheckbox').prop('checked') == true) {
                                                                            valuePrices = valuePrices * ((100 - App.Fields.Double.formatToDb(panel.find('.groupValue').val())) / 100);
                                                                        } else if (panel.find('.individualDiscountType').length > 0) {
                                                                            let value = App.Fields.Double.formatToDb(panel.find('.individualDiscountValue').val());
                                                                            if (panel.find('.individualDiscountType[name="individualDiscountType"]:checked').val() === 'percentage') {
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 818..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 830..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 872..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 874..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 876..881

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

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

                                                                        } else if (panel.find('.regionalTax').length > 0) {
                                                                            valuePrices = valuePrices * ((100 + App.Fields.Double.formatToDb(panel.find('.regionalTax').val())) / 100);
                                                                        } else if (panel.find('.individualTaxValue').length > 0) {
                                                                            valuePrices =
                                                                                ((App.Fields.Double.formatToDb(panel.find('.individualTaxValue').val()) + 100) / 100) * valuePrices;
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 818..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 821..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 830..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 872..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 874..881

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

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

                                                                        if (panel.find('.globalDiscount').length > 0) {
                                                                            valuePrices =
                                                                                valuePrices * ((100 - App.Fields.Double.formatToDb(panel.find('.globalDiscount').val())) / 100);
                                                                        } else if (panel.find('.groupCheckbox').length > 0 && panel.find('.groupCheckbox').prop('checked') == true) {
                                                                            valuePrices = valuePrices * ((100 - App.Fields.Double.formatToDb(panel.find('.groupValue').val())) / 100);
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 821..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 830..833
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 872..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 874..881
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 876..881

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

                                                    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

                                                                if (thisInstance.isIndividualDiscountMode(row)) {
                                                                    groupDiscount.addClass('d-none');
                                                                    items.find('.js-change-discount').removeClass('d-none');
                                                                    newRow.find('.js-change-discount').removeClass('d-none');
                                                                } else {
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js and 1 other location - About 50 mins to fix
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 243..247

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

                                                    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

                                                                } else {
                                                                    groupDiscount.removeClass('d-none');
                                                                    items.find('.js-change-discount').addClass('d-none');
                                                                    newRow.find('.js-change-discount').addClass('d-none');
                                                                }
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js and 1 other location - About 50 mins to fix
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 239..243

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

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

                                                            getInventoryItemsContainer: function () {
                                                                if (this.inventoryContainer === false) {
                                                                    this.inventoryContainer = $('.inventoryItems');
                                                                }
                                                                return this.inventoryContainer;
                                                    public_html/layouts/basic/modules/Leads/resources/Detail.js on lines 277..282
                                                    public_html/layouts/basic/modules/Leads/resources/Detail.js on lines 286..291
                                                    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 15..20
                                                    public_html/layouts/basic/modules/Settings/Dav/resources/Dav.js on lines 13..18
                                                    public_html/layouts/basic/modules/Settings/RecordAllocation/resources/Index.js on lines 252..257
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 141..146
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 588..593
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 211..216

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

                                                    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 params = {
                                                                        module: app.getModuleName(),
                                                                        view: 'Inventory',
                                                                        mode: 'showTaxes',
                                                                        currency: thisInstance.getCurrency(),
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js and 1 other location - About 40 mins to fix
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2725..2731

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

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

                                                            getInventoryHeadContainer: function () {
                                                                if (this.inventoryHeadContainer === false) {
                                                                    this.inventoryHeadContainer = $('.inventoryHeader');
                                                                }
                                                                return this.inventoryHeadContainer;
                                                    public_html/layouts/basic/modules/Project/resources/GanttController.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 15..20
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/List.js on lines 30..35
                                                    public_html/layouts/basic/modules/Settings/BruteForce/resources/Index.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 170..175
                                                    public_html/layouts/basic/modules/Settings/Notifications/resources/Configuration.js on lines 98..103
                                                    public_html/layouts/basic/modules/Settings/PickListDependency/resources/List.js on lines 28..33
                                                    public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 10..15
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 578..583
                                                    public_html/layouts/basic/modules/Vtiger/resources/Export.js on lines 9..14
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 79..84
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 85..90
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 91..96
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 495..500
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 501..506
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 507..512
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 524..529
                                                    public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 266..271
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeCategoryModal.js on lines 12..17
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 11..16

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

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

                                                            getInventorySummaryCurrenciesContainer: function () {
                                                                if (this.summaryCurrenciesContainer === false) {
                                                                    this.summaryCurrenciesContainer = $('.inventorySummaryCurrencies');
                                                                }
                                                                return this.summaryCurrenciesContainer;
                                                    public_html/layouts/basic/modules/Project/resources/GanttController.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 15..20
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/List.js on lines 30..35
                                                    public_html/layouts/basic/modules/Settings/BruteForce/resources/Index.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 170..175
                                                    public_html/layouts/basic/modules/Settings/Notifications/resources/Configuration.js on lines 98..103
                                                    public_html/layouts/basic/modules/Settings/PickListDependency/resources/List.js on lines 28..33
                                                    public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 10..15
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 578..583
                                                    public_html/layouts/basic/modules/Vtiger/resources/Export.js on lines 9..14
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 73..78
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 79..84
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 85..90
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 495..500
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 501..506
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 507..512
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 524..529
                                                    public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 266..271
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeCategoryModal.js on lines 12..17
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 11..16

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

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

                                                            getInventorySummaryDiscountContainer: function () {
                                                                if (this.summaryDiscountContainer === false) {
                                                                    this.summaryDiscountContainer = $('.inventorySummaryDiscounts');
                                                                }
                                                                return this.summaryDiscountContainer;
                                                    public_html/layouts/basic/modules/Project/resources/GanttController.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 15..20
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/List.js on lines 30..35
                                                    public_html/layouts/basic/modules/Settings/BruteForce/resources/Index.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 170..175
                                                    public_html/layouts/basic/modules/Settings/Notifications/resources/Configuration.js on lines 98..103
                                                    public_html/layouts/basic/modules/Settings/PickListDependency/resources/List.js on lines 28..33
                                                    public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 10..15
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 578..583
                                                    public_html/layouts/basic/modules/Vtiger/resources/Export.js on lines 9..14
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 73..78
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 85..90
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 91..96
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 495..500
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 501..506
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 507..512
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 524..529
                                                    public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 266..271
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeCategoryModal.js on lines 12..17
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 11..16

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

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

                                                            getInventorySummaryTaxesContainer: function () {
                                                                if (this.summaryTaxesContainer === false) {
                                                                    this.summaryTaxesContainer = $('.inventorySummaryTaxes');
                                                                }
                                                                return this.summaryTaxesContainer;
                                                    public_html/layouts/basic/modules/Project/resources/GanttController.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 15..20
                                                    public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/List.js on lines 30..35
                                                    public_html/layouts/basic/modules/Settings/BruteForce/resources/Index.js on lines 9..14
                                                    public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 170..175
                                                    public_html/layouts/basic/modules/Settings/Notifications/resources/Configuration.js on lines 98..103
                                                    public_html/layouts/basic/modules/Settings/PickListDependency/resources/List.js on lines 28..33
                                                    public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 10..15
                                                    public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 578..583
                                                    public_html/layouts/basic/modules/Vtiger/resources/Export.js on lines 9..14
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 73..78
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 79..84
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 91..96
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 495..500
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 501..506
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 507..512
                                                    public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 524..529
                                                    public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 266..271
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeCategoryModal.js on lines 12..17
                                                    public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 11..16

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

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

                                                            setDiscount: function (row, val) {
                                                                $('.discount', row).val(App.Fields.Double.formatToDisplay(val));
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 524..526
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 532..534
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 556..558
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 564..566

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

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

                                                            setTaxPercent: function (row, val) {
                                                                $('.js-tax-percent', row).val(App.Fields.Double.formatToDisplay(val));
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 524..526
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 532..534
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 540..542
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 556..558

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

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

                                                            setMargin: function (row, val) {
                                                                $('.margin', row).val(App.Fields.Double.formatToDisplay(val));
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 532..534
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 540..542
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 556..558
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 564..566

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

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

                                                            setMarginP: function (row, val) {
                                                                $('.marginp', row).val(App.Fields.Double.formatToDisplay(val));
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 524..526
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 540..542
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 556..558
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 564..566

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

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

                                                            setTax: function (row, val) {
                                                                $('.tax', row).val(App.Fields.Double.formatToDisplay(val));
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 524..526
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 532..534
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 540..542
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 564..566

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

                                                    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

                                                            setTaxMode(val) {
                                                                this.getInventoryHeadContainer().find('.js-taxmode').val(val).trigger('change');
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 397..399
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 411..413

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

                                                    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

                                                            setCurrency(val) {
                                                                this.getInventoryHeadContainer().find('.js-currency').val(val).trigger('change');
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 411..413
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 418..420

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

                                                    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

                                                            setDiscountMode(val) {
                                                                this.getInventoryHeadContainer().find('.js-discountmode').val(val).trigger('change');
                                                            },
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 397..399
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 418..420

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

                                                    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

                                                                        if (e.length > 0) {
                                                                            sum += App.Fields.Double.formatToDb(e.val());
                                                                        }
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js and 1 other location - About 30 mins to fix
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 378..380

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

                                                    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

                                                                if (element.length > 0) {
                                                                    purchase = App.Fields.Double.formatToDb(element.val());
                                                                }
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js and 1 other location - About 30 mins to fix
                                                    public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 626..628

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

                                                    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

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status