remomueller/contour

View on GitHub
app/assets/javascripts/external/bootstrap-datepicker.js

Summary

Maintainability
F
1 wk
Test Coverage

File bootstrap-datepicker.js has 878 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* =========================================================
 * bootstrap-datepicker.js
 * http://www.eyecon.ro/bootstrap-datepicker
 * =========================================================
 * Copyright 2012 Stefan Petre
Severity: Major
Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 2 days to fix

    Function fill has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            fill: function() {
                var d = new Date(this.viewDate),
                    year = d.getUTCFullYear(),
                    month = d.getUTCMonth(),
                    startYear = this.startDate !== -Infinity ? this.startDate.getUTCFullYear() : -Infinity,
    Severity: Major
    Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

      Function Datepicker has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Datepicker = function(element, options) {
              var that = this;
      
              this.element = $(element);
              this.language = options.language||this.element.data('date-language')||"en";
      Severity: Major
      Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

        Function keydown has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                keydown: function(e){
                    if (this.picker.is(':not(:visible)')){
                        if (e.keyCode == 27) // allow escape to hide and re-show picker
                            this.show();
                        return;
        Severity: Major
        Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

          Function parseDate has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  parseDate: function(date, format, language) {
                      if (date instanceof Date) return date;
                      if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
                          var part_re = /([\-+]\d+)([dmwy])/,
                              parts = date.match(/([\-+]\d+)([dmwy])/g),
          Severity: Major
          Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

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

                    click: function(e) {
                        e.stopPropagation();
                        e.preventDefault();
                        var target = $(e.target).closest('span, td, th');
                        if (target.length == 1) {
            Severity: Major
            Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

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

                      _attachEvents: function(){
                          this._detachEvents();
                          if (this.isInput) { // single input
                              this._events = [
                                  [this.element, {
              Severity: Minor
              Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 1 hr to fix

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

                        updateNavArrows: function() {
                            var d = new Date(this.viewDate),
                                year = d.getUTCFullYear(),
                                month = d.getUTCMonth();
                            switch (this.viewMode) {
                Severity: Minor
                Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 1 hr to fix

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

                          moveMonth: function(date, dir){
                              if (!dir) return date;
                              var new_date = new Date(date.valueOf()),
                                  day = new_date.getUTCDate(),
                                  month = new_date.getUTCMonth(),
                  Severity: Minor
                  Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (month === 0) {
                                                        month = 11;
                                                        year -= 1;
                                                    } else {
                                                        month -= 1;
                    Severity: Major
                    Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  } else if (target.is('.new')) {
                                                      if (month == 11) {
                                                          month = 0;
                                                          year += 1;
                                                      } else {
                      Severity: Major
                      Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 45 mins to fix

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

                                                    case 'MM':
                                                        filtered = $(dates[language].months).filter(function(){
                                                            var m = this.slice(0, parts[i].length),
                                                                p = parts[i].slice(0, m.length);
                                                            return m == p;
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 4 hrs to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 905..912

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

                        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

                                                    case 'M':
                                                        filtered = $(dates[language].monthsShort).filter(function(){
                                                            var m = this.slice(0, parts[i].length),
                                                                p = parts[i].slice(0, m.length);
                                                            return m == p;
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 4 hrs to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 897..904

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

                        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

                                    for (var i=0, el, ev; i<this._events.length; i++){
                                        el = this._events[i][0];
                                        ev = this._events[i][1];
                                        el.off(ev);
                                    }
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 180..184

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

                        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

                                    for (var i=0, el, ev; i<this._events.length; i++){
                                        el = this._events[i][0];
                                        ev = this._events[i][1];
                                        el.on(ev);
                                    }
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 187..191

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

                        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.dateWithinRange(newDate)){
                                                this.date = newDate;
                                                this.viewDate = newViewDate;
                                                this.setValue();
                                                this.update();
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 713..720

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

                        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.dateWithinRange(newDate)){
                                                this.date = newDate;
                                                this.viewDate = newViewDate;
                                                this.setValue();
                                                this.update();
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 688..695

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

                        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

                                if ('keyboardNavigation' in options) {
                                    this.keyboardNavigation = options.keyboardNavigation;
                                } else if ('dateKeyboardNavigation' in this.element.data()) {
                                    this.keyboardNavigation = this.element.data('date-keyboard-navigation');
                                }
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 52..56
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 84..88
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 113..117

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 72.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if ('autoclose' in options) {
                                    this.autoclose = options.autoclose;
                                } else if ('dateAutoclose' in this.element.data()) {
                                    this.autoclose = this.element.data('date-autoclose');
                                }
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 52..56
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 91..95
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 113..117

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 72.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if ('calendarWeeks' in options) {
                                    this.calendarWeeks = options.calendarWeeks;
                                } else if ('dateCalendarWeeks' in this.element.data()) {
                                    this.calendarWeeks = this.element.data('date-calendar-weeks');
                                }
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 52..56
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 84..88
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 91..95

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 72.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if ('forceParse' in options) {
                                    this.forceParse = options.forceParse;
                                } else if ('dateForceParse' in this.element.data()) {
                                    this.forceParse = this.element.data('date-force-parse');
                                }
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 84..88
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 91..95
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 113..117

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 72.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                            [this.element, {
                                                focus: $.proxy(this.show, this),
                                                keyup: $.proxy(this.update, this),
                                                keydown: $.proxy(this.keydown, this)
                                            }]
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 160..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 56.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                            [this.element.find('input'), {
                                                focus: $.proxy(this.show, this),
                                                keyup: $.proxy(this.update, this),
                                                keydown: $.proxy(this.keydown, this)
                                            }],
                        Severity: Major
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 150..154

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 56.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                    if (this.isInput) {
                                        element = this.element;
                                    } else if (this.component){
                                        element = this.element.find('input');
                                    }
                        Severity: Minor
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 55 mins to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 739..743

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 53.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                        if (this.isInput) {
                                            element = this.element;
                                        } else if (this.component){
                                            element = this.element.find('input');
                                        }
                        Severity: Minor
                        Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 55 mins to fix
                        app/assets/javascripts/external/bootstrap-datepicker.js on lines 597..601

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 53.

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

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

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

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

                        Refactorings

                        Further Reading

                        There are no issues that match your filters.

                        Category
                        Status