savonarola/pulse_meter_visualizer

View on GitHub

Showing 37 of 114 total issues

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

    Avoid deeply nested control flow statements.
    Open

                            if (this.second <= this._defaults.secondMin){
                                this.second = this._defaults.secondMin;
                                this._defaults.millisecMin = minDateTime.getMilliseconds();
                            }
                            else {
    Severity: Major
    Found in lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (v) {
                                  partial.push(quote(k) + (gap ? ': ' : ':') + v);
                              }
      Severity: Major
      Found in lib/pulse_meter/visualize/public/js/json2.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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (v) {
                                      partial.push(quote(k) + (gap ? ': ' : ':') + v);
                                  }
          Severity: Major
          Found in lib/pulse_meter/visualize/public/js/json2.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 lib/pulse_meter/visualize/public/js/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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            } else if (aph == 12) { h = 12; }
                                            else { h = aph + 12; }
                Severity: Major
                Found in lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (v !== undefined) {
                                                  value[k] = v;
                                              } else {
                                                  delete value[k];
                                              }
                  Severity: Major
                  Found in lib/pulse_meter/visualize/public/js/json2.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 lib/pulse_meter/visualize/public/js/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 lib/pulse_meter/visualize/public/js/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 lib/pulse_meter/visualize/public/js/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 lib/pulse_meter/visualize/public/js/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 lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 35 mins to fix

                              Function humanize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Number.prototype.humanize = function() {
                                var d, h, interval, m, res, s;
                                interval = this;
                                res = "";
                                s = interval % 60;
                              Severity: Minor
                              Found in lib/pulse_meter/visualize/public/js/application.js - About 35 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Avoid too many return statements within this function.
                              Open

                                          return true;
                              Severity: Major
                              Found in lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js - About 30 mins to fix

                                Method get_interval_borders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def get_interval_borders(options)
                                          from = if options[:start_time] && (options[:start_time] > 0)
                                            Time.at options[:start_time]
                                          else
                                            tspan = options[:timespan] || timespan
                                Severity: Minor
                                Found in lib/pulse_meter/visualize/widgets/timeline.rb - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Severity
                                Category
                                Status
                                Source
                                Language