axsh/wakame-vdc

View on GitHub
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js

Summary

Maintainability
F
3 wks
Test Coverage

File jquery-ui-timepicker-addon.js has 1194 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
* jQuery timepicker addon
* By: Trent Richardson [http://trentrichardson.com]
* Version 1.0.1
* Last Modified: 07/01/2012
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 3 days to fix

Function _injectTimePicker has 286 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _injectTimePicker: function() {
        var $dp = this.inst.dpDiv,
            o = this._defaults,
            tp_inst = this,
            // Added by Peter Medeiros:
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 day to fix

Function _limitMinMaxDateTime has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _limitMinMaxDateTime: function(dp_inst, adjustSliders){
        var o = this._defaults,
            dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);

        if(!this._defaults.showTimepicker) { return; } // No time so nothing to check here
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 3 hrs to fix

Function parseTime has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.datepicker.parseTime = function(timeFormat, timeString, options) {
    
    //########################################################################
    // pattern for standard and localized AM/PM markers
    //########################################################################
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 3 hrs to fix

Function _newInst has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _newInst: function($input, o) {
        var tp_inst = new Timepicker(),
            inlineSettings = {};

        for (var attrName in this._defaults) {
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 3 hrs to fix

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

$.datepicker._optionDatepicker = function(target, name, value) {
    var inst = this._getInst(target);
    if (!inst) { return null; }
    
    var tp_inst = this._get(inst, 'timepicker');
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 2 hrs to fix

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

function Timepicker() {
    this.regional = []; // Available regional settings, indexed by language code
    this.regional[''] = { // Default regional settings
        currentText: 'Now',
        closeText: 'Done',
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 2 hrs to fix

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

$.datepicker.formatTime = function(format, time, options) {
    options = options || {};
    options = $.extend($.timepicker._defaults, options);
    time = $.extend({hour:0, minute:0, second:0, millisec:0, timezone:'+0000'}, time);

Severity: Minor
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 hr to fix

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

$.datepicker._setTime = function(inst, date) {
    var tp_inst = this._get(inst, 'timepicker');
    if (tp_inst) {
        var defaults = tp_inst._defaults,
            // calling _setTime with no date sets time to defaults
Severity: Minor
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 hr to fix

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

    _onTimeChange: function() {
        var hour   = (this.hour_slider) ? this.hour_slider.slider('value') : false,
            minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
            second = (this.second_slider) ? this.second_slider.slider('value') : false,
            millisec = (this.millisec_slider) ? this.millisec_slider.slider('value') : false,
Severity: Minor
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 hr to fix

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

$.datepicker._doKeyPress = function(event) {
    var inst = $.datepicker._getInst(event.target),
        tp_inst = $.datepicker._get(inst, 'timepicker');

    if (tp_inst) {
Severity: Minor
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                            } else if (aph == 12) { h = 12; }
                            else { h = aph + 12; }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (h === 0) {
                            tmph = 12 +'a';
                        } else {
                            if (h < 12) { tmph += 'a'; }
                            else { tmph += 'p'; }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if (aph == 12) { h = 0; }
                                else { h = aph; }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (tz.substring(1) == '00:00') {
                            tz = 'Z';
                        }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if(this.millisec < this._defaults.millisecMin) {
                            this.millisec = this._defaults.millisecMin;
                        }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (name === 'onSelect') {
                        onselect = value;
                    }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (name.minDateTime) {
                        min = name.minDateTime;
                    } else {
                        if (name.maxDate) {
                            max = name.maxDate;
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if(this.millisec > this._defaults.millisecMax) { this.millisec = this._defaults.millisecMax; }
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

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

$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
Severity: Minor
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 35 mins to fix

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

var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings)
Severity: Minor
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 35 mins to fix

Avoid too many return statements within this function.
Open

            return true;
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 30 mins to fix

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

            if(dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()){
                this._defaults.hourMax = maxDateTime.getHours();
                if (this.hour >= this._defaults.hourMax) {
                    this.hour = this._defaults.hourMax;
                    this._defaults.minuteMax = maxDateTime.getMinutes();
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 648..675

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

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(dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
                this._defaults.hourMin = minDateTime.getHours();
                if (this.hour <= this._defaults.hourMin) {
                    this.hour = this._defaults.hourMin;
                    this._defaults.minuteMin = minDateTime.getMinutes();
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 689..714

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

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.showMillisec && o.millisecGrid > 0) {
                $tp.find(".ui_tpicker_millisec table").css({
                    width: size + "%",
                    marginLeft: (size / (-2 * millisecGridSize)) + "%",
                    borderCollapse: 'collapse'
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 540..557

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

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.showSecond && o.secondGrid > 0) {
                $tp.find(".ui_tpicker_second table").css({
                    width: size + "%",
                    marginLeft: (size / (-2 * secondGridSize)) + "%",
                    borderCollapse: 'collapse'
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 559..576

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

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.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({
                orientation: "horizontal",
                value: this.second,
                min: o.secondMin,
                max: secMax,
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 448..458

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

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.millisec_slider = $tp.find('#ui_tpicker_millisec_'+ dp_id).slider({
                orientation: "horizontal",
                value: this.millisec,
                min: o.millisecMin,
                max: millisecMax,
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 436..446

Duplicated Code

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

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

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

Tuning

This issue has a mass of 112.

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 (o.showMillisec && o.millisecGrid > 0) {
                html += '<div style="padding-left: 1px"><table><tr>';

                for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) {
                    millisecGridSize++;
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 343..352
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 361..370

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

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 (o.showSecond && o.secondGrid > 0) {
                html += '<div style="padding-left: 1px"><table><tr>';

                for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) {
                    secondGridSize++;
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 343..352
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 379..388

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

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 (o.showMinute && o.minuteGrid > 0) {
                html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';

                for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) {
                    minuteGridSize++;
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 361..370
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 379..388

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

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

            html += '<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_' + dp_id + '"' +
                    ((o.showMinute) ? '' : noDisplay) + '>' + o.minuteText + '</dt>'+
                    '<dd class="ui_tpicker_minute"><div id="ui_tpicker_minute_' + dp_id + '"' +
                            ((o.showMinute) ? '' : noDisplay) + '></div>';
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 356..359
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 374..377

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

            html += '<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_' + dp_id + '"' +
                    ((o.showSecond) ? '' : noDisplay) + '>' + o.secondText + '</dt>'+
                    '<dd class="ui_tpicker_second"><div id="ui_tpicker_second_' + dp_id + '"'+
                            ((o.showSecond) ? '' : noDisplay) + '></div>';
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 338..341
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 374..377

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

            html += '<dt class="ui_tpicker_millisec_label" id="ui_tpicker_millisec_label_' + dp_id + '"' +
                    ((o.showMillisec) ? '' : noDisplay) + '>' + o.millisecText + '</dt>'+
                    '<dd class="ui_tpicker_millisec"><div id="ui_tpicker_millisec_' + dp_id + '"'+
                            ((o.showMillisec) ? '' : noDisplay) + '></div>';
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 338..341
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 356..359

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(min) { //if min was set
            if (min === 0) {
                min = new Date();
            } else {
                min = new Date(min);
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 1416..1426

Duplicated Code

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

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

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

Tuning

This issue has a mass of 72.

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

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

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

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

Refactorings

Further Reading

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

        } else if (max) { //if max was set
            if(max===0) {
                max=new Date();
            } else {
                max= new Date(max);
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 1407..1426

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

        if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
            tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
        }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 227..229
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 230..232

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

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(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
            tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
        }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 224..226
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 230..232

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

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(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
            tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
        }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 224..226
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 227..229

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

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(this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null){
                this.hourMinOriginal = o.hourMin;
                this.minuteMinOriginal = o.minuteMin;
                this.secondMinOriginal = o.secondMin;
                this.millisecMinOriginal = o.millisecMin;
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 682..687

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

            if(this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null){
                this.hourMaxOriginal = o.hourMax;
                this.minuteMaxOriginal = o.minuteMax;
                this.secondMaxOriginal = o.secondMax;
                this.millisecMaxOriginal = o.millisecMax;
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 641..646

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

            if(this.second_slider){
                this.second_slider.slider("option", { min: this._defaults.secondMin, max: secMax }).slider('value', this.second);
            }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 723..725
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 726..728
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 732..734

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

            if(this.hour_slider) {
                this.hour_slider.slider("option", { min: this._defaults.hourMin, max: hourMax }).slider('value', this.hour);
            }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 726..728
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 729..731
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 732..734

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

            if(this.millisec_slider) {
                this.millisec_slider.slider("option", { min: this._defaults.millisecMin, max: millisecMax }).slider('value', this.millisec);
            }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 723..725
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 726..728
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 729..731

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

            if(this.minute_slider) {
                this.minute_slider.slider("option", { min: this._defaults.minuteMin, max: minMax }).slider('value', this.minute);
            }
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 723..725
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 729..731
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 732..734

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

            var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
                minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 679..680

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

            var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
                maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 638..639

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

            var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)) ,10),
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 719..719
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 720..720
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 721..721

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

                millisecMax  = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)) ,10);
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 718..718
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 719..719
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 720..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 54.

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

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

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

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

Refactorings

Further Reading

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

                secMax  = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)) ,10),
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 718..718
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 719..719
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 721..721

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

                minMax  = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)) ,10),
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 718..718
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 720..720
frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 721..721

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status