railstaichung/rails-taichung

View on GitHub

Showing 177 of 177 total issues

Function KeyManager has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var KeyManager = (function () {
      var $keymgr = $('<input type="radio" />').css({
        position: 'fixed',
        left: '-120px',
        width: '12px'
Severity: Major
Found in app/assets/javascripts/jquery.Jcrop.js - About 2 hrs to fix

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

          } else {
            offset = this.element.offset();
            left = offset.left;
            if (this.pickerPosition == 'bottom-left' || this.pickerPosition == 'top-left') {
              left += this.element.outerWidth() - this.picker.outerWidth();
    Severity: Major
    Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/bootstrap-datetimepicker.js on lines 552..558

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 92.

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

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

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

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

    Refactorings

    Further Reading

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

          if (this.component) {
            offset = this.component.offset();
            left = offset.left;
            if (this.pickerPosition == 'bottom-left' || this.pickerPosition == 'top-left') {
              left += this.component.outerWidth() - this.picker.outerWidth();
    Severity: Major
    Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/bootstrap-datetimepicker.js on lines 558..564

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 92.

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

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

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

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

    Refactorings

    Further Reading

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

        updateNavArrows: function () {
          var d = new Date(this.viewDate),
            year = d.getUTCFullYear(),
            month = d.getUTCMonth(),
            day = d.getUTCDate(),
    Severity: Major
    Found in app/assets/javascripts/bootstrap-datetimepicker.js - About 2 hrs to fix

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 86.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 86.

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

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

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

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

      Refactorings

      Further Reading

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

          this.componentReset = this.element.is('.date') ? ( this.bootcssVer == 3 ? this.element.find('.input-group-addon .glyphicon-remove, .input-group-addon .fa-times').parent():this.element.find('.add-on .icon-remove, .add-on .fa-times').parent()) : false;
      Severity: Major
      Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/bootstrap-datetimepicker.js on lines 98..98

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 81.

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

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

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

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

      Refactorings

      Further Reading

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

          this.component = this.element.is('.date') ? ( this.bootcssVer == 3 ? this.element.find('.input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o').parent() : this.element.find('.add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o').parent()) : false;
      Severity: Major
      Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/bootstrap-datetimepicker.js on lines 99..99

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 81.

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

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

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

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

      Refactorings

      Further Reading

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

            function getRect() //{{{
            {
              var xsize = x2 - x1,
                  ysize = y2 - y1,
                  delta;
      Severity: Major
      Found in app/assets/javascripts/jquery.Jcrop.js - About 2 hrs to fix

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

            var Touch = (function () {
              // Touch support detection function adapted (under MIT License)
              // from code by Jeffrey Sambells - http://github.com/iamamused/
              function hasTouchSupport() {
                var support = {}, events = ['touchstart', 'touchmove', 'touchend'],
        Severity: Major
        Found in app/assets/javascripts/jquery.Jcrop.js - About 2 hrs to fix

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

              function animateTo(a, callback) //{{{
              {
                var x1 = a[0] / xscale,
                    y1 = a[1] / yscale,
                    x2 = a[2] / xscale,
          Severity: Minor
          Found in app/assets/javascripts/jquery.Jcrop.js - About 2 hrs to fix

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

                addFilter: function(filter){
                  for(var i=0,m=this.ui.multi,l=m.length; i<l; i++)
                    m[i].addFilter(filter);
            
                  return this;
            Severity: Major
            Found in app/assets/javascripts/Jcrop.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/Jcrop.js on lines 2226..2231

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 74.

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

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

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

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

            Refactorings

            Further Reading

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

                      if (this.dateWithinRange(newDate)) {
                        this.date = newDate;
                        this.viewDate = newViewDate;
                        this.setValue();
                        this.update();
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 1256..1263

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 74.

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

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

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

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

            Refactorings

            Further Reading

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

                      if (this.dateWithinRange(newDate)) {
                        this.date = newDate;
                        this.viewDate = newViewDate;
                        this.setValue();
                        this.update();
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 1296..1303

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 74.

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

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

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

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

            Refactorings

            Further Reading

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

                removeFilter: function(filter){
                  for(var i=0,m=this.ui.multi,l=m.length; i<l; i++)
                    m[i].removeFilter(filter);
            
                  return this;
            Severity: Major
            Found in app/assets/javascripts/Jcrop.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/Jcrop.js on lines 2218..2223

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 74.

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

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

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

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

            Refactorings

            Further Reading

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

                if ('maxView' in options) {
                  this.maxView = options.maxView;
                } else if ('maxView' in this.element.data()) {
                  this.maxView = this.element.data('max-view');
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 10 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 131..135
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 138..142
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 154..158
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 162..166
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 169..173
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 176..180
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 185..189
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 193..197
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 237..241
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 244..248

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

                if ('autoclose' in options) {
                  this.autoclose = options.autoclose;
                } else if ('dateAutoclose' in this.element.data()) {
                  this.autoclose = this.element.data('date-autoclose');
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 10 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 131..135
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 138..142
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 146..150
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 154..158
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 162..166
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 169..173
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 176..180
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 185..189
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 193..197
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 244..248

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

                if ('forceParse' in options) {
                  this.forceParse = options.forceParse;
                } else if ('dateForceParse' in this.element.data()) {
                  this.forceParse = this.element.data('date-force-parse');
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 10 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 131..135
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 138..142
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 146..150
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 154..158
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 162..166
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 169..173
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 176..180
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 185..189
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 237..241
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 244..248

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

                if ('wheelViewModeNavigationInverseDirection' in options) {
                  this.wheelViewModeNavigationInverseDirection = options.wheelViewModeNavigationInverseDirection;
                } else if ('wheelViewModeNavigationInverseDirection' in this.element.data()) {
                  this.wheelViewModeNavigationInverseDirection = this.element.data('view-mode-wheel-navigation-inverse-dir');
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 10 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 131..135
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 138..142
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 146..150
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 154..158
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 169..173
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 176..180
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 185..189
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 193..197
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 237..241
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 244..248

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

                if ('viewSelect' in options) {
                  this.viewSelect = options.viewSelect;
                } else if ('viewSelect' in this.element.data()) {
                  this.viewSelect = this.element.data('view-select');
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datetimepicker.js and 10 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 131..135
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 138..142
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 146..150
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 154..158
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 162..166
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 169..173
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 176..180
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 193..197
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 237..241
            app/assets/javascripts/bootstrap-datetimepicker.js on lines 244..248

            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

            Severity
            Category
            Status
            Source
            Language