public/js/moment.js
File moment.js
has 2689 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
//! moment.js
//! version : 2.11.2
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
Consider simplifying this complex logical expression. Open
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 :
Function create__createDuration
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function create__createDuration (input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
Function configFromStringAndFormat
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function configFromISO
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function configFromISO(config) {
var i, l,
string = config._i,
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
allowTime, dateFormat, timeFormat, tzFormat;
Function copyConfig
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function copyConfig(to, from) {
var i, prop, val;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
Function dayOfYearFromWeekInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function configFromArray
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function configFromArray (config) {
var i, date, input = [], currentDate, yearToUse;
if (config._d) {
return;
Consider simplifying this complex logical expression. Open
Open
if (m._isValid == null) {
var flags = getParsingFlags(m);
m._isValid = !isNaN(m._d.getTime()) &&
flags.overflow < 0 &&
!flags.empty &&
Function getSetOffset
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getSetOffset (input, keepLocalTime) {
var offset = this._offset || 0,
localAdjust;
if (!this.isValid()) {
return input != null ? this : NaN;
Function configFromStringAndArray
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function configFromStringAndArray(config) {
var tempConfig,
bestMoment,
scoreToBeat,
Function iso_string__toISOString
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function diff
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function diff (input, units, asFloat) {
var that,
zoneDelta,
delta, output;
Function bubble
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bubble () {
var milliseconds = this._milliseconds;
var days = this._days;
var months = this._months;
var data = this._data;
Function startOf
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function startOf (units) {
units = normalizeUnits(units);
// the following switch intentionally omits break keywords
// to utilize falling through the cases.
switch (units) {
Function localeWeekdaysParse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function localeWeekdaysParse (weekdayName, format, strict) {
var i, mom, regex;
if (!this._weekdaysParse) {
this._weekdaysParse = [];
Function createDate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createDate (y, m, d, h, M, s, ms) {
Consider simplifying this complex logical expression. Open
Open
if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0))) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
Function list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function list (format, index, field, count, setter) {
Function dayOfYearFromWeeks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
Function setWeekAll
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function setWeekAll(weekYear, week, weekday, dow, doy) {
Function getSetWeekYearHelper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
Function createLocalOrUTC
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createLocalOrUTC (input, format, locale, strict, isUTC) {
Function substituteTimeAgo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
TODO found Open
Open
// TODO: Find a better way to register and load all the locales in Node
- Exclude checks
TODO found Open
Open
// TODO: Another silent failure?
- Exclude checks
TODO found Open
Open
// TODO: Move this out of here!
- Exclude checks
TODO found Open
Open
// TODO: Move this to another part of the creation flow to prevent circular deps
- Exclude checks
TODO found Open
Open
// TODO: remove 'name' arg after deprecation is removed
- Exclude checks
TODO found Open
Open
// TODO: Use this.as('ms')?
- Exclude checks
TODO found Open
Open
// TODO: We need to take the current isoWeekYear, but that depends on
- Exclude checks
TODO found Open
Open
// TODO: Use [].sort instead?
- Exclude checks