tadyjp/rendezvous

View on GitHub
app/assets/javascripts/lib/odometer.js

Summary

Maintainability
D
2 days
Test Coverage

File odometer.js has 575 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  var COUNT_FRAMERATE, COUNT_MS_PER_FRAME, DIGIT_FORMAT, DIGIT_HTML, DIGIT_SPEEDBOOST, DURATION, FORMAT_MARK_HTML, FORMAT_PARSER, FRAMERATE, FRAMES_PER_VALUE, MS_PER_FRAME, MutationObserver, Odometer, RIBBON_HTML, TRANSITION_END_EVENTS, TRANSITION_SUPPORT, VALUE_HTML, addClass, createFromHTML, fractionalPart, now, removeClass, requestAnimationFrame, round, transitionCheckStyles, trigger, truncate, wrapJQuery, _jQueryWrapped, _old, _ref, _ref1,
    __slice = [].slice;

  VALUE_HTML = '<span class="odometer-value"></span>';
Severity: Major
Found in app/assets/javascripts/lib/odometer.js - About 1 day to fix

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

        Odometer.prototype.animateSlide = function(newValue) {
          var boosted, cur, diff, digitCount, digits, dist, end, fractionalCount, frame, frames, i, incr, j, mark, numEl, oldValue, start, _base, _i, _j, _k, _l, _len, _len1, _len2, _m, _ref, _results;
          oldValue = this.value;
          fractionalCount = this.getFractionalDigitCount(oldValue, newValue);
          if (fractionalCount) {
    Severity: Major
    Found in app/assets/javascripts/lib/odometer.js - About 3 hrs to fix

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

          function Odometer(options) {
            var e, k, property, v, _base, _i, _len, _ref, _ref1, _ref2,
              _this = this;
            this.options = options;
            this.el = this.options.el;
      Severity: Minor
      Found in app/assets/javascripts/lib/odometer.js - About 2 hrs to fix

        Function render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Odometer.prototype.render = function(value) {
              var classes, cls, digit, match, newClasses, theme, wholePart, _i, _j, _len, _len1, _ref;
              if (value == null) {
                value = this.value;
              }
        Severity: Minor
        Found in app/assets/javascripts/lib/odometer.js - About 1 hr to fix

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

              Odometer.prototype.addDigit = function(value, repeating) {
                var chr, digit, resetted, _ref;
                if (repeating == null) {
                  repeating = true;
                }
          Severity: Minor
          Found in app/assets/javascripts/lib/odometer.js - About 1 hr to fix

            Function animateCount has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Odometer.prototype.animateCount = function(newValue) {
                  var cur, diff, last, start, tick,
                    _this = this;
                  if (!(diff = +newValue - this.value)) {
                    return;
            Severity: Minor
            Found in app/assets/javascripts/lib/odometer.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status