wikimedia/mediawiki-core

View on GitHub
resources/lib/moment/moment.js

Summary

Maintainability
F
1 mo
Test Coverage

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

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

    Consider simplifying this complex logical expression.
    Open

            if (m._isValid == null) {
                var flags = getParsingFlags(m),
                    parsedParts = some.call(flags.parsedDateParts, function (i) {
                        return i != null;
                    }),
    Severity: Critical
    Found in resources/lib/moment/moment.js - About 3 hrs to fix

      Function configFromStringAndFormat has 71 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 === hooks.ISO_8601) {
                  configFromISO(config);
                  return;
      Severity: Major
      Found in resources/lib/moment/moment.js - About 2 hrs to fix

        Function handleStrictParse$1 has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function handleStrictParse$1(weekdayName, format, strict) {
                var i,
                    ii,
                    mom,
                    llc = weekdayName.toLocaleLowerCase();
        Severity: Major
        Found in resources/lib/moment/moment.js - About 2 hrs 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])
          Severity: Critical
          Found in resources/lib/moment/moment.js - About 2 hrs to fix

            Function endOf has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function endOf(units) {
                    var time, startOfDate;
                    units = normalizeUnits(units);
                    if (units === undefined || units === 'millisecond' || !this.isValid()) {
                        return this;
            Severity: Major
            Found in resources/lib/moment/moment.js - About 2 hrs to fix

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

                  function configFromArray(config) {
                      var i,
                          date,
                          input = [],
                          currentDate,
              Severity: Major
              Found in resources/lib/moment/moment.js - About 2 hrs to fix

                Function createDuration has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

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

                      function localeWeekdaysParse(weekdayName, format, strict) {
                          var i, mom, regex;
                  
                          if (this._weekdaysParseExact) {
                              return handleStrictParse$1.call(this, weekdayName, format, strict);
                  Severity: Major
                  Found in resources/lib/moment/moment.js - About 2 hrs to fix

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

                        function startOf(units) {
                            var time, startOfDate;
                            units = normalizeUnits(units);
                            if (units === undefined || units === 'millisecond' || !this.isValid()) {
                                return this;
                    Severity: Major
                    Found in resources/lib/moment/moment.js - About 2 hrs to fix

                      Function configFromISO has 50 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),
                      Severity: Minor
                      Found in resources/lib/moment/moment.js - About 2 hrs to fix

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

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

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

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

                            Function defineLocale has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function defineLocale(name, config) {
                                    if (config !== null) {
                                        var locale,
                                            parentConfig = baseConfig;
                                        config.abbr = name;
                            Severity: Minor
                            Found in resources/lib/moment/moment.js - About 1 hr to fix

                              Function computeWeekdaysParse has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function computeWeekdaysParse() {
                                      function cmpLenRev(a, b) {
                                          return b.length - a.length;
                                      }
                              
                              
                              Severity: Minor
                              Found in resources/lib/moment/moment.js - About 1 hr to fix

                                Function handleStrictParse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function handleStrictParse(monthName, format, strict) {
                                        var i,
                                            ii,
                                            mom,
                                            llc = monthName.toLocaleLowerCase();
                                Severity: Minor
                                Found in resources/lib/moment/moment.js - About 1 hr to fix

                                  Function localeMonthsParse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function localeMonthsParse(monthName, format, strict) {
                                          var i, mom, regex;
                                  
                                          if (this._monthsParseExact) {
                                              return handleStrictParse.call(this, monthName, format, strict);
                                  Severity: Minor
                                  Found in resources/lib/moment/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 resources/lib/moment/moment.js - About 1 hr to fix

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

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

                                        Function toISOString$1 has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function toISOString$1() {
                                                // 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 resources/lib/moment/moment.js - About 1 hr to fix

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

                                              function diff(input, units, asFloat) {
                                                  var that, zoneDelta, output;
                                          
                                                  if (!this.isValid()) {
                                                      return NaN;
                                          Severity: Minor
                                          Found in resources/lib/moment/moment.js - About 1 hr to fix

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

                                                function as(units) {
                                                    if (!this.isValid()) {
                                                        return NaN;
                                                    }
                                                    var days,
                                            Severity: Minor
                                            Found in resources/lib/moment/moment.js - About 1 hr to fix

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

                                                  function checkOverflow(m) {
                                                      var overflow,
                                                          a = m._a;
                                              
                                                      if (a && getParsingFlags(m).overflow === -2) {
                                              Severity: Minor
                                              Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                Function deprecate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    function deprecate(msg, fn) {
                                                        var firstTime = true;
                                                
                                                        return extend(function () {
                                                            if (hooks.deprecationHandler != null) {
                                                Severity: Minor
                                                Found in resources/lib/moment/moment.js - About 1 hr to fix

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

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

                                                    Function computeMonthsParse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        function computeMonthsParse() {
                                                            function cmpLenRev(a, b) {
                                                                return b.length - a.length;
                                                            }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                      Function isMomentInputObject has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          function isMomentInputObject(input) {
                                                              var objectTest = isObject(input) && !isObjectEmpty(input),
                                                                  propertyTest = false,
                                                                  properties = [
                                                                      'years',
                                                      Severity: Minor
                                                      Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                        Function localeErasParse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            function localeErasParse(eraName, format, strict) {
                                                                var i,
                                                                    l,
                                                                    eras = this.eras(),
                                                                    name,
                                                        Severity: Minor
                                                        Found in resources/lib/moment/moment.js - About 1 hr to fix

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

                                                              function updateLocale(name, config) {
                                                                  if (config != null) {
                                                                      var locale,
                                                                          tmpLocale,
                                                                          parentConfig = baseConfig;
                                                          Severity: Minor
                                                          Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                            Function isValid has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                function isValid(m) {
                                                                    if (m._isValid == null) {
                                                                        var flags = getParsingFlags(m),
                                                                            parsedParts = some.call(flags.parsedDateParts, function (i) {
                                                                                return i != null;
                                                            Severity: Minor
                                                            Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                              Function relativeTime$1 has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                  function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
                                                                      var duration = createDuration(posNegDuration).abs(),
                                                                          seconds = round(duration.as('s')),
                                                                          minutes = round(duration.as('m')),
                                                                          hours = round(duration.as('h')),
                                                              Severity: Minor
                                                              Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                                Function listWeekdaysImpl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                    function listWeekdaysImpl(localeSorted, format, index, field) {
                                                                        if (typeof localeSorted === 'boolean') {
                                                                            if (isNumber(format)) {
                                                                                index = format;
                                                                                format = undefined;
                                                                Severity: Minor
                                                                Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                                  Function chooseLocale has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                      function chooseLocale(names) {
                                                                          var i = 0,
                                                                              j,
                                                                              next,
                                                                              locale,
                                                                  Severity: Minor
                                                                  Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                                    Function toISOString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                        function toISOString(keepOffset) {
                                                                            if (!this.isValid()) {
                                                                                return null;
                                                                            }
                                                                            var utc = keepOffset !== true,
                                                                    Severity: Minor
                                                                    Found in resources/lib/moment/moment.js - About 1 hr to fix

                                                                      Function humanize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                          function humanize(argWithSuffix, argThresholds) {
                                                                              if (!this.isValid()) {
                                                                                  return this.localeData().invalidDate();
                                                                              }
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in resources/lib/moment/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 resources/lib/moment/moment.js - About 50 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                      if (hasOwnProp(arguments[0], key)) {
                                                                                                          arg += key + ': ' + arguments[0][key] + ', ';
                                                                                                      }
                                                                          Severity: Major
                                                                          Found in resources/lib/moment/moment.js - About 45 mins to fix

                                                                            Function extractFromRFC2822Strings has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                    yearStr,
                                                                                    monthStr,
                                                                                    dayStr,
                                                                                    hourStr,
                                                                                    minuteStr,
                                                                            Severity: Minor
                                                                            Found in resources/lib/moment/moment.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                      if (!localeFamilies[config.parentLocale]) {
                                                                                                          localeFamilies[config.parentLocale] = [];
                                                                                                      }
                                                                              Severity: Major
                                                                              Found in resources/lib/moment/moment.js - About 45 mins to fix

                                                                                Consider simplifying this complex logical expression.
                                                                                Open

                                                                                        if (
                                                                                            !(
                                                                                                (milliseconds >= 0 && days >= 0 && months >= 0) ||
                                                                                                (milliseconds <= 0 && days <= 0 && months <= 0)
                                                                                            )
                                                                                Severity: Major
                                                                                Found in resources/lib/moment/moment.js - About 40 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 resources/lib/moment/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 resources/lib/moment/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 resources/lib/moment/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 resources/lib/moment/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 resources/lib/moment/moment.js - About 35 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                            return ii !== -1 ? ii : null;
                                                                                            Severity: Major
                                                                                            Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                                  return ii;
                                                                                              Severity: Major
                                                                                              Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                    return ii;
                                                                                                Severity: Major
                                                                                                Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                                  return i;
                                                                                                  Severity: Major
                                                                                                  Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                            return formatMoment(
                                                                                                                m,
                                                                                                                utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
                                                                                                            );
                                                                                                    Severity: Major
                                                                                                    Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                                      return ii !== -1 ? ii : null;
                                                                                                      Severity: Major
                                                                                                      Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                        return ii !== -1 ? ii : null;
                                                                                                        Severity: Major
                                                                                                        Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                              return ii;
                                                                                                          Severity: Major
                                                                                                          Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                                return ii;
                                                                                                            Severity: Major
                                                                                                            Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                                  return ii;
                                                                                                              Severity: Major
                                                                                                              Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                return ii !== -1 ? ii : null;
                                                                                                                Severity: Major
                                                                                                                Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                                      return ii;
                                                                                                                  Severity: Major
                                                                                                                  Found in resources/lib/moment/moment.js - About 30 mins to fix

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function getEraNarrow() {
                                                                                                                            var i,
                                                                                                                                l,
                                                                                                                                val,
                                                                                                                                eras = this.localeData().eras();
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 2 other locations - About 7 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4402..4420
                                                                                                                    resources/lib/moment/moment.js on lines 4442..4460

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 189.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function getEraName() {
                                                                                                                            var i,
                                                                                                                                l,
                                                                                                                                val,
                                                                                                                                eras = this.localeData().eras();
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 2 other locations - About 7 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4422..4440
                                                                                                                    resources/lib/moment/moment.js on lines 4442..4460

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 189.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function getEraAbbr() {
                                                                                                                            var i,
                                                                                                                                l,
                                                                                                                                val,
                                                                                                                                eras = this.localeData().eras();
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 2 other locations - About 7 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4402..4420
                                                                                                                    resources/lib/moment/moment.js on lines 4422..4440

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 189.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function monthsShortRegex(isStrict) {
                                                                                                                            if (this._monthsParseExact) {
                                                                                                                                if (!hasOwnProp(this, '_monthsRegex')) {
                                                                                                                                    computeMonthsParse.call(this);
                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1149..1167
                                                                                                                    resources/lib/moment/moment.js on lines 1749..1767
                                                                                                                    resources/lib/moment/moment.js on lines 1769..1787
                                                                                                                    resources/lib/moment/moment.js on lines 1789..1807

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 124.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function monthsRegex(isStrict) {
                                                                                                                            if (this._monthsParseExact) {
                                                                                                                                if (!hasOwnProp(this, '_monthsRegex')) {
                                                                                                                                    computeMonthsParse.call(this);
                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1129..1147
                                                                                                                    resources/lib/moment/moment.js on lines 1749..1767
                                                                                                                    resources/lib/moment/moment.js on lines 1769..1787
                                                                                                                    resources/lib/moment/moment.js on lines 1789..1807

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 124.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function weekdaysMinRegex(isStrict) {
                                                                                                                            if (this._weekdaysParseExact) {
                                                                                                                                if (!hasOwnProp(this, '_weekdaysRegex')) {
                                                                                                                                    computeWeekdaysParse.call(this);
                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1129..1147
                                                                                                                    resources/lib/moment/moment.js on lines 1149..1167
                                                                                                                    resources/lib/moment/moment.js on lines 1749..1767
                                                                                                                    resources/lib/moment/moment.js on lines 1769..1787

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 124.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function weekdaysShortRegex(isStrict) {
                                                                                                                            if (this._weekdaysParseExact) {
                                                                                                                                if (!hasOwnProp(this, '_weekdaysRegex')) {
                                                                                                                                    computeWeekdaysParse.call(this);
                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1129..1147
                                                                                                                    resources/lib/moment/moment.js on lines 1149..1167
                                                                                                                    resources/lib/moment/moment.js on lines 1749..1767
                                                                                                                    resources/lib/moment/moment.js on lines 1789..1807

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 124.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function weekdaysRegex(isStrict) {
                                                                                                                            if (this._weekdaysParseExact) {
                                                                                                                                if (!hasOwnProp(this, '_weekdaysRegex')) {
                                                                                                                                    computeWeekdaysParse.call(this);
                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1129..1147
                                                                                                                    resources/lib/moment/moment.js on lines 1149..1167
                                                                                                                    resources/lib/moment/moment.js on lines 1769..1787
                                                                                                                    resources/lib/moment/moment.js on lines 1789..1807

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 124.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function from(time, withoutSuffix) {
                                                                                                                            if (
                                                                                                                                this.isValid() &&
                                                                                                                                ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
                                                                                                                            ) {
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3996..4007

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 122.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function to(time, withoutSuffix) {
                                                                                                                            if (
                                                                                                                                this.isValid() &&
                                                                                                                                ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
                                                                                                                            ) {
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 4 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3979..3990

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 122.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                if (format === 'dddd') {
                                                                                                                                    ii = indexOf.call(this._weekdaysParse, llc);
                                                                                                                                    if (ii !== -1) {
                                                                                                                                        return ii;
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 3 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1616..1638

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 111.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                } else if (format === 'ddd') {
                                                                                                                                    ii = indexOf.call(this._shortWeekdaysParse, llc);
                                                                                                                                    if (ii !== -1) {
                                                                                                                                        return ii;
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 3 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1605..1638

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 111.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                } else if (format === 'ddd') {
                                                                                                                                    ii = indexOf.call(this._shortWeekdaysParse, llc);
                                                                                                                                    return ii !== -1 ? ii : null;
                                                                                                                                } else {
                                                                                                                                    ii = indexOf.call(this._minWeekdaysParse, llc);
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1009..1015

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 85.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                if (format === 'MMM') {
                                                                                                                                    ii = indexOf.call(this._shortMonthsParse, llc);
                                                                                                                                    return ii !== -1 ? ii : null;
                                                                                                                                } else {
                                                                                                                                    ii = indexOf.call(this._longMonthsParse, llc);
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1597..1603

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 85.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
                                                                                                                            var month = config._locale.monthsParse(input, token, config._strict);
                                                                                                                            // if we didn't find a month name, mark the date as invalid.
                                                                                                                            if (month != null) {
                                                                                                                                array[MONTH] = month;
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1484..1492

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 80.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
                                                                                                                            var weekday = config._locale.weekdaysParse(input, token, config._strict);
                                                                                                                            // if we didn't get a weekday name, mark the date as invalid
                                                                                                                            if (weekday != null) {
                                                                                                                                week.d = weekday;
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 938..946

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 80.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        var prototypeMin = deprecate(
                                                                                                                                'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
                                                                                                                                function () {
                                                                                                                                    var other = createLocal.apply(null, arguments);
                                                                                                                                    if (this.isValid() && other.isValid()) {
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3042..3052

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 79.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            prototypeMax = deprecate(
                                                                                                                                'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
                                                                                                                                function () {
                                                                                                                                    var other = createLocal.apply(null, arguments);
                                                                                                                                    if (this.isValid() && other.isValid()) {
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3031..3041

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 79.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                } else {
                                                                                                                                    ii = indexOf.call(this._longMonthsParse, llc);
                                                                                                                                    if (ii !== -1) {
                                                                                                                                        return ii;
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1017..1024

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 74.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                if (format === 'MMM') {
                                                                                                                                    ii = indexOf.call(this._shortMonthsParse, llc);
                                                                                                                                    if (ii !== -1) {
                                                                                                                                        return ii;
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1024..1031

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 74.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                if (
                                                                                                                                    strict &&
                                                                                                                                    format === 'MMMM' &&
                                                                                                                                    this._longMonthsParse[i].test(monthName)
                                                                                                                                ) {
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1691..1705

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 72.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                } else if (
                                                                                                                                    strict &&
                                                                                                                                    format === 'ddd' &&
                                                                                                                                    this._shortWeekdaysParse[i].test(weekdayName)
                                                                                                                                ) {
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1070..1084

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 72.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        var baseConfig = {
                                                                                                                            calendar: defaultCalendar,
                                                                                                                            longDateFormat: defaultLongDateFormat,
                                                                                                                            invalidDate: defaultInvalidDate,
                                                                                                                            ordinal: defaultOrdinal,
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/codex/codex.js on lines 2614..2628

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 67.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function localeWeekdaysShort(m) {
                                                                                                                            return m === true
                                                                                                                                ? shiftWeekdays(this._weekdaysShort, this._week.dow)
                                                                                                                                : m
                                                                                                                                ? this._weekdaysShort[m.day()]
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1561..1567

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 64.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function localeWeekdaysMin(m) {
                                                                                                                            return m === true
                                                                                                                                ? shiftWeekdays(this._weekdaysMin, this._week.dow)
                                                                                                                                : m
                                                                                                                                ? this._weekdaysMin[m.day()]
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1553..1559

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 64.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            for (i = 0; i < properties.length; i += 1) {
                                                                                                                                property = properties[i];
                                                                                                                                propertyTest = propertyTest || hasOwnProp(input, property);
                                                                                                                            }
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 55 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3669..3672

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            for (i = 0; i < properties.length; i += 1) {
                                                                                                                                property = properties[i];
                                                                                                                                propertyTest = propertyTest || hasOwnProp(input, property);
                                                                                                                            }
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 55 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3703..3706

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            if (b - anchor < 0) {
                                                                                                                                anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
                                                                                                                                // linear across the month
                                                                                                                                adjust = (b - anchor) / (anchor - anchor2);
                                                                                                                            } else {
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 55 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3894..3898

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 53.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            } else {
                                                                                                                                anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
                                                                                                                                // linear across the month
                                                                                                                                adjust = (b - anchor) / (anchor2 - anchor);
                                                                                                                            }
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 55 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 3890..3894

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 53.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function erasAbbrRegex(isStrict) {
                                                                                                                            if (!hasOwnProp(this, '_erasAbbrRegex')) {
                                                                                                                                computeErasParse.call(this);
                                                                                                                            }
                                                                                                                            return isStrict ? this._erasAbbrRegex : this._erasRegex;
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 2 other locations - About 50 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4488..4493
                                                                                                                    resources/lib/moment/moment.js on lines 4502..4507

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 51.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function erasNameRegex(isStrict) {
                                                                                                                            if (!hasOwnProp(this, '_erasNameRegex')) {
                                                                                                                                computeErasParse.call(this);
                                                                                                                            }
                                                                                                                            return isStrict ? this._erasNameRegex : this._erasRegex;
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 2 other locations - About 50 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4495..4500
                                                                                                                    resources/lib/moment/moment.js on lines 4502..4507

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 51.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function erasNarrowRegex(isStrict) {
                                                                                                                            if (!hasOwnProp(this, '_erasNarrowRegex')) {
                                                                                                                                computeErasParse.call(this);
                                                                                                                            }
                                                                                                                            return isStrict ? this._erasNarrowRegex : this._erasRegex;
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 2 other locations - About 50 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4488..4493
                                                                                                                    resources/lib/moment/moment.js on lines 4495..4500

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 51.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function getWeeksInWeekYear() {
                                                                                                                            var weekInfo = this.localeData()._week;
                                                                                                                            return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
                                                                                                                        }
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 45 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4638..4641

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 50.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function getWeeksInYear() {
                                                                                                                            var weekInfo = this.localeData()._week;
                                                                                                                            return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
                                                                                                                        }
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 45 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4643..4646

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 50.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    this._longMonthsParse[i] = new RegExp(
                                                                                                                                        '^' + this.months(mom, '').replace('.', '') + '$',
                                                                                                                                        'i'
                                                                                                                                    );
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1059..1062
                                                                                                                    resources/lib/moment/moment.js on lines 1661..1664
                                                                                                                    resources/lib/moment/moment.js on lines 1665..1668
                                                                                                                    resources/lib/moment/moment.js on lines 1669..1672

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    this._shortMonthsParse[i] = new RegExp(
                                                                                                                                        '^' + this.monthsShort(mom, '').replace('.', '') + '$',
                                                                                                                                        'i'
                                                                                                                                    );
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1055..1058
                                                                                                                    resources/lib/moment/moment.js on lines 1661..1664
                                                                                                                    resources/lib/moment/moment.js on lines 1665..1668
                                                                                                                    resources/lib/moment/moment.js on lines 1669..1672

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    this._shortWeekdaysParse[i] = new RegExp(
                                                                                                                                        '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
                                                                                                                                        'i'
                                                                                                                                    );
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1055..1058
                                                                                                                    resources/lib/moment/moment.js on lines 1059..1062
                                                                                                                    resources/lib/moment/moment.js on lines 1661..1664
                                                                                                                    resources/lib/moment/moment.js on lines 1669..1672

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    this._minWeekdaysParse[i] = new RegExp(
                                                                                                                                        '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
                                                                                                                                        'i'
                                                                                                                                    );
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1055..1058
                                                                                                                    resources/lib/moment/moment.js on lines 1059..1062
                                                                                                                    resources/lib/moment/moment.js on lines 1661..1664
                                                                                                                    resources/lib/moment/moment.js on lines 1665..1668

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    this._fullWeekdaysParse[i] = new RegExp(
                                                                                                                                        '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
                                                                                                                                        'i'
                                                                                                                                    );
                                                                                                                    Severity: Major
                                                                                                                    Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1055..1058
                                                                                                                    resources/lib/moment/moment.js on lines 1059..1062
                                                                                                                    resources/lib/moment/moment.js on lines 1665..1668
                                                                                                                    resources/lib/moment/moment.js on lines 1669..1672

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        function isFunction(input) {
                                                                                                                            return (
                                                                                                                                (typeof Function !== 'undefined' && input instanceof Function) ||
                                                                                                                                Object.prototype.toString.call(input) === '[object Function]'
                                                                                                                            );
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 30 mins to fix
                                                                                                                    resources/lib/moment/locale/el.js on lines 14..19

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 45.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
                                                                                                                            input,
                                                                                                                            week,
                                                                                                                            config,
                                                                                                                            token
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 30 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 1397..1404

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 45.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                        addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
                                                                                                                            input,
                                                                                                                            week,
                                                                                                                            config,
                                                                                                                            token
                                                                                                                    Severity: Minor
                                                                                                                    Found in resources/lib/moment/moment.js and 1 other location - About 30 mins to fix
                                                                                                                    resources/lib/moment/moment.js on lines 4593..4600

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 45.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    There are no issues that match your filters.

                                                                                                                    Category
                                                                                                                    Status