savonarola/pulse_meter_visualizer

View on GitHub

Showing 114 of 114 total issues

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

  $.fn.tooltip = function ( option ) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('tooltip')
        , options = typeof option == 'object' && option
Severity: Major
Found in lib/pulse_meter/visualize/public/js/bootstrap.js and 3 other locations - About 4 hrs to fix
lib/pulse_meter/visualize/public/js/bootstrap.js on lines 503..511
lib/pulse_meter/visualize/public/js/bootstrap.js on lines 1350..1358
lib/pulse_meter/visualize/public/js/bootstrap.js on lines 1803..1811

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

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 _limitMinMaxDateTime has 103 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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 4 hrs to fix

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

      $.fn.dropdown = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('dropdown')
          if (!data) $this.data('dropdown', (data = new Dropdown(this)))
    Severity: Major
    Found in lib/pulse_meter/visualize/public/js/bootstrap.js and 1 other location - About 3 hrs to fix
    lib/pulse_meter/visualize/public/js/bootstrap.js on lines 1109..1116

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

    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

      $.fn.alert = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('alert')
          if (!data) $this.data('alert', (data = new Alert(this)))
    Severity: Major
    Found in lib/pulse_meter/visualize/public/js/bootstrap.js and 1 other location - About 3 hrs to fix
    lib/pulse_meter/visualize/public/js/bootstrap.js on lines 357..364

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

    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++;
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 365..374
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 383..392

    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++;
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 347..356
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 383..392

    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.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++;
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 347..356
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 365..374

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

                this.second_slider = $tp.find('.ui_tpicker_second_slider').slider({
                    orientation: "horizontal",
                    value: this.second,
                    min: o.secondMin,
                    max: secMax,
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 452..462

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

    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_slider').slider({
                    orientation: "horizontal",
                    value: this.millisec,
                    min: o.millisecMin,
                    max: millisecMax,
    lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 440..450

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

    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 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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 3 hrs to fix

      Function _newInst has 82 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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 3 hrs to fix

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

          , getContent: function () {
              var content
                , $e = this.$element
                , o = this.options
        
        
        Severity: Major
        Found in lib/pulse_meter/visualize/public/js/bootstrap.js and 1 other location - About 2 hrs to fix
        lib/pulse_meter/visualize/public/js/bootstrap.js on lines 873..882

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

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

            function str(key, holder) {
        
        // Produce a string from holder[key].
        
                var i,          // The loop counter.
        Severity: Major
        Found in lib/pulse_meter/visualize/public/js/json2.js - About 2 hrs to fix

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

            , getTitle: function () {
                var title
                  , $e = this.$element
                  , o = this.options
          
          
          Severity: Major
          Found in lib/pulse_meter/visualize/public/js/bootstrap.js and 1 other location - About 2 hrs to fix
          lib/pulse_meter/visualize/public/js/bootstrap.js on lines 996..1005

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

          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 (tp_inst) {
                          if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
                              try {
                                  $.datepicker._updateDatepicker(inst);
                              }
          lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 1222..1231

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

          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

            initDatePickers: function() {
              this.$el.find(".datepicker").each(function(i) {
                return $(this).datetimepicker({
                  showOtherMonths: true,
                  selectOtherMonths: true
          Severity: Major
          Found in lib/pulse_meter/visualize/public/js/application.js and 1 other location - About 2 hrs to fix
          lib/pulse_meter/visualize/public/js/application.js on lines 632..640

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

          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

            initDatePickers: function() {
              this.$el.find(".datepicker").each(function(i) {
                return $(this).datetimepicker({
                  showOtherMonths: true,
                  selectOtherMonths: true
          Severity: Major
          Found in lib/pulse_meter/visualize/public/js/application.js and 1 other location - About 2 hrs to fix
          lib/pulse_meter/visualize/public/js/application.js on lines 859..867

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

          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 (tp_inst) {
                  if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
                      try {
                          $.datepicker._updateDatepicker(inst);
                      }
          lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js on lines 891..900

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

          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 Timepicker has 65 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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 2 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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language