alientronics/fleetany-web

View on GitHub
public/js/moment.js

Summary

Maintainability
F
1 wk
Test Coverage

File moment.js has 2689 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//! moment.js
//! version : 2.11.2
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
Severity: Major
Found in public/js/moment.js - About 1 wk to fix

    Consider simplifying this complex logical expression.
    Open

            if (a && getParsingFlags(m).overflow === -2) {
                overflow =
                    a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :
                    a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
                    a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
    Severity: Critical
    Found in public/js/moment.js - About 2 hrs to fix

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

          function create__createDuration (input, key) {
              var duration = input,
                  // matching against regexp is expensive, do it on demand
                  match = null,
                  sign,
      Severity: Major
      Found in public/js/moment.js - About 2 hrs to fix

        Function configFromStringAndFormat has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function configFromStringAndFormat(config) {
                // TODO: Move this to another part of the creation flow to prevent circular deps
                if (config._f === utils_hooks__hooks.ISO_8601) {
                    configFromISO(config);
                    return;
        Severity: Minor
        Found in public/js/moment.js - About 1 hr to fix

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

              function configFromISO(config) {
                  var i, l,
                      string = config._i,
                      match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
                      allowTime, dateFormat, timeFormat, tzFormat;
          Severity: Minor
          Found in public/js/moment.js - About 1 hr to fix

            Function copyConfig has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function copyConfig(to, from) {
                    var i, prop, val;
            
                    if (!isUndefined(from._isAMomentObject)) {
                        to._isAMomentObject = from._isAMomentObject;
            Severity: Minor
            Found in public/js/moment.js - About 1 hr to fix

              Function dayOfYearFromWeekInfo has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function dayOfYearFromWeekInfo(config) {
                      var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
              
                      w = config._w;
                      if (w.GG != null || w.W != null || w.E != null) {
              Severity: Minor
              Found in public/js/moment.js - About 1 hr to fix

                Function configFromArray has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function configFromArray (config) {
                        var i, date, input = [], currentDate, yearToUse;
                
                        if (config._d) {
                            return;
                Severity: Minor
                Found in public/js/moment.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (m._isValid == null) {
                              var flags = getParsingFlags(m);
                              m._isValid = !isNaN(m._d.getTime()) &&
                                  flags.overflow < 0 &&
                                  !flags.empty &&
                  Severity: Critical
                  Found in public/js/moment.js - About 1 hr to fix

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

                        function getSetOffset (input, keepLocalTime) {
                            var offset = this._offset || 0,
                                localAdjust;
                            if (!this.isValid()) {
                                return input != null ? this : NaN;
                    Severity: Minor
                    Found in public/js/moment.js - About 1 hr to fix

                      Function configFromStringAndArray has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function configFromStringAndArray(config) {
                              var tempConfig,
                                  bestMoment,
                      
                                  scoreToBeat,
                      Severity: Minor
                      Found in public/js/moment.js - About 1 hr to fix

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

                            function iso_string__toISOString() {
                                // for ISO strings we do not use the normal bubbling rules:
                                //  * milliseconds bubble up until they become hours
                                //  * days do not bubble at all
                                //  * months bubble up until they become years
                        Severity: Minor
                        Found in public/js/moment.js - About 1 hr to fix

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

                              function diff (input, units, asFloat) {
                                  var that,
                                      zoneDelta,
                                      delta, output;
                          
                          
                          Severity: Minor
                          Found in public/js/moment.js - About 1 hr to fix

                            Function bubble has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function bubble () {
                                    var milliseconds = this._milliseconds;
                                    var days         = this._days;
                                    var months       = this._months;
                                    var data         = this._data;
                            Severity: Minor
                            Found in public/js/moment.js - About 1 hr to fix

                              Function startOf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function startOf (units) {
                                      units = normalizeUnits(units);
                                      // the following switch intentionally omits break keywords
                                      // to utilize falling through the cases.
                                      switch (units) {
                              Severity: Minor
                              Found in public/js/moment.js - About 1 hr to fix

                                Function localeWeekdaysParse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function localeWeekdaysParse (weekdayName, format, strict) {
                                        var i, mom, regex;
                                
                                        if (!this._weekdaysParse) {
                                            this._weekdaysParse = [];
                                Severity: Minor
                                Found in public/js/moment.js - About 1 hr to fix

                                  Function createDate has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      function createDate (y, m, d, h, M, s, ms) {
                                  Severity: Major
                                  Found in public/js/moment.js - About 50 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
                                                    (milliseconds <= 0 && days <= 0 && months <= 0))) {
                                                milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
                                                days = 0;
                                                months = 0;
                                    Severity: Major
                                    Found in public/js/moment.js - About 40 mins to fix

                                      Function list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          function list (format, index, field, count, setter) {
                                      Severity: Minor
                                      Found in public/js/moment.js - About 35 mins to fix

                                        Function dayOfYearFromWeeks has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
                                        Severity: Minor
                                        Found in public/js/moment.js - About 35 mins to fix

                                          Function setWeekAll has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              function setWeekAll(weekYear, week, weekday, dow, doy) {
                                          Severity: Minor
                                          Found in public/js/moment.js - About 35 mins to fix

                                            Function getSetWeekYearHelper has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                function getSetWeekYearHelper(input, week, weekday, dow, doy) {
                                            Severity: Minor
                                            Found in public/js/moment.js - About 35 mins to fix

                                              Function createLocalOrUTC has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  function createLocalOrUTC (input, format, locale, strict, isUTC) {
                                              Severity: Minor
                                              Found in public/js/moment.js - About 35 mins to fix

                                                Function substituteTimeAgo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
                                                Severity: Minor
                                                Found in public/js/moment.js - About 35 mins to fix

                                                  TODO found
                                                  Open

                                                          // TODO: Find a better way to register and load all the locales in Node
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                              // TODO: Another silent failure?
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                          // TODO: Move this out of here!
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                          // TODO: Move this to another part of the creation flow to prevent circular deps
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                      // TODO: remove 'name' arg after deprecation is removed
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                      // TODO: Use this.as('ms')?
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                              // TODO: We need to take the current isoWeekYear, but that depends on
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  TODO found
                                                  Open

                                                      // TODO: Use [].sort instead?
                                                  Severity: Minor
                                                  Found in public/js/moment.js by fixme

                                                  There are no issues that match your filters.

                                                  Category
                                                  Status