YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/resources/app.js

Summary

Maintainability
F
1 mo
Test Coverage

File app.js has 3102 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/resources/app.js - About 1 wk to fix

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

    const app = (window.app = {
        /**
         * variable stores client side language strings
         */
        languageString: [],
    Severity: Major
    Found in public_html/layouts/resources/app.js - About 2 days to fix

      Function reloadAfterSave has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          reloadAfterSave: function (responseData, params, form, element) {
              if (responseData.skipReload) {
                  return;
              }
              const moduleName = params['module'];
      Severity: Minor
      Found in public_html/layouts/resources/app.js - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          registerFormsEvents: function (container) {
              let forms = container.find('form.js-form-ajax-submit,form.js-form-single-save');
              forms.each((i, form) => {
                  form = $(form);
                  let validationForm = false;
      Severity: Major
      Found in public_html/layouts/resources/app.js - About 3 hrs to fix

        Function registerPostLoadEvents has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    registerPostLoadEvents(form, params, element) {
                        const submitSuccessCallback = params.callbackFunction || function () {};
                        const goToFullFormCallBack = params.goToFullFormcallback || function () {};
                        form.on('submit', (e) => {
                            if (form.hasClass('not_validation')) {
        Severity: Major
        Found in public_html/layouts/resources/app.js - About 2 hrs to fix

          Function showConfirmModal has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              showConfirmModal: function (params) {
                  let confirmButtonLabel = 'JS_OK';
                  let rejectedButtonLabel = 'JS_CANCEL';
                  if (typeof params.confirmButtonLabel !== 'undefined') {
                      confirmButtonLabel = params.confirmButtonLabel;
          Severity: Major
          Found in public_html/layouts/resources/app.js - About 2 hrs to fix

            Function showModalWindow has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                showModalWindow: function (data, url, cb, paramsObject = {}) {
                    if (!app.isCurrentWindowTarget('app.showModalWindow', arguments)) {
                        return false;
                    }
                    const thisInstance = this;
            Severity: Minor
            Found in public_html/layouts/resources/app.js - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function showModalWindow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                showModalWindow: function (data, url, cb, paramsObject = {}) {
                    if (!app.isCurrentWindowTarget('app.showModalWindow', arguments)) {
                        return false;
                    }
                    const thisInstance = this;
            Severity: Major
            Found in public_html/layouts/resources/app.js - About 2 hrs to fix

              Function init has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          init(params) {
                              let css = {
                                  border: this.container.css('border'),
                                  opacity: 'unset'
                              };
              Severity: Major
              Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                Function registerPostLoadEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            registerPostLoadEvents(form, params, element) {
                                const submitSuccessCallback = params.callbackFunction || function () {};
                                const goToFullFormCallBack = params.goToFullFormcallback || function () {};
                                form.on('submit', (e) => {
                                    if (form.hasClass('not_validation')) {
                Severity: Major
                Found in public_html/layouts/resources/app.js - About 2 hrs to fix

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

                      registerModal: function (container) {
                          if (typeof container === 'undefined') {
                              container = $('body');
                          }
                          container
                  Severity: Major
                  Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                    Function formatToHourText has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        formatToHourText: function (decTime, type = 'short', withSeconds = false, withMinutes = true) {
                            const short = type === 'short';
                            const hour = Math.floor(decTime);
                            const min = Math.floor((decTime - hour) * 60);
                            const sec = Math.round(((decTime - hour) * 60 - min) * 60);
                    Severity: Minor
                    Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function getPageController has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        getPageController: function () {
                            if (window.pageController) {
                                return window.pageController;
                            }
                            const moduleName = app.getModuleName();
                    Severity: Minor
                    Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                        showModalData(data, container, paramsObject, cb, url, sendByAjaxCb) {
                            const thisInstance = this;
                            let params = {
                                show: true
                            };
                    Severity: Major
                    Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                      Function registerPopoverRecord has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          registerPopoverRecord: function (
                              selectElement = $('.js-popover-tooltip--record'),
                              customParams = {},
                              container = $(document)
                          ) {
                      Severity: Minor
                      Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                            registerRecordActionsEvents: function (container) {
                                container.on('click', '.js-action-confirm', function (event) {
                                    event.stopPropagation();
                                    let target = $(this),
                                        sourceView = target.data('sourceView'),
                        Severity: Minor
                        Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                              registerModalEvents: function (container, sendByAjaxCb) {
                                  let form = container.find('form');
                                  let validationForm = false;
                                  if (form.hasClass('validateForm') || form.hasClass('js-validate-form')) {
                                      form.validationEngine(app.validationEngineOptions);
                          Severity: Minor
                          Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                registerPopoverRecord: function (
                                    selectElement = $('.js-popover-tooltip--record'),
                                    customParams = {},
                                    container = $(document)
                                ) {
                            Severity: Minor
                            Found in public_html/layouts/resources/app.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 registerIframeAndMoreContent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                registerIframeAndMoreContent(container = $(document)) {
                                    container.on('click', '.js-more', (e) => {
                                        e.preventDefault();
                                        e.stopPropagation();
                                        const btn = $(e.currentTarget);
                            Severity: Minor
                            Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                  reloadAfterSave: function (responseData, params, form, element) {
                                      if (responseData.skipReload) {
                                          return;
                                      }
                                      const moduleName = params['module'];
                              Severity: Minor
                              Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                    registerEventForClockPicker: function (timeInputs = $('.clockPicker')) {
                                        if (!timeInputs.hasClass('clockPicker')) {
                                            timeInputs = timeInputs.find('.clockPicker');
                                        }
                                        if (!timeInputs.length) {
                                Severity: Minor
                                Found in public_html/layouts/resources/app.js - About 1 hr to fix

                                  Function changeUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      changeUrl(params) {
                                          let fullUrl = '';
                                          if (params.data && typeof params.data.historyUrl !== 'undefined') {
                                              fullUrl = params.data.historyUrl;
                                          }
                                  Severity: Minor
                                  Found in public_html/layouts/resources/app.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 callbackShown has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              callbackShown: () => {
                                                  let href;
                                                  if (!selectElement.attr('href')) {
                                                      href = selectElement.find('a').attr('href');
                                                  }
                                  Severity: Minor
                                  Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                        getPageController: function () {
                                            if (window.pageController) {
                                                return window.pageController;
                                            }
                                            const moduleName = app.getModuleName();
                                    Severity: Minor
                                    Found in public_html/layouts/resources/app.js - About 1 hr to fix

                                      Function showPopoverElementView has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          showPopoverElementView: function (selectElement = $('.js-popover-tooltip'), params = {}) {
                                              let defaultParams = {
                                                  trigger: 'manual',
                                                  manualTriggerDelay: 500,
                                                  placement: 'auto',
                                      Severity: Minor
                                      Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                            registerModalController: function (modalId, modalContainer, cb) {
                                                let windowParent = this.childFrame ? window.parent : window;
                                                if (!modalId) {
                                                    modalId = Window.lastModalId;
                                                }
                                        Severity: Minor
                                        Found in public_html/layouts/resources/app.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 sidebarKeyboard has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            sidebarKeyboard: function (e) {
                                                let target = $(e.target);
                                                if (e.which == this.keyboard.LEFT) {
                                                    if (target.hasClass('js-submenu-toggler') && !target.hasClass('collapsed')) {
                                                        target.click();
                                        Severity: Minor
                                        Found in public_html/layouts/resources/app.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 registerAfterLoginEvents has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            registerAfterLoginEvents: function () {
                                                if (this.processEvents === false) {
                                                    let processEvents = $('#processEvents');
                                                    if (processEvents.length === 0) {
                                                        return;
                                        Severity: Minor
                                        Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                              registerPopoverManualTrigger(element, manualTriggerDelay) {
                                                  const hideDelay = 500;
                                                  element.on('mouseleave', (e) => {
                                                      setTimeout(() => {
                                                          let currentPopover = this.getBindedPopover(element);
                                          Severity: Minor
                                          Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                registerBlockAnimationEvent: function (container = false) {
                                                    let detailViewContentHolder = $('div.details div.contents');
                                                    let blockHeader = detailViewContentHolder.find('.blockHeader');
                                                    if (container !== false) {
                                                        blockHeader = container.find('.blockHeader');
                                            Severity: Minor
                                            Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                  registerDataTables: function (table, options = {}) {
                                                      if ($.fn.dataTable == undefined) {
                                                          return false;
                                                      }
                                                      if (table.length == 0) {
                                              Severity: Minor
                                              Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                        function () {
                                                                            let progressIndicatorElement = $.progressIndicator({
                                                                                blockInfo: { enabled: true }
                                                                            });
                                                                            let formData = new FormData();
                                                Severity: Minor
                                                Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                      registerPinEvent: function () {
                                                          const self = this;
                                                          let pinButton = self.sidebar.find('.js-menu--pin');
                                                          let baseContainer = self.sidebar.closest('.js-base-container');
                                                          pinButton.on('click', () => {
                                                  Severity: Minor
                                                  Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                        registerMenu: function () {
                                                            const self = this;
                                                            self.keyboard = { DOWN: 40, ESCAPE: 27, LEFT: 37, RIGHT: 39, SPACE: 32, UP: 38 };
                                                            self.sidebarBtn = $('.js-sidebar-btn').first();
                                                            self.sidebar = $('.js-sidebar').first();
                                                    Severity: Minor
                                                    Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                          sidebarKeyboard: function (e) {
                                                              let target = $(e.target);
                                                              if (e.which == this.keyboard.LEFT) {
                                                                  if (target.hasClass('js-submenu-toggler') && !target.hasClass('collapsed')) {
                                                                      target.click();
                                                      Severity: Minor
                                                      Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                        cb: (modal) => {
                                                                            if (btn.data('iframe')) {
                                                                                let iframe = btn.siblings('iframe');
                                                                                let message = iframe.clone();
                                                                                if (message[0].hasAttribute('srcdoctemp')) {
                                                        Severity: Minor
                                                        Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                              registerPopover(container = $(document)) {
                                                                  window.popoverCache = {};
                                                                  container.on('mousemove', (e) => {
                                                                      app.mousePosition = { x: e.pageX, y: e.pageY };
                                                                  });
                                                          Severity: Minor
                                                          Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                showAlert: function (text) {
                                                                    return this.showNotify({
                                                                        title: text,
                                                                        type: 'error',
                                                                        closer: false,
                                                            Severity: Minor
                                                            Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                              confirmedCallback: () => {
                                                                                  let progressIndicatorElement = $.progressIndicator({
                                                                                      position: 'html',
                                                                                      blockInfo: {
                                                                                          enabled: true
                                                              Severity: Minor
                                                              Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                                generateTree(container) {
                                                                                    const self = this;
                                                                                    if (self.treeInstance === false) {
                                                                                        self.treeInstance = container;
                                                                                        self.treeInstance
                                                                Severity: Minor
                                                                Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                      showConfirmModal: function (params) {
                                                                          let confirmButtonLabel = 'JS_OK';
                                                                          let rejectedButtonLabel = 'JS_CANCEL';
                                                                          if (typeof params.confirmButtonLabel !== 'undefined') {
                                                                              confirmButtonLabel = params.confirmButtonLabel;
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/resources/app.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 registerMiddleClickScroll has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                      registerMiddleClickScroll(container) {
                                                                          let middleScroll = false;
                                                                          container.on('mousedown', (e) => {
                                                                              let clickedMouseButton = e.which; // get clicked button id
                                                                              if (clickedMouseButton == 2 && middleScroll == false) {
                                                                  Severity: Minor
                                                                  Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                        showModalHtml: function (params) {
                                                                            let data = '',
                                                                                icon = '';
                                                                            let footer = params['footer'] ?? '';
                                                                            if (params['header']) {
                                                                    Severity: Minor
                                                                    Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                                  static modalView(params = {}) {
                                                                                      var aDeferred = $.Deferred();
                                                                                      let url = 'index.php?module=AppComponents&view=MediaModal';
                                                                                      if (params && Object.keys(params).length) {
                                                                                          url = app.convertObjectToUrl(params, url);
                                                                      Severity: Minor
                                                                      Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                            setPopoverPosition(popoverElement, container = $(window)) {
                                                                                let popover = this.getBindedPopover(popoverElement);
                                                                                if (!popover.length) {
                                                                                    return;
                                                                                }
                                                                        Severity: Minor
                                                                        Found in public_html/layouts/resources/app.js - About 1 hr to fix

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

                                                                              $.fn.serializeFormData = function () {
                                                                                  for (let instance in CKEDITOR.instances) {
                                                                                      CKEDITOR.instances[instance].updateElement();
                                                                                  }
                                                                                  const form = this,
                                                                          Severity: Minor
                                                                          Found in public_html/layouts/resources/app.js - About 1 hr to fix

                                                                            Function showModalData has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                showModalData(data, container, paramsObject, cb, url, sendByAjaxCb) {
                                                                            Severity: Minor
                                                                            Found in public_html/layouts/resources/app.js - About 45 mins to fix

                                                                              Function filterFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                      filterFiles(files) {
                                                                                          let valid = [],
                                                                                              error = [];
                                                                                          if (files.length + this.files.length > this.options.limit) {
                                                                                              error.push({ error: { text: `${app.vtranslate('JS_FILE_LIMIT')} [${this.options.limit}]` } });
                                                                              Severity: Minor
                                                                              Found in public_html/layouts/resources/app.js - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  registerKeyboardShortcutsEvent: function (container) {
                                                                                      if (app.getUrlVar('parent') !== 'Settings') {
                                                                                          document.addEventListener('keydown', (event) => {
                                                                                              if (CONFIG['isEntityModule'] && event.shiftKey && event.ctrlKey && event.code === 'KeyL') {
                                                                                                  window.location.href = 'index.php?module=' + app.getModuleName() + '&view=List';
                                                                              Severity: Minor
                                                                              Found in public_html/layouts/resources/app.js - About 45 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

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                              } else if (params && params.removeFromUrl) {
                                                                                                  let searchParams = new URLSearchParams(window.location.search);
                                                                                                  searchParams.delete('step');
                                                                                                  window.location.href = 'index.php?' + searchParams.toString();
                                                                                              } else {
                                                                              Severity: Major
                                                                              Found in public_html/layouts/resources/app.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    if (window !== window.parent) {
                                                                                                        window.parent.location.href = 'index.php?module=' + moduleName + '&view=ListPreview';
                                                                                                    } else {
                                                                                                        window.location.href = 'index.php?module=' + moduleName + '&view=List';
                                                                                                    }
                                                                                Severity: Major
                                                                                Found in public_html/layouts/resources/app.js - About 45 mins to fix

                                                                                  Function hideModalWindow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                  Open

                                                                                      hideModalWindow: function (callback, id) {
                                                                                          if (!app.isCurrentWindowTarget('app.hideModalWindow', arguments)) {
                                                                                              return false;
                                                                                          }
                                                                                          let container;
                                                                                  Severity: Minor
                                                                                  Found in public_html/layouts/resources/app.js - About 45 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

                                                                                  Consider simplifying this complex logical expression.
                                                                                  Open

                                                                                                  if (
                                                                                                      (app.getViewName() === 'Detail' || (app.getViewName() === 'Edit' && app.getRecordId() !== undefined)) &&
                                                                                                      app.getParentModuleName() != 'Settings' &&
                                                                                                      (!params['data'] || !('sourceModule' in params['data']))
                                                                                                  ) {
                                                                                  Severity: Major
                                                                                  Found in public_html/layouts/resources/app.js - About 40 mins to fix

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

                                                                                        registerRecordActionsEvents: function (container) {
                                                                                            container.on('click', '.js-action-confirm', function (event) {
                                                                                                event.stopPropagation();
                                                                                                let target = $(this),
                                                                                                    sourceView = target.data('sourceView'),
                                                                                    Severity: Minor
                                                                                    Found in public_html/layouts/resources/app.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

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                                return false;
                                                                                    Severity: Major
                                                                                    Found in public_html/layouts/resources/app.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                      return (window.pageController = window[moduleBaseClassName]);
                                                                                      Severity: Major
                                                                                      Found in public_html/layouts/resources/app.js - About 30 mins to fix

                                                                                        Function removeEmptyFilesInput has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                            removeEmptyFilesInput(form) {
                                                                                                for (let i = 0; i < form.elements.length; i++) {
                                                                                                    if (form.elements[i].type === 'file') {
                                                                                                        if (form.elements[i].value === '') {
                                                                                                            form.elements[i].parentNode.removeChild(form.elements[i]);
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.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 createRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                    createRecord(moduleName, params = {}) {
                                                                                                        if ('parentIframe' === CONFIG.modalTarget) {
                                                                                                            window.parent.App.Components.QuickCreate.createRecord(moduleName, params);
                                                                                                            return;
                                                                                                        }
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.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 showModalData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                            showModalData(data, container, paramsObject, cb, url, sendByAjaxCb) {
                                                                                                const thisInstance = this;
                                                                                                let params = {
                                                                                                    show: true
                                                                                                };
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.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 errorLog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                            errorLog: function (error, err, errorThrown) {
                                                                                                if (!CONFIG.debug) {
                                                                                                    return;
                                                                                                }
                                                                                                console.warn(
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.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 getMainParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                            getMainParams: function (param, json) {
                                                                                                if (param in CONFIG) {
                                                                                                    return CONFIG[param];
                                                                                                }
                                                                                                if (app.cacheParams[param] === undefined) {
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.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

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

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 280.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                $.extend($.fn.dataTable.defaults, {
                                                                                                    language: {
                                                                                                        sLengthMenu: app.vtranslate('JS_S_LENGTH_MENU'),
                                                                                                        sZeroRecords: app.vtranslate('JS_NO_RESULTS_FOUND'),
                                                                                                        sInfo: app.vtranslate('JS_S_INFO'),
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 2 other locations - About 1 day to fix
                                                                                        public_html/layouts/basic/modules/Settings/Logs/resources/Index.js on lines 85..107
                                                                                        public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 63..85

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

                                                                                        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

                                                                                                getTextFromUrl(url) {
                                                                                                    const aDeferred = $.Deferred();
                                                                                                    let progressIndicatorElement = $.progressIndicator({ blockInfo: { enabled: true } });
                                                                                                    AppConnector.request(url)
                                                                                                        .done((response) => {
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 day to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3282..3303

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

                                                                                        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

                                                                                                filterFiles(files) {
                                                                                                    let valid = [],
                                                                                                        error = [];
                                                                                                    if (files.length + this.files.length > this.options.limit) {
                                                                                                        error.push({ error: { text: `${app.vtranslate('JS_FILE_LIMIT')} [${this.options.limit}]` } });
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 7 hrs to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3500..3511

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

                                                                                        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

                                                                                                validateFileType(file) {
                                                                                                    let result =
                                                                                                        !this.options.formats.length ||
                                                                                                        this.options.formats.filter((format) => {
                                                                                                            return file.type === format || (format.slice(-2) === '/*' && file.type.indexOf(format.slice(0, -1)) === 0);
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 6 hrs to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3533..3543

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

                                                                                        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

                                                                                            showNewScrollbarTop: function (element, options = { wheelPropagation: true, suppressScrollY: true }) {
                                                                                                if (typeof element === 'undefined' || !element.length) return;
                                                                                                options = Object.assign(this.scrollOptions, options);
                                                                                                new PerfectScrollbar(element[0], options);
                                                                                                var scrollbarTopElement = element.find('.ps__rail-x').first();
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 4 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 2270..2283

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

                                                                                        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

                                                                                            showNewScrollbarLeft: function (element, options = { wheelPropagation: true }) {
                                                                                                if (typeof element === 'undefined' || !element.length) return;
                                                                                                options = Object.assign(this.scrollOptions, options);
                                                                                                new PerfectScrollbar(element[0], options);
                                                                                                var scrollbarLeftElement = element.children('.ps__rail-y').first();
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 4 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 2256..2269

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

                                                                                        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

                                                                                                validateFileSize(file) {
                                                                                                    let result = typeof file.size === 'number' && file.size < this.options.maxFileSize;
                                                                                                    if (!result) {
                                                                                                        file.error = {
                                                                                                            title: `${app.vtranslate('JS_UPLOADED_FILE_SIZE_EXCEEDS')} <br> [${this.options.maxFileSizeDisplay}]`,
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 4 hrs to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3517..3526

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

                                                                                        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 (form.data('jqv').InvalidFields.length > 0) {
                                                                                                                    //If validation fails, form should submit again
                                                                                                                    form.removeData('submit');
                                                                                                                    $.progressIndicator({ mode: 'hide' });
                                                                                                                    e.preventDefault();
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 3 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 420..430

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

                                                                                        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 (form.data('jqv').InvalidFields.length > 0) {
                                                                                                                    //If validation fails, form should submit again
                                                                                                                    form.removeData('submit');
                                                                                                                    $.progressIndicator({ mode: 'hide' });
                                                                                                                    e.preventDefault();
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 3 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 230..240

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

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                        form.find('.js-full-editlink').on('click', (e) => {
                                                                                                            const form = $(e.currentTarget).closest('form');
                                                                                                            const editViewUrl = $(e.currentTarget).data('url');
                                                                                                            goToFullFormCallBack(form);
                                                                                                            this.goToFullForm(form, editViewUrl);
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 2 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 472..477

                                                                                        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

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

                                                                                                        form.find('.js-full-editlink').on('click', (e) => {
                                                                                                            const form = $(e.currentTarget).closest('form');
                                                                                                            const editViewUrl = $(e.currentTarget).data('url');
                                                                                                            goToFullFormCallBack(form);
                                                                                                            this.goToFullForm(form, editViewUrl);
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 2 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 291..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 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

                                                                                                if (typeof window[moduleBaseClassName] !== 'undefined') {
                                                                                                    if (typeof window[moduleBaseClassName] === 'function') {
                                                                                                        return (window.pageController = new window[moduleBaseClassName]());
                                                                                                    }
                                                                                                    if (typeof window[moduleBaseClassName] === 'object') {
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 2 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 2460..2467

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

                                                                                        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 (typeof window[moduleClassName] !== 'undefined') {
                                                                                                    if (typeof window[moduleClassName] === 'function') {
                                                                                                        return (window.pageController = new window[moduleClassName]());
                                                                                                    }
                                                                                                    if (typeof window[moduleClassName] === 'object') {
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 2 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 2469..2476

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

                                                                                        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

                                                                                                        const quickCreateTabOnHide = function (target) {
                                                                                                            $(target)
                                                                                                                .find('[name]')
                                                                                                                .each(function (index, element) {
                                                                                                                    element = $(element);
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 2 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 334..341

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

                                                                                        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

                                                                                                        const quickCreateTabOnShow = function (target) {
                                                                                                            $(target)
                                                                                                                .find('[data-element-name]')
                                                                                                                .each(function (index, element) {
                                                                                                                    element = $(element);
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 2 hrs to fix
                                                                                        public_html/layouts/resources/app.js on lines 324..331

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

                                                                                        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

                                                                                                                self.treeInstance
                                                                                                                    .on('select_node.jstree', function (_e, data) {
                                                                                                                        if (data.event !== undefined && $(data.event.target).hasClass('jstree-checkbox')) {
                                                                                                                            return;
                                                                                                                        }
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 26..38

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 73.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                } else if (e.which == this.keyboard.UP) {
                                                                                                    this.sidebar
                                                                                                        .find('.js-menu__content :tabbable')
                                                                                                        .eq(parseInt(this.sidebar.find('.js-menu__content :tabbable').index(target)) - 1)
                                                                                                        .focus();
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 2870..2876

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

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                } else if (e.which == this.keyboard.DOWN) {
                                                                                                    this.sidebar
                                                                                                        .find('.js-menu__content :tabbable')
                                                                                                        .eq(parseInt(this.sidebar.find('.js-menu__content :tabbable').index(target)) + 1)
                                                                                                        .focus();
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 2864..2876

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

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                    } else {
                                                                                                        bodyContents.removeClass('d-none');
                                                                                                        app.cacheSet(module + '.' + blockId, 1);
                                                                                                        currentTarget.addClass('d-none');
                                                                                                        closestBlock.find('[data-mode="show"]').removeClass('d-none');
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 2081..2086

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

                                                                                        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 (data.mode === 'show') {
                                                                                                        bodyContents.addClass('d-none');
                                                                                                        app.cacheSet(module + '.' + blockId, 0);
                                                                                                        currentTarget.addClass('d-none');
                                                                                                        closestBlock.find('[data-mode="hide"]').removeClass('d-none');
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 2086..2091

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

                                                                                        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

                                                                                                AppConnector.request(params)
                                                                                                    .done(function (data) {
                                                                                                        aDeferred.resolve(data);
                                                                                                    })
                                                                                                    .fail(function (textStatus, errorThrown) {
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 6 other locations - About 1 hr to fix
                                                                                        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/basic/modules/Vtiger/resources/Detail.js on lines 927..934

                                                                                        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

                                                                                                showError(error) {
                                                                                                    if (typeof error.type === 'undefined') {
                                                                                                        error.type = 'error';
                                                                                                    }
                                                                                                    error.textTrusted = false;
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3555..3561

                                                                                        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

                                                                                                if ((hour || min) && withMinutes) {
                                                                                                    result += short ? ` ${min}` + app.vtranslate('JS_M') : ` ${min} ` + app.vtranslate('JS_M_LONG');
                                                                                                }
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 3012..3014

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

                                                                                        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 (withSeconds !== false) {
                                                                                                    result += short ? ` ${sec}` + app.vtranslate('JS_S') : ` ${sec} ` + app.vtranslate('JS_S_LONG');
                                                                                                }
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 3009..3011

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

                                                                                        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 (typeof jqXHR.responseJSON === 'undefined' || jqXHR.responseJSON === null) {
                                                                                                        return this.showError({
                                                                                                            title: app.vtranslate('JS_FILE_UPLOAD_ERROR'),
                                                                                                            type: 'error'
                                                                                                        });
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3588..3593

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

                                                                                        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

                                                                                                element.css('left', ($(window).width() - element.outerWidth()) / 2 + $(window).scrollLeft() + 'px');
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 2409..2409

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 57.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                element.css('top', ($(window).height() - element.outerHeight()) / 2 + $(window).scrollTop() + 'px');
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/app.js on lines 2410..2410

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 57.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                    files.forEach((file) => {
                                                                                                        this.showError({
                                                                                                            title: app.vtranslate('JS_FILE_UPLOAD_ERROR'),
                                                                                                            text: file.name,
                                                                                                            type: 'error'
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3594..3600

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

                                                                                        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 (data && data.success) {
                                                                                                                    if (data.result.notify) {
                                                                                                                        app.showNotify(data.result.notify);
                                                                                                                    }
                                                                                                                    if (sourceView === 'Href') {
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 1 hr to fix
                                                                                        public_html/layouts/basic/modules/Rss/resources/List.js on lines 307..320

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

                                                                                                var getVar = function () {
                                                                                                    var vars = {};
                                                                                                    window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                                                                                                        vars[key] = value;
                                                                                                    });
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 55 mins to fix
                                                                                        public_html/layouts/basic/modules/OSSMail/resources/checkmails.js on lines 151..157

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 54.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                                            if (data.success) {
                                                                                                                                progressIndicatorElement.progressIndicator({ mode: 'hide' });
                                                                                                                                app.showNotify({ text: app.vtranslate('JS_SAVE_NOTIFY_SUCCESS'), type: 'success' });
                                                                                                                                if (element.closest('.js-detail-widget').length) {
                                                                                                                                    Vtiger_Detail_Js.getInstance().getFiltersDataAndLoad(e);
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 50 mins to fix
                                                                                        public_html/layouts/basic/modules/Vtiger/resources/RecordUnlock.js on lines 21..35

                                                                                        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

                                                                                            $.fn.getNumberFromValue = function () {
                                                                                                return App.Fields.Double.formatToDb($(this).val());
                                                                                            };
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 45 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 3568..3570

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

                                                                                        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

                                                                                            $.fn.getNumberFromText = function () {
                                                                                                return App.Fields.Double.formatToDb($(this).text());
                                                                                            };
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 45 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 3565..3567

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

                                                                                        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 (validationForm && form.data('jqv').InvalidFields.length > 0) {
                                                                                                                app.formAlignmentAfterValidation(form);
                                                                                                                save = false;
                                                                                                            }
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 40 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 1862..1865

                                                                                        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

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

                                                                                                self.sidebar.on('mouseenter', self.openSidebar.bind(self)).on('mouseleave', self.closeSidebar.bind(self));
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 40 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 2826..2826

                                                                                        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

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

                                                                                                        if (validationForm && form.data('jqv').InvalidFields.length > 0) {
                                                                                                            app.formAlignmentAfterValidation(form);
                                                                                                            save = false;
                                                                                                        }
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 40 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 1943..1946

                                                                                        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

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

                                                                                                        self.sidebar.on('mouseenter', self.openSidebar.bind(self)).on('mouseleave', self.closeSidebar.bind(self));
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 40 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 2776..2776

                                                                                        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

                                                                                            htmlDecode: function (value) {
                                                                                                if (value) {
                                                                                                    return $('<div />').html(value).text();
                                                                                                } else {
                                                                                                    return '';
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 35 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 2389..2395

                                                                                        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

                                                                                            htmlEncode: function (value) {
                                                                                                if (value) {
                                                                                                    return $('<div />').text(value).html();
                                                                                                } else {
                                                                                                    return '';
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 35 mins to fix
                                                                                        public_html/layouts/resources/app.js on lines 2396..2402

                                                                                        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

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

                                                                                                showErrors(errors = []) {
                                                                                                    for (let info of errors) {
                                                                                                        this.showError(info.error);
                                                                                                    }
                                                                                                }
                                                                                        Severity: Minor
                                                                                        Found in public_html/layouts/resources/app.js and 1 other location - About 35 mins to fix
                                                                                        public_html/layouts/resources/Fields.js on lines 3547..3551

                                                                                        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 progress = $.progressIndicator({
                                                                                                                        message: app.vtranslate('JS_SAVE_LOADER_INFO'),
                                                                                                                        position: 'html',
                                                                                                                        blockInfo: {
                                                                                                                            enabled: true
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.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/Detail.js on lines 1881..1887
                                                                                        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 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 14 locations. Consider refactoring.
                                                                                        Open

                                                                                                                    let progress = $.progressIndicator({
                                                                                                                        message: app.vtranslate('JS_SAVE_LOADER_INFO'),
                                                                                                                        position: 'html',
                                                                                                                        blockInfo: {
                                                                                                                            enabled: true
                                                                                        Severity: Major
                                                                                        Found in public_html/layouts/resources/app.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/Detail.js on lines 1881..1887
                                                                                        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

                                                                                        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