resque/resque-web

View on GitHub

Showing 8 of 8 total issues

Function relativeDate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.relativeDate = function(opts){
        var defaults = {
            dateGetter: function(el){
                return $(el).text();
            }
Severity: Minor
Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

                if (distance_in_minutes < 86400) { return 'about 1 month ago'; }
    Severity: Major
    Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  if (distance_in_minutes < 43200) { return Math.floor(distance_in_minutes / 1440) + ' days ago'; }
      Severity: Major
      Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return 'over ' + Math.floor(distance_in_minutes / 525960) + ' years ago';
        Severity: Major
        Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      if (distance_in_minutes < 1051199) { return 'about 1 year ago'; }
          Severity: Major
          Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        if (distance_in_minutes < 525960) { return Math.floor(distance_in_minutes / 43200) + ' months ago'; }
            Severity: Major
            Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          if (distance_in_minutes < 2880) { return '1 day ago'; }
              Severity: Major
              Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            if (distance_in_minutes < 1440) { return 'about ' + Math.round(distance_in_minutes / 60) + ' hours ago'; }
                Severity: Major
                Found in app/assets/javascripts/resque_web/jquery.relative-date.js - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language