YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
F
3 wks
Test Coverage

File Detail.js has 2678 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*+***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 wk to fix

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

        {
            targetPicklistChange: false,
            targetPicklist: false,
            detailViewContentHolder: false,
            detailViewForm: false,
    Severity: Major
    Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 day to fix

      Function registerBasicEvents has 311 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function ajaxEditHandling has 224 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                ajaxEditHandling: function (currentTdElement) {
                    const thisInstance = this;
                    let readRecord = $('.setReadRecord'),
                        detailViewValue = $('.value', currentTdElement),
                        editElement = $('.edit', currentTdElement),
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 day to fix

          Function saveHandler has 177 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          let saveHandler = function (e) {
                              thisInstance.registerNameAjaxEditEvent();
                              let element = $(e.target);
                              if ($(e.currentTarget).find('.dateTimePickerField').length) {
                                  if (element.closest('.drp-calendar').length || element.hasClass('drp-calendar')) {
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 7 hrs to fix

            Function registerSummaryViewContainerEvents has 134 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    registerSummaryViewContainerEvents: function (summaryViewContainer) {
                        let thisInstance = this;
                        this.registerEventForActivityWidget();
                        this.registerChangeFilterForWidget();
                        this.registerAddingInventoryRecords();
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 5 hrs to fix

              Function registerCommentEvents has 85 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerCommentEvents(detailContentsHolder) {
                          const self = this;
                          detailContentsHolder.on('click', '.js-close-comment-block', function (e) {
                              let commentInfoBlock = $(e.currentTarget.closest('.js-comment-single'));
                              commentInfoBlock.find('.js-comment-container').show();
              Severity: Major
              Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 3 hrs to fix

                Function showWorkflowTriggerView has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        showWorkflowTriggerView: function (instance) {
                            $(instance).popover('hide');
                            const detailInstance = Vtiger_Detail_Js.getInstance(),
                                callback = function (data) {
                                    let treeInstance = data.find('#treeWorkflowContents');
                Severity: Major
                Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 3 hrs to fix

                  Function registerFilterForAddingModuleRelatedRecordFromSummaryWidget has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          registerFilterForAddingModuleRelatedRecordFromSummaryWidget: function (container) {
                              let thisInstance = this;
                              container
                                  .find('.createRecordFromFilter')
                                  .off()
                  Severity: Major
                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 3 hrs to fix

                    Function callback has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    callback = function (data) {
                                        let treeInstance = data.find('#treeWorkflowContents');
                                        treeInstance.jstree({
                                            core: {
                                                data: JSON.parse(data.find('.js-tree-workflow-data').val()),
                    Severity: Major
                    Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

                      Function getFiltersData has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              getFiltersData: function (e, params) {
                                  let currentElement;
                                  if (e.currentTarget) {
                                      currentElement = jQuery(e.currentTarget);
                                  } else {
                      Severity: Major
                      Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

                        Function addComment has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                addComment: function (currentTarget, data) {
                                    const self = this;
                                    let mode = currentTarget.data('mode'),
                                        closestAddCommentBlock = currentTarget.closest('.js-add-comment-block'),
                                        commentTextAreaElement = closestAddCommentBlock.find('.js-comment-content'),
                        Severity: Major
                        Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

                          Function loadWidget has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  loadWidget: function (widgetContainer, params) {
                                      const thisInstance = this,
                                          contentContainer = $('.js-detail-widget-content', widgetContainer);
                                      let relatedModuleName;
                                      this.registerFilterForAddingModuleRelatedRecordFromSummaryWidget(widgetContainer);
                          Severity: Major
                          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

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

                                    widgetRelatedRecordView: function (container, load) {
                                        let cacheKey = this.getRecordId() + '_' + container.data('id');
                                        let relatedRecordCacheID = app.moduleCacheGet(cacheKey);
                                        if (relatedRecordCacheID !== null) {
                                            let newActive = container.find(".js-carousel-item[data-id = '" + relatedRecordCacheID + "']");
                            Severity: Major
                            Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

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

                                      registerMailPreviewWidget: function (container) {
                                          const self = this;
                                          container.on('click', '.showMailBody', (e) => {
                                              let row = $(e.currentTarget).closest('.js-mail-row'),
                                                  mailBody = row.find('.mailBody'),
                              Severity: Major
                              Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

                                Function registerEventForRelatedTabClick has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        registerEventForRelatedTabClick: function () {
                                            let thisInstance = this;
                                            let detailContentsHolder = thisInstance.getContentHolder();
                                            let detailContainer = detailContentsHolder.closest('div.detailViewInfo');
                                
                                
                                Severity: Minor
                                Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                  Function callbackFunction has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                      callbackFunction = () => {
                                                          let previousValue = fieldnameElement.data('prevValue'),
                                                              ajaxEditNewValue = fieldElement.val(),
                                                              ajaxEditNewLable = fieldElement.val(),
                                                              activityDiv = currentDiv.closest('.activityEntries'),
                                  Severity: Minor
                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                    Function submitSearchForm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            submitSearchForm(detailContentsHolder) {
                                                let searchTextDom = detailContentsHolder.find('.js-comment-search'),
                                                    widgetContainer = searchTextDom.closest('[data-name="ModComments"]'),
                                                    progressIndicatorElement = $.progressIndicator();
                                                if (searchTextDom.data('container') === 'widget' && !searchTextDom.val()) {
                                    Severity: Minor
                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

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

                                              saveCommentAjax: function (
                                                  element,
                                                  commentMode,
                                                  commentContentValue,
                                                  editCommentReason,
                                      Severity: Minor
                                      Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

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

                                                registerFastEditingFields: function () {
                                                    let thisInstance = this;
                                                    let fastEditingFiels = jQuery('.summaryWidgetFastEditing select');
                                                    fastEditingFiels.on('change', function (e) {
                                                        let fieldElement = jQuery(e.currentTarget);
                                        Severity: Minor
                                        Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

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

                                                  transferOwnershipSave: function (form) {
                                                      let transferOwner = jQuery('#transferOwnerId').val();
                                                      let relatedModules = jQuery('#related_modules').val();
                                                      let recordId = jQuery('#recordId').val();
                                                      let params = {
                                          Severity: Minor
                                          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                            Function registerRelatedModulesRecordCount has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    registerRelatedModulesRecordCount(tabContainer) {
                                                        const moreList = $('.related .nav .dropdown-menu');
                                                        let relationContainer = tabContainer;
                                                        if (!relationContainer || typeof relationContainer.length === 'undefined') {
                                                            relationContainer = $(
                                            Severity: Minor
                                            Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                              Function addRelationBetweenRecords has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      addRelationBetweenRecords: function (relatedModule, relatedModuleRecordId, selectedTabElement, params = {}, url) {
                                                          let aDeferred = jQuery.Deferred();
                                                          let thisInstance = this;
                                                          let relatedController;
                                                          if (selectedTabElement == undefined) {
                                              Severity: Minor
                                              Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                                Function triggerTransferOwnership has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        triggerTransferOwnership: function (massActionUrl) {
                                                            let thisInstance = this;
                                                            thisInstance.getRelatedModulesContainer = false;
                                                            let actionParams = {
                                                                type: 'POST',
                                                Severity: Minor
                                                Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                                  Function saveComment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          saveComment: function (e) {
                                                              let aDeferred = jQuery.Deferred(),
                                                                  currentTarget = jQuery(e.currentTarget),
                                                                  commentMode = currentTarget.data('mode'),
                                                                  closestCommentBlock = currentTarget.closest('.js-add-comment-block'),
                                                  Severity: Minor
                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

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

                                                            registerEventForActivityWidget: function () {
                                                                let thisInstance = this;
                                                    
                                                                /*
                                                                 * Register click event for add button in Related Activities widget
                                                    Severity: Minor
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

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

                                                              registerEventForRelatedList: function () {
                                                                  const self = this;
                                                                  let detailContentsHolder = this.getContentHolder();
                                                                  let relatedModuleName = self.getRelatedModuleName();
                                                                  if (relatedModuleName) {
                                                      Severity: Minor
                                                      Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                                        Function loadWidgetsEvents has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                loadWidgetsEvents: function () {
                                                                    const thisInstance = this;
                                                                    app.event.on('DetailView.Widget.AfterLoad', function (e, widgetContent, relatedModuleName, instance) {
                                                                        if (relatedModuleName === 'Calendar') {
                                                                            thisInstance.reloadWidgetActivitesStats(widgetContent.closest('.activityWidgetContainer'));
                                                        Severity: Minor
                                                        Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                                          Function registerSetReadRecord has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  registerSetReadRecord: function (detailContentsHolder) {
                                                                      let thisInstance = this;
                                                                      detailContentsHolder.on('click', '.setReadRecord', function (e) {
                                                                          let currentElement = jQuery(e.currentTarget);
                                                                          currentElement.closest('.btn-group').addClass('d-none');
                                                          Severity: Minor
                                                          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                                            Function widgetRelatedRecordView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                                    widgetRelatedRecordView: function (container, load) {
                                                                        let cacheKey = this.getRecordId() + '_' + container.data('id');
                                                                        let relatedRecordCacheID = app.moduleCacheGet(cacheKey);
                                                                        if (relatedRecordCacheID !== null) {
                                                                            let newActive = container.find(".js-carousel-item[data-id = '" + relatedRecordCacheID + "']");
                                                            Severity: Minor
                                                            Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.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 registerCommentEventsInDetail has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    registerCommentEventsInDetail(widgetContainer) {
                                                                        new App.Fields.Text.Completions($('.js-completions').eq(0));
                                                                        widgetContainer.on('change', '.js-hierarchy-comments', function (e) {
                                                                            let hierarchy = [];
                                                                            widgetContainer.find('.js-hierarchy-comments').each(function () {
                                                            Severity: Minor
                                                            Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 hr to fix

                                                              Function saveCommentAjax has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                          element,
                                                                          commentMode,
                                                                          commentContentValue,
                                                                          editCommentReason,
                                                                          commentId,
                                                              Severity: Major
                                                              Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 50 mins to fix

                                                                Function addRelationBetweenRecords has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                        addRelationBetweenRecords: function (relatedModule, relatedModuleRecordId, selectedTabElement, params = {}, url) {
                                                                Severity: Minor
                                                                Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 35 mins to fix

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

                                                                          loadWidget: function (widgetContainer, params) {
                                                                              const thisInstance = this,
                                                                                  contentContainer = $('.js-detail-widget-content', widgetContainer);
                                                                              let relatedModuleName;
                                                                              this.registerFilterForAddingModuleRelatedRecordFromSummaryWidget(widgetContainer);
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.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 addComment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                          addComment: function (currentTarget, data) {
                                                                              const self = this;
                                                                              let mode = currentTarget.data('mode'),
                                                                                  closestAddCommentBlock = currentTarget.closest('.js-add-comment-block'),
                                                                                  commentTextAreaElement = closestAddCommentBlock.find('.js-comment-content'),
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 25 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 submitSearchForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                          submitSearchForm(detailContentsHolder) {
                                                                              let searchTextDom = detailContentsHolder.find('.js-comment-search'),
                                                                                  widgetContainer = searchTextDom.closest('[data-name="ModComments"]'),
                                                                                  progressIndicatorElement = $.progressIndicator();
                                                                              if (searchTextDom.data('container') === 'widget' && !searchTextDom.val()) {
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 25 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 registerKeyboardShortcutsEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                          registerKeyboardShortcutsEvent: function (container) {
                                                                              document.addEventListener('keydown', (event) => {
                                                                                  if (event.shiftKey && event.ctrlKey && event.code === 'KeyD') {
                                                                                      container.find('.js-duplicate-btn').trigger('click');
                                                                                  }
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 25 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

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

                                                                                  next.on('click', function () {
                                                                                      if ($(this).hasClass('disabled')) {
                                                                                          return;
                                                                                      }
                                                                                      let active = container.find('.js-carousel-item.active');
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 6 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 454..469

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

                                                                  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

                                                                                  prev.on('click', function () {
                                                                                      if ($(this).hasClass('disabled')) {
                                                                                          return;
                                                                                      }
                                                                                      let active = container.find('.js-carousel-item.active');
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 6 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 438..453

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

                                                                  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

                                                                          showPagingInfo: function () {
                                                                              let totalNumberOfRecords = jQuery('#totalCount').val();
                                                                              let pageNumberElement = jQuery('.pageNumbersText');
                                                                              let pageRange = pageNumberElement.text();
                                                                              let newPagingInfo = pageRange + ' (' + totalNumberOfRecords + ')';
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 5 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1805..1816

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

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

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

                                                                                      if (value != null) {
                                                                                          if (value == 1) {
                                                                                              headerAnimationElement.addClass('d-none');
                                                                                              currentBlock.find("[data-mode='show']").removeClass('d-none');
                                                                                              bodyContents.removeClass('d-none');
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 3 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 1109..1119

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

                                                                  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

                                                                              container
                                                                                  .find('.showMailModal')
                                                                                  .off('click')
                                                                                  .on('click', function (e) {
                                                                                      e.preventDefault();
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 3 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 289..296

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

                                                                  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

                                                                                      widgetContent.find('.showMailModal').on('click', function (e) {
                                                                                          e.preventDefault();
                                                                                          let progressIndicatorElement = jQuery.progressIndicator();
                                                                                          app.showModalWindow('', $(e.currentTarget).data('url') + '&noloadlibs=1', function (data) {
                                                                                              Vtiger_Index_Js.registerMailButtons(data);
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 3 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2245..2255

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

                                                                  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

                                                                              container.find('.expandAllMails').on('click', function (e) {
                                                                                  container.find('.mailBody').removeClass('d-none');
                                                                                  container.find('.mailTeaser').addClass('d-none');
                                                                                  container.find('.showMailBody .js-toggle-icon').removeClass('fa-caret-down').addClass('fa-caret-up');
                                                                              });
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 2 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2240..2244

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

                                                                  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

                                                                              container.find('.collapseAllMails').on('click', function (e) {
                                                                                  container.find('.mailBody').addClass('d-none');
                                                                                  container.find('.mailTeaser').removeClass('d-none');
                                                                                  container.find('.showMailBody .js-toggle-icon').removeClass('fa-caret-up').addClass('fa-caret-down');
                                                                              });
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 2 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2235..2239

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

                                                                  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

                                                                              detailContentsHolder.on('click', '#detailViewNextRecordButton', function (e) {
                                                                                  let url = selectedTabElement.data('url');
                                                                                  let currentPageNum = thisInstance.getRelatedListCurrentPageNum();
                                                                                  let requestedPage = parseInt(currentPageNum) + 1;
                                                                                  let nextPageUrl = url + '&page=' + requestedPage;
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 2 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2395..2401

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

                                                                  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

                                                                              detailContentsHolder.on('click', '#detailViewPreviousRecordButton', function (e) {
                                                                                  let url = selectedTabElement.data('url');
                                                                                  let currentPageNum = thisInstance.getRelatedListCurrentPageNum();
                                                                                  let requestedPage = parseInt(currentPageNum) - 1;
                                                                                  let nextPageUrl = url + '&page=' + requestedPage;
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 2 hrs to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2388..2394

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

                                                                  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

                                                                                      app.showModalWindow(data, function (data) {
                                                                                          let selectElement = thisInstance.getRelatedModuleContainer();
                                                                                          App.Fields.Picklist.changeSelectElementView(selectElement, 'select2');
                                                                                          if (typeof callback == 'function') {
                                                                                              callback(data);
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 150..156

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

                                                                  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 (window.ChatRecordRoomVueComponent !== undefined) {
                                                                                  this.loadChat();
                                                                                  app.event.on('DetailView.Tab.AfterLoad', (e, data, instance) => {
                                                                                      instance.detailViewContentHolder.ready(() => {
                                                                                          this.loadChat();
                                                                  public_html/layouts/basic/modules/Project/resources/Detail.js on lines 48..55

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 67.

                                                                  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 (container.find('.js-carousel-item').length <= 1 || !active.next().length) {
                                                                                  next.addClass('disabled');
                                                                              } else {
                                                                                  next.removeClass('disabled');
                                                                              }
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 432..436

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

                                                                  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 (container.find('.js-carousel-item').length <= 1 || !active.prev().length) {
                                                                                  prev.addClass('disabled');
                                                                              } else {
                                                                                  prev.removeClass('disabled');
                                                                              }
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 427..431

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

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

                                                                              relatedListInstance
                                                                                  .loadRelatedList(params)
                                                                                  .done(function (data) {
                                                                                      aDeferred.resolve(data);
                                                                                  })
                                                                  public_html/layouts/basic/modules/Documents/resources/Edit.js on lines 131..137
                                                                  public_html/layouts/basic/modules/Documents/resources/List.js on lines 79..85
                                                                  public_html/layouts/basic/modules/Settings/Currency/resources/Currency.js on lines 271..277
                                                                  public_html/layouts/basic/modules/Settings/MappedFields/resources/List.js on lines 102..108
                                                                  public_html/layouts/basic/modules/Settings/Menu/resources/Menu.js on lines 243..249
                                                                  public_html/layouts/resources/app.js on lines 2534..2540

                                                                  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

                                                                                  ).always(() => {
                                                                                      progressIndicatorElement.progressIndicator({ mode: 'hide' });
                                                                                      app.showNotify({
                                                                                          title: app.vtranslate('JS_SAVE_NOTIFY_OK'),
                                                                                          type: 'success'
                                                                  public_html/layouts/resources/Calendar.js on lines 437..444

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

                                                                          registerEmailFieldClickEvent: function () {
                                                                              let detailContentsHolder = this.getContentHolder();
                                                                              detailContentsHolder.on('click', '.emailField', function (e) {
                                                                                  e.stopPropagation();
                                                                              });
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 885..890
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 894..899
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1663..1668
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1672..1677
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1681..1686

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

                                                                  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

                                                                          registerPhoneFieldClickEvent: function () {
                                                                              let detailContentsHolder = this.getContentHolder();
                                                                              detailContentsHolder.on('click', '.phoneField', function (e) {
                                                                                  e.stopPropagation();
                                                                              });
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 876..881
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 894..899
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1663..1668
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1672..1677
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1681..1686

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

                                                                  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

                                                                          registerUrlFieldClickEvent: function () {
                                                                              let detailContentsHolder = this.getContentHolder();
                                                                              detailContentsHolder.on('click', '.urlField', function (e) {
                                                                                  e.stopPropagation();
                                                                              });
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 876..881
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 885..890
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1663..1668
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1672..1677
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1681..1686

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

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

                                                                              AppConnector.request({
                                                                                  module: app.getModuleName(),
                                                                                  record: app.getRecordId(),
                                                                                  action: 'Save',
                                                                                  mode: 'recordChanger',
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 7 other locations - About 55 mins to fix
                                                                  public_html/layouts/basic/modules/CustomView/resources/CustomView.js on lines 334..347
                                                                  public_html/layouts/basic/modules/Settings/Countries/resources/Index.js on lines 109..134
                                                                  public_html/layouts/basic/modules/Settings/InterestsConflict/resources/Index.js on lines 51..63
                                                                  public_html/layouts/basic/modules/Settings/Mail/resources/List.js on lines 14..25
                                                                  public_html/layouts/basic/modules/Settings/ModuleManager/resources/ModuleManager.js on lines 59..76
                                                                  public_html/layouts/basic/modules/Settings/PublicHoliday/resources/PublicHoliday.js on lines 271..285
                                                                  public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 110..127

                                                                  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

                                                                              let mode = currentTarget.data('mode'),
                                                                                  closestAddCommentBlock = currentTarget.closest('.js-add-comment-block'),
                                                                                  commentTextAreaElement = closestAddCommentBlock.find('.js-comment-content'),
                                                                                  commentInfoBlock = currentTarget.closest('.js-comment-single');
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 55 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2008..2011

                                                                  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

                                                                                  let modifiedTime = commentInfoBlock.find('.js-comment-modified-time'),
                                                                                      commentInfoContent = commentInfoBlock.find('.js-comment-info'),
                                                                                      commentEditStatus = commentInfoBlock.find('.js-edited-status'),
                                                                                      commentReason = commentInfoBlock.find('.js-edit-reason-span');
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 55 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 1967..1970

                                                                  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

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

                                                                          registerHelpInfo: function (form) {
                                                                              if (!form) {
                                                                                  form = this.getForm();
                                                                              }
                                                                              app.showPopoverElementView(form.find('.js-help-info'));
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 55 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 1085..1090

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

                                                                  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

                                                                              AppConnector.request(url)
                                                                                  .done(function (data) {
                                                                                      aDeferred.resolve(data);
                                                                                  })
                                                                                  .fail(function (error, err) {});
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 50 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 723..727

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

                                                                  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

                                                                              AppConnector.request(postData)
                                                                                  .done(function (data) {
                                                                                      aDeferred.resolve(data);
                                                                                  })
                                                                                  .fail(function (error, err) {});
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 50 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 619..623

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

                                                                  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

                                                                          getRelatedModuleContainer: function () {
                                                                              if (this.getRelatedModulesContainer == false) {
                                                                                  this.getRelatedModulesContainer = jQuery('#related_modules');
                                                                              }
                                                                              return this.getRelatedModulesContainer;
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 8 other locations - About 40 mins to fix
                                                                  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 588..593
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 67..72
                                                                  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 9 locations. Consider refactoring.
                                                                  Open

                                                                          getForm: function () {
                                                                              if (this.detailViewForm == false) {
                                                                                  this.detailViewForm = jQuery('#detailView');
                                                                              }
                                                                              return this.detailViewForm;
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 8 other locations - About 40 mins to fix
                                                                  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/Inventory.js on lines 67..72
                                                                  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

                                                                                      data: {
                                                                                          module: app.getModuleName(),
                                                                                          action: 'PDF',
                                                                                          mode: 'hasValidTemplate',
                                                                                          record: app.getRecordId(),
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 40 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 1652..1658

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

                                                                              detailContentsHolder.on('click', '.moreRecentDocuments', function () {
                                                                                  let recentDocumentsTab = thisInstance.getTabByLabel(thisInstance.detailViewRecentDocumentsTabLabel);
                                                                                  recentDocumentsTab.trigger('click');
                                                                              });
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 40 mins to fix
                                                                  public_html/layouts/basic/modules/Project/resources/Detail.js on lines 143..146

                                                                  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

                                                                          getContentHolder: function () {
                                                                              if (this.detailViewContentHolder == false) {
                                                                                  this.detailViewContentHolder = jQuery('div.details div.contents');
                                                                              }
                                                                              return this.detailViewContentHolder;
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 20 other locations - About 35 mins to fix
                                                                  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/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/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 2 locations. Consider refactoring.
                                                                  Open

                                                                                          if (Object.keys(tasks).length === 0) {
                                                                                              app.showNotify({
                                                                                                  title: app.vtranslate('JS_INFORMATION'),
                                                                                                  text: app.vtranslate('JS_NOT_SELECTED_WORKFLOW_TRIGGER'),
                                                                                                  type: 'error'
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 35 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 197..205

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

                                                                                      widgetContainer.find('.js-hierarchy-comments:checked').each(function () {
                                                                                          hierarchy.push($(this).val());
                                                                                      });
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 7 other locations - About 35 mins to fix
                                                                  public_html/layouts/basic/modules/Settings/TwoFactorAuthentication/resources/Index.js on lines 57..59
                                                                  public_html/layouts/basic/modules/Settings/Wapro/resources/List.js on lines 51..53
                                                                  public_html/layouts/basic/modules/Settings/WidgetsManagement/resources/WidgetsManagement.js on lines 206..208
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2101..2103
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2143..2145
                                                                  public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 64..66
                                                                  public_html/layouts/resources/Calendar.js on lines 351..353

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

                                                                                      detailContentsHolder.find('.js-detail-hierarchy-comments:checked').each(function () {
                                                                                          hierarchy.push($(this).val());
                                                                                      });
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 7 other locations - About 35 mins to fix
                                                                  public_html/layouts/basic/modules/Settings/TwoFactorAuthentication/resources/Index.js on lines 57..59
                                                                  public_html/layouts/basic/modules/Settings/Wapro/resources/List.js on lines 51..53
                                                                  public_html/layouts/basic/modules/Settings/WidgetsManagement/resources/WidgetsManagement.js on lines 206..208
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2101..2103
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2139..2141
                                                                  public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 64..66
                                                                  public_html/layouts/resources/Calendar.js on lines 351..353

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

                                                                                  detailContentsHolder.find('.js-detail-hierarchy-comments:checked').each(function () {
                                                                                      hierarchy.push($(this).val());
                                                                                  });
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 7 other locations - About 35 mins to fix
                                                                  public_html/layouts/basic/modules/Settings/TwoFactorAuthentication/resources/Index.js on lines 57..59
                                                                  public_html/layouts/basic/modules/Settings/Wapro/resources/List.js on lines 51..53
                                                                  public_html/layouts/basic/modules/Settings/WidgetsManagement/resources/WidgetsManagement.js on lines 206..208
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2139..2141
                                                                  public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2143..2145
                                                                  public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 64..66
                                                                  public_html/layouts/resources/Calendar.js on lines 351..353

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

                                                                                  let progressIndicatorElement = jQuery.progressIndicator({
                                                                                      message: app.vtranslate('JS_SAVE_LOADER_INFO'),
                                                                                      position: 'summaryWidgetFastEditing',
                                                                                      blockInfo: {
                                                                                          enabled: true
                                                                  Severity: Major
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 13 other locations - About 30 mins to fix
                                                                  public_html/layouts/basic/modules/Settings/ConfReport/resources/Index.js on lines 13..19
                                                                  public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1729..1735
                                                                  public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1947..1953
                                                                  public_html/layouts/basic/modules/Settings/Search/resources/Search.js on lines 81..87
                                                                  public_html/layouts/basic/modules/Settings/Widgets/resources/Widgets.js on lines 98..104
                                                                  public_html/layouts/basic/modules/Settings/WidgetsManagement/resources/WidgetsManagement.js on lines 526..532
                                                                  public_html/layouts/basic/modules/Users/resources/Edit.js on lines 110..116
                                                                  public_html/layouts/basic/modules/Users/resources/List.js on lines 200..206
                                                                  public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1922..1928
                                                                  public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 9..15
                                                                  public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 888..894
                                                                  public_html/layouts/resources/app.js on lines 250..256
                                                                  public_html/layouts/resources/app.js on lines 440..446

                                                                  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

                                                                                  if (typeof window[moduleClassName] !== 'undefined') {
                                                                                      instance = new window[moduleClassName]();
                                                                                  } else {
                                                                                      instance = new Vtiger_Detail_Js();
                                                                                  }
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 2 other locations - About 30 mins to fix
                                                                  public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 24..28
                                                                  public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 51..55

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 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