smartinmedia/cunity

View on GitHub
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js

Summary

Maintainability
F
2 wks
Test Coverage

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

/* =========================================================
 * bootstrap-datepicker.js
 * Repo: https://github.com/eternicode/bootstrap-datepicker/
 * Demo: http://eternicode.github.io/bootstrap-datepicker/
 * Docs: http://bootstrap-datepicker.readthedocs.org/
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 3 days to fix

Function keydown has 114 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 lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

Function fill has 110 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.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

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

                        click: function(e) {
                            e.preventDefault();
                            var target = $(e.target).closest('span, td, th'),
                                    year, month, day;
                            if (target.length === 1) {
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

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

                        parseDate: function(date, format, language) {
                            if (!date)
                                return undefined;
                            if (date instanceof Date)
                                return date;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

Function _process_options has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _process_options: function(opts) {
            // Store raw options for reference
            this._o = $.extend({}, this._o, opts);
            // Processed options
            var o = this.o = $.extend({}, this._o);
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

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

        _buildEvents: function() {
            if (this.isInput) { // single input
                this._events = [
                    [this.element, {
                            focus: $.proxy(this.show, this),
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 2 hrs to fix

Function place has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                        place: function() {
                            if (this.isInline)
                                return;
                            var calendarWidth = this.picker.outerWidth(),
                                    calendarHeight = this.picker.outerHeight(),
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 2 hrs to fix

Function update has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                        update: function() {
                            if (!this._allow_update)
                                return;

                            var oldDates = this.dates.copy(),
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 2 hrs to fix

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

    var Datepicker = function(element, options) {
        this.dates = new DateArray();
        this.viewDate = UTCToday();
        this.focusDate = null;

Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

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

    var DateArray = (function() {
        var extras = {
            get: function(i) {
                return this.slice(i)[0];
            },
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

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

                        moveMonth: function(date, dir) {
                            if (!date)
                                return undefined;
                            if (!dir)
                                return date;
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

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

                        updateNavArrows: function() {
                            if (!this._allow_update)
                                return;

                            var d = new Date(this.viewDate),
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

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

                        getClassNames: function(date) {
                            var cls = [],
                                    year = this.viewDate.getUTCFullYear(),
                                    month = this.viewDate.getUTCMonth(),
                                    today = new Date();
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

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

                    $.fn.datepicker = function(option) {
                        var args = Array.apply(null, arguments);
                        args.shift();
                        var internal_return;
                        this.each(function() {
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                                                if (this.o.minViewMode === 2) {
                                                    this._setDate(UTCDate(year, month, day));
                                                }
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/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;
                                                }
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

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

Avoid deeply nested control flow statements.
Open

                                                        if (this.viewMode === 1)
                                                            this._trigger('changeYear', this.viewDate);
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                                if (this.o.minViewMode === 1) {
                                                    this._setDate(UTCDate(year, month, day));
                                                }
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 45 mins to fix

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

        _applyEvents: function(evs) {
            for (var i = 0, el, ch, ev; i < evs.length; i++) {
                el = evs[i][0];
                if (evs[i].length === 2) {
                    ch = undefined;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 6 hrs to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 281..294

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

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

        _unapplyEvents: function(evs) {
            for (var i = 0, el, ev, ch; i < evs.length; i++) {
                el = evs[i][0];
                if (evs[i].length === 2) {
                    ch = undefined;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 6 hrs to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 267..280

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

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(function(e) {
                                if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
                                    this.update();
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 3 hrs to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 311..318

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

                    [this.element.find('input'), {
                            focus: $.proxy(this.show, this),
                            keyup: $.proxy(function(e) {
                                if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
                                    this.update();
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 3 hrs to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 298..305

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

                if (!!o.endDate) {
                    if (o.endDate instanceof Date)
                        o.endDate = this._local_to_utc(this._zero_time(o.endDate));
                    else
                        o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 204..212

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

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 (!!o.startDate) {
                    if (o.startDate instanceof Date)
                        o.startDate = this._local_to_utc(this._zero_time(o.startDate));
                    else
                        o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 215..223

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

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 (e.ctrlKey) {
                                        newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
                                        newViewDate = this.moveYear(focusDate, dir);
                                        this._trigger('changeYear', this.viewDate);
                                    }
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1107..1122
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1112..1122
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1140..1150

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

                                    else if (e.shiftKey) {
                                        newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
                                        newViewDate = this.moveMonth(focusDate, dir);
                                        this._trigger('changeMonth', this.viewDate);
                                    }
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1107..1122
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1135..1150
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1140..1150

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

                                    else if (e.shiftKey) {
                                        newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
                                        newViewDate = this.moveMonth(focusDate, dir);
                                        this._trigger('changeMonth', this.viewDate);
                                    }
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1107..1122
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1112..1122
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1135..1150

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

                                    if (e.ctrlKey) {
                                        newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
                                        newViewDate = this.moveYear(focusDate, dir);
                                        this._trigger('changeYear', this.viewDate);
                                    }
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1112..1122
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1135..1150
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1140..1150

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

                                    if (this.dateWithinRange(newDate)) {
                                        this.focusDate = this.viewDate = newViewDate;
                                        this.setValue();
                                        this.fill();
                                        e.preventDefault();
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1123..1128

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

                                    if (this.dateWithinRange(newDate)) {
                                        this.focusDate = this.viewDate = newViewDate;
                                        this.setValue();
                                        this.fill();
                                        e.preventDefault();
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1151..1156

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

                                            case 'MM':
                                                filtered = $(dates[language].months).filter(match_part);
                                                val = $.inArray(filtered[0], dates[language].months) + 1;
                                                break;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1523..1526

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

                                            case 'M':
                                                filtered = $(dates[language].monthsShort).filter(match_part);
                                                val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
                                                break;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1519..1522

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

            switch (o.startView) {
                case 2:
                case 'decade':
                    o.startView = 2;
                    break;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 174..185

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

            switch (o.minViewMode) {
                case 1:
                case 'months':
                    o.minViewMode = 1;
                    break;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 161..172

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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 lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 55 mins to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1014..1019

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 lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 1 other location - About 55 mins to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 1189..1194

Duplicated Code

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

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

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

Tuning

This issue has a mass of 53.

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

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

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

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

Refactorings

Further Reading

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

                        setEndDate: function(endDate) {
                            this._process_options({endDate: endDate});
                            this.update();
                            this.updateNavArrows();
                        },
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 507..511
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 517..521

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

                        setDaysOfWeekDisabled: function(daysOfWeekDisabled) {
                            this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
                            this.update();
                            this.updateNavArrows();
                        },
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 507..511
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 512..516

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

                        setStartDate: function(startDate) {
                            this._process_options({startDate: startDate});
                            this.update();
                            this.updateNavArrows();
                        },
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 512..516
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 517..521

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

There are no issues that match your filters.

Category
Status