YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
F
1 mo
Test Coverage

File Widget.js has 3214 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.

    Function getGlobalDefaultChartsOptions has 649 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            getGlobalDefaultChartsOptions: function getGlobalDefaultChartsOptions(chartSubType, chartData) {
                const options = {
                    bar: {
                        basic: {
                            maintainAspectRatio: false,

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

          {
              container: false,
              plotContainer: false,
              chartInstance: false,
              chartData: [],

        Function hideHorizontalBarDatalabelsIfNeeded has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

                        hideHorizontalBarDatalabelsIfNeeded: function hideHorizontalBarDatalabelsIfNeeded(chart) {
                            let getDatasetsMeta = function (chart) {
                                const datasets = [];
                                const data = chart.data;
                                if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

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

                        hideVerticalBarDatalabelsIfNeeded: function (chart) {
                            let getDatasetsMeta = function (chart) {
                                const datasets = [];
                                const data = chart.data;
                                if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

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

                registerCalendar: function () {
                    const self = this,
                        container = this.getContainer();
                    //Default time format
                    let userTimeFormat = CONFIG.hourFormat;

          Function refreshWidget has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  refreshWidget: function refreshWidget() {
                      let thisInstance = this;
                      let parent = this.getContainer();
                      let element = parent.find('.js-widget-refresh');
                      let url = element.data('url');

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

                            fixXAxisLabels: function fixXAxisLabels(chart) {
                                let shortenXTicks = function shortenXTicks(data, options) {
                                    if (typeof options.scales === 'undefined') {
                                        options.scales = {};
                                    }

              Function registerFilter has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerFilter: function registerFilter() {
                          const container = this.getContainer();
                          const search = container.find('.listSearchContributor');
                          const refreshBtn = container.find('.js-widget-refresh');
                          const originalUrl = refreshBtn.data('url');

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

                        mergeOptionsObject: function mergeOptionsObject(to, from) {
                            if (typeof to === 'undefined') {
                                to = {};
                            }
                            for (let key in from) {

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

                        parseOptionsObject: function parseOptionsObject(options, original, afterInit = false) {
                            let result = {};
                            for (let propertyName in options) {
                                let value = options[propertyName];
                                if (afterInit) {

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

                                hideVerticalBarDatalabelsIfNeeded: function (chart) {
                                    let getDatasetsMeta = function (chart) {
                                        const datasets = [];
                                        const data = chart.data;
                                        if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

                  Function hideHorizontalBarDatalabelsIfNeeded has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  hideHorizontalBarDatalabelsIfNeeded: function hideHorizontalBarDatalabelsIfNeeded(chart) {
                                      let getDatasetsMeta = function (chart) {
                                          const datasets = [];
                                          const data = chart.data;
                                          if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

                    Function fixYAxisLabels has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    fixYAxisLabels: function fixYAxisLabels(chart) {
                                        let shortenYTicks = function shortenYTicks(data, options) {
                                            if (typeof options.scales === 'undefined') {
                                                options.scales = {};
                                            }

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

                              registerLoadMore: function () {
                                  var thisInstance = this;
                                  var parent = thisInstance.getContainer();
                                  var contentContainer = parent.find('.dashboardWidgetContent');
                                  var loadMoreHandler = contentContainer.find('.load-more');

                        Function registerCalendar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                                registerCalendar: function () {
                                    const self = this,
                                        container = this.getContainer();
                                    //Default time format
                                    let userTimeFormat = CONFIG.hourFormat;

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

                                registerNavigatorButtons: function () {
                                    const container = this.getContainer();
                                    let btnStart = container.find('.js-time-counter-start');
                                    let btnStop = container.find('.js-time-counter-stop');
                                    let btnReset = container.find('.js-time-counter-reset');

                          Function getBasicOptions has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  getBasicOptions: function getBasicOptions() {
                                      return {
                                          legend: {
                                              display: true
                                          },

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

                                    registerContentEvents() {
                                        const container = this.getContainer();
                                        $('.js-history-detail', container).on('click', (e) => {
                                            let actionId = e.currentTarget.dataset.action;
                                            let widgetData = JSON.parse(container.find('.js-widget-data').val());

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

                                      loadCalendarData: function () {
                                          this.fullCalendar.removeAllEvents();
                                          const start_date = App.Fields.Date.dateToUserFormat(this.fullCalendar.view.activeStart),
                                              end_date = App.Fields.Date.dateToUserFormat(this.fullCalendar.view.activeEnd),
                                              parent = this.getContainer();

                                Function formatTooltipTitles has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        formatTooltipTitles: function formatTooltipTitles(data) {
                                            data.datasets.forEach((dataset) => {
                                                if (typeof dataset.titlesFormatted === 'undefined') {
                                                    dataset.titlesFormatted = [];
                                                    dataset.data.forEach((dataItem, index) => {

                                  Function timeCounter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          timeCounter: function () {
                                              if (this.counter === false) {
                                                  this.sec = parseInt(this.sec);
                                                  this.min = parseInt(this.min);
                                                  this.hr = parseInt(this.hr);

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

                                          generateChartData: function () {
                                              const thisInstance = this,
                                                  container = this.getContainer(),
                                                  jData = container.find('.widgetData').val(),
                                                  data = JSON.parse(jData);

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

                                            timeCounter: function () {
                                                if (this.counter === false) {
                                                    this.sec = parseInt(this.sec);
                                                    this.min = parseInt(this.min);
                                                    this.hr = parseInt(this.hr);

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

                                              registerLoadMore: function registerLoadMore() {
                                                  var thisInstance = this;
                                                  var parent = thisInstance.getContainer();
                                                  var contentContainer = parent.find('.dashboardWidgetContent');
                                                  contentContainer.off('click', '.showMoreHistory');

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

                                                parseOptionsObject: function parseOptionsObject(options, original, afterInit = false) {
                                                    let result = {};
                                                    for (let propertyName in options) {
                                                        let value = options[propertyName];
                                                        if (afterInit) {

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

                                                  registerSectionClick: function registerSectionClick() {
                                                      const thisInstance = this;
                                                      let pointer = false;
                                                      $(thisInstance.chartInstance.canvas)
                                                          .on('click', function (e) {

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

                                                    loadScrollbar: function loadScrollbar() {
                                                        let container = $(this.getChartContainer(false));
                                                        if (!container.length) {
                                                            container = this.getContainerContent();
                                                        }

                                              Function refreshWidget has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                      refreshWidget: function refreshWidget() {
                                                          let thisInstance = this;
                                                          let parent = this.getContainer();
                                                          let element = parent.find('.js-widget-refresh');
                                                          let url = element.data('url');
                                              Severity: Minor
                                              Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 55 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

                                                                      if (!to.hasOwnProperty(key)) {
                                                                          to[key] = from[key];
                                                                      }
                                              Severity: Major
                                              Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 45 mins to fix

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

                                                                fixXAxisLabels: function fixXAxisLabels(chart) {
                                                                    let shortenXTicks = function shortenXTicks(data, options) {
                                                                        if (typeof options.scales === 'undefined') {
                                                                            options.scales = {};
                                                                        }
                                                Severity: Minor
                                                Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.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 mergeOptionsArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                        mergeOptionsArray: function mergeOptionsArray(to, fromArray) {
                                                            if (typeof to !== 'undefined') {
                                                                return to;
                                                            }
                                                            to = [];
                                                Severity: Minor
                                                Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.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

                                                                                        if (categoryWidth < shortenedWidth) {
                                                                                            chart.options = rotateXLabels90(chart.data, chart.options);
                                                                                            chart.options = shortenXTicks(chart.data, chart.options);
                                                                                        } else {
                                                                                            chart.options = shortenXTicks(chart.data, chart.options);
                                                Severity: Major
                                                Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                                          if (!dataset._updated) {
                                                                                              dataset._updated = true;
                                                                                              chart.update();
                                                                                              // recalculate positions for smooth animation (for all datasets)
                                                                                              chart.data.datasets.forEach((dataset, index) => {
                                                  Severity: Major
                                                  Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                            if (!dataset._updated) {
                                                                                                dataset._updated = true;
                                                                                                chart.update();
                                                                                                // recalculate positions for smooth animation (for all datasets)
                                                                                                chart.data.datasets.forEach((dataset, index) => {
                                                    Severity: Major
                                                    Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 45 mins to fix

                                                      Consider simplifying this complex logical expression.
                                                      Open

                                                                          } else if (
                                                                              typeof from[key] === 'object' &&
                                                                              from[key] !== null &&
                                                                              (!to.hasOwnProperty(key) || (typeof to[key] === 'object' && to[key] !== null && !Array.isArray(to[key])))
                                                                          ) {
                                                      Severity: Major
                                                      Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 40 mins to fix

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

                                                                loadCalendarData: function () {
                                                                    this.fullCalendar.removeAllEvents();
                                                                    const start_date = App.Fields.Date.dateToUserFormat(this.fullCalendar.view.activeStart),
                                                                        end_date = App.Fields.Date.dateToUserFormat(this.fullCalendar.view.activeEnd),
                                                                        parent = this.getContainer();
                                                        Severity: Minor
                                                        Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.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 loadScrollbar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                                loadScrollbar: function loadScrollbar() {
                                                                    let container = $(this.getChartContainer(false));
                                                                    if (!container.length) {
                                                                        container = this.getContainerContent();
                                                                    }
                                                        Severity: Minor
                                                        Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.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

                                                                        barStacked: {
                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 829..893

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

                                                        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

                                                                        horizontalBarStacked: {
                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 701..765

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

                                                        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

                                                                        horizontalBar: {
                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 638..700

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

                                                        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

                                                                        bar: {
                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 766..828

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

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

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

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 200.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

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

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 200.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                registerActivityChange: function () {
                                                                    var thisInstance = this;
                                                                    var refreshContainer = this.getContainer().find('.dashboardWidgetContent');
                                                                    refreshContainer.find('.changeActivity').on('click', function (e) {
                                                                        if (jQuery(e.target).is('a') || thisInstance.modalView) {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2685..2701

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

                                                        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

                                                                registerAction: function () {
                                                                    var thisInstance = this;
                                                                    var refreshContainer = this.getContainer().find('.dashboardWidgetContent');
                                                                    refreshContainer.find('.rowAction').on('click', function (e) {
                                                                        if (jQuery(e.target).is('a') || thisInstance.modalView) {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2624..2640

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

                                                        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

                                                                            let getDatasetsMeta = function (chart) {
                                                                                const datasets = [];
                                                                                const data = chart.data;
                                                                                if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {
                                                                                    for (let i = 0, len = data.datasets.length; i < len; i++) {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 290..302

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

                                                        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

                                                                            let getDatasetsMeta = function (chart) {
                                                                                const datasets = [];
                                                                                const data = chart.data;
                                                                                if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {
                                                                                    for (let i = 0, len = data.datasets.length; i < len; i++) {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 224..236

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

                                                        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

                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                                                },
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 957..995

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 139.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                                                },
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1083..1121

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 139.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                                if (String(dataItem).length > 0 && !isNaN(Number(dataItem))) {
                                                                                    if (
                                                                                        typeof this.widgetData !== 'undefined' &&
                                                                                        typeof this.widgetData.valueType !== 'undefined' &&
                                                                                        this.widgetData.valueType === 'count'
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1998..2008
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2011..2021

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

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                                if (String(defaultLabel).length > 0 && !isNaN(Number(defaultLabel))) {
                                                                                    if (
                                                                                        typeof this.widgetData !== 'undefined' &&
                                                                                        typeof this.widgetData.valueType !== 'undefined' &&
                                                                                        this.widgetData.valueType === 'count'
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2011..2021
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2043..2053

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

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                                    if (String(label).length > 0 && !isNaN(Number(label))) {
                                                                                        if (
                                                                                            typeof this.widgetData !== 'undefined' &&
                                                                                            typeof this.widgetData.valueType !== 'undefined' &&
                                                                                            this.widgetData.valueType === 'count'
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1998..2008
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2043..2053

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

                                                        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

                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                                                },
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 895..932

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

                                                        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

                                                                            basic: {
                                                                                maintainAspectRatio: false,
                                                                                title: {
                                                                                    display: false
                                                                                },
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1020..1057

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

                                                        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

                                                                                                        dataset._meta[prop].data.forEach((metaDataItem, dataIndex) => {
                                                                                                            metaDataItem._view.x = metaDataItem._xScale.getPixelForValue(index, dataIndex);
                                                                                                            metaDataItem._view.base = metaDataItem._xScale.getBasePixel();
                                                                                                            metaDataItem._view.width =
                                                                                                                (metaDataItem._xScale.width / dataset._meta[prop].data.length) *
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 484..491

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

                                                        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 metaDataItem._xScale !== 'undefined') {
                                                                                                                metaDataItem._view.x = metaDataItem._xScale.getPixelForValue(index, dataIndex);
                                                                                                                metaDataItem._view.base = metaDataItem._xScale.getBasePixel();
                                                                                                                metaDataItem._view.width =
                                                                                                                    (metaDataItem._xScale.width / dataset._meta[prop].data.length) *
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 422..429

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

                                                        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

                                                                    btnReset.on('click', () => {
                                                                        navigatorButtons.removeClass('active');
                                                                        btnReset.addClass('d-none');
                                                                        btnStop.addClass('d-none');
                                                                        btnStart.removeClass('d-none');
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3383..3392

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

                                                        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

                                                                    btnStart.on('click', () => {
                                                                        navigatorButtons.addClass('active');
                                                                        btnStart.addClass('d-none');
                                                                        btnStop.removeClass('d-none');
                                                                        btnReset.removeClass('d-none');
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3396..3405

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

                                                        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 (model !== null && typeof model !== 'undefined') {
                                                                                            dataset._models[iItem] = model;
                                                                                        } else if (dataset._models[iItem] !== null && typeof dataset._models[iItem] !== 'undefined') {
                                                                                            model = dataset._models[iItem];
                                                                                        } else {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 259..265

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

                                                        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 (model !== null && typeof model !== 'undefined') {
                                                                                            dataset._models[iItem] = model;
                                                                                        } else if (dataset._models[iItem] !== null && typeof dataset._models[iItem] !== 'undefined') {
                                                                                            model = dataset._models[iItem];
                                                                                        } else {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 325..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 96.

                                                        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 (propertyName.substr(0, 1) === '_') {
                                                                                result[propertyName] = value;
                                                                            } else if (Array.isArray(value)) {
                                                                                result[propertyName] = this.parseOptionsArray(value, original, afterInit);
                                                                            } else if (typeof value === 'object' && value !== null) {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 569..577

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

                                                        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

                                                                            } else if (this.isReplacementString(value)) {
                                                                                result[propertyName] = this.getFunctionFromReplacementString(value, afterInit, original);
                                                                            } else if (Array.isArray(value)) {
                                                                                result[propertyName] = this.parseOptionsArray(value, original, afterInit);
                                                                            } else if (typeof value === 'object' && value !== null) {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 557..565

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

                                                        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 searchValue === 'object') {
                                                                                if (searchValue == null) {
                                                                                    searchValue = '';
                                                                                } else {
                                                                                    searchValue = searchValue.join('##');
                                                        public_html/layouts/basic/modules/Vtiger/resources/ListSearch.js on lines 279..287

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

                                                        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 data.datasets[tooltipItem.datasetIndex].dataFormatted !== 'undefined' &&
                                                                                data.datasets[tooltipItem.datasetIndex].dataFormatted[tooltipItem.index] !== 'undefined'
                                                                            ) {
                                                                                return data.datasets[tooltipItem.datasetIndex].dataFormatted[tooltipItem.index];
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 159..164

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

                                                        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 data.datasets[tooltipItem.datasetIndex].titlesFormatted !== 'undefined' &&
                                                                                data.datasets[tooltipItem.datasetIndex].titlesFormatted[tooltipItem.index] !== 'undefined'
                                                                            ) {
                                                                                return data.datasets[tooltipItem.datasetIndex].titlesFormatted[tooltipItem.index];
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 130..135

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

                                                        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 (dataItem._view.height + threshold < labelHeight || barWidth + threshold < labelWidth) {
                                                                                            dataItem.$datalabels._model.positioner = () => {
                                                                                                return false;
                                                                                            };
                                                                                        } else {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 273..279

                                                        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

                                                                                        if (dataItem._view.width + threshold < labelWidth || barHeight + threshold < labelHeight) {
                                                                                            dataItem.$datalabels._model.positioner = () => {
                                                                                                return false;
                                                                                            };
                                                                                        } else {
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 339..345

                                                        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

                                                                    this.getContainer().on('mousedown.draggable', function (e) {
                                                                        var element = jQuery(e.target);
                                                                        var isHeaderElement = element.closest('.dashboardWidgetHeader').length > 0 ? true : false;
                                                                        if (isHeaderElement) {
                                                                            return;
                                                        public_html/layouts/basic/modules/Vtiger/resources/DashBoard.js on lines 20..28

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

                                                        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

                                                                            dataset: {
                                                                                fill: false,
                                                                                datalabels: {
                                                                                    font: {
                                                                                        size: 11
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 996..1012

                                                        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

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

                                                                            dataset: {
                                                                                fill: false,
                                                                                datalabels: {
                                                                                    font: {
                                                                                        size: 11
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 933..949

                                                        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

                                                                        AppConnector.request(params)
                                                                            .done(function (data) {
                                                                                refreshContainer.progressIndicator({
                                                                                    mode: 'hide'
                                                                                });
                                                        public_html/layouts/basic/modules/Project/resources/GanttController.js on lines 39..47

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 66.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                    if (Array.isArray(options)) {
                                                                        return this.parseOptionsArray(options, original, afterInit);
                                                                    } else if (typeof options === 'object' && options !== null) {
                                                                        return this.parseOptionsObject(options, original, afterInit);
                                                                    }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 592..596

                                                        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

                                                                        } else if (Array.isArray(item)) {
                                                                            return this.parseOptionsArray(item, original, afterInit);
                                                                        } else if (typeof item === 'object' && item !== null) {
                                                                            return this.parseOptionsObject(item, original, afterInit);
                                                                        }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 607..611

                                                        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

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

                                                                    container.find('.js-widget-quick-create').on('click', function (e) {
                                                                        App.Components.QuickCreate.createRecord($(this).data('module-name'));
                                                                    });
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1552..1554

                                                        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

                                                                    container.find('.js-widget-quick-create').on('click', function (e) {
                                                                        App.Components.QuickCreate.createRecord($(this).data('module-name'));
                                                                    });
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2393..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 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 3 locations. Consider refactoring.
                                                        Open

                                                                getMultifilterContent() {
                                                                    if (this.multifilterContentView == false) {
                                                                        this.multifilterContentView = this.getContainer().find('.js-multifilterContent');
                                                                    }
                                                                    return this.multifilterContentView;
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3192..3197
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3204..3209

                                                        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

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

                                                                getMultifilterSettings() {
                                                                    if (this.multifilterSettingsView == false) {
                                                                        this.multifilterSettingsView = this.getContainer().find('.js-settings-widget');
                                                                    }
                                                                    return this.multifilterSettingsView;
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3192..3197
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3198..3203

                                                        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

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

                                                                getMultifilterControls() {
                                                                    if (this.multifilterControlsView == false) {
                                                                        this.multifilterControlsView = this.getContainer().find('.js-multifilterControls');
                                                                    }
                                                                    return this.multifilterControlsView;
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3198..3203
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3204..3209

                                                        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

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

                                                                getCalendarView: function () {
                                                                    if (this.calendarView === false) {
                                                                        this.calendarView = this.getContainer().find('.js-calendar__container');
                                                                    }
                                                                    return this.calendarView;
                                                        public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 176..181

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

                                                                postLoadWidget: function () {
                                                                    this.restrictContentDrag();
                                                                    this.registerFilter();
                                                                    this.registerFilterChangeEvent();
                                                                    this.registerRecordsCount();
                                                        public_html/layouts/basic/modules/HelpDesk/resources/Detail.js on lines 328..333
                                                        public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 21..26
                                                        public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 2176..2181

                                                        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

                                                                        if (activitiesStatus === 'OverdueActivities') {
                                                                            status = 'PLL_OVERDUE';
                                                                        } else if (activitiesStatus === 'CalendarActivities') {
                                                                            status = 'PLL_IN_REALIZATION##PLL_PLANNED';
                                                                        } else {
                                                        public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 838..844

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 48.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                        if (this.sec < 10 || this.sec === 0) {
                                                                            this.sec = '0' + this.sec;
                                                                        }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3522..3524
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3525..3527

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 46.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                        if (this.min < 10 || this.min === 0) {
                                                                            this.min = '0' + this.min;
                                                                        }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3519..3521
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3525..3527

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 46.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                        if (this.hr < 10 || this.hr === 0) {
                                                                            this.hr = '0' + this.hr;
                                                                        }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3519..3521
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 3522..3524

                                                        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

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

                                                                    if (!this.isEmptyData()) {
                                                                        this.loadChart(this.options);
                                                                    } else {
                                                                        this.positionNoDataMsg();
                                                                    }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1482..1486

                                                        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

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

                                                                    if (!this.isEmptyData()) {
                                                                        this.loadChart(this.options);
                                                                    } else {
                                                                        this.positionNoDataMsg();
                                                                    }
                                                        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1465..1469

                                                        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