zk/src/main/resources/web/js/zk/ext/moment.js

Summary

Maintainability
F
1 mo
Test Coverage

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

//! moment.js
//! version : 2.29.4
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
Severity: Major
Found in zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 3 hrs to fix

      Function configFromStringAndFormat has 73 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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 2 hrs to fix

                      Function configFromISO has 52 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: Major
                      Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 2 hrs to fix

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

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

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

                              function copyConfig(to, from) {
                                  var i,
                                      prop,
                                      val,
                                      momentPropertiesLen = momentProperties.length;
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                                            Function deprecate has 37 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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                                                  Function isMomentInputObject has 36 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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

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

                                                                        function isDurationValid(m) {
                                                                            var key,
                                                                                unitHasDecimal = false,
                                                                                i,
                                                                                orderLen = ordering.length;
                                                                    Severity: Minor
                                                                    Found in zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 50 mins to fix

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

                                                                                    yearStr,
                                                                                    monthStr,
                                                                                    dayStr,
                                                                                    hourStr,
                                                                                    minuteStr,
                                                                            Severity: Minor
                                                                            Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                          if (hasOwnProp(arguments[0], key)) {
                                                                                                              arg += key + ': ' + arguments[0][key] + ', ';
                                                                                                          }
                                                                              Severity: Major
                                                                              Found in zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                                      return ii;
                                                                                                  Severity: Major
                                                                                                  Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                                        return ii;
                                                                                                    Severity: Major
                                                                                                    Found in zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                              return ii;
                                                                                                          Severity: Major
                                                                                                          Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                                return ii;
                                                                                                            Severity: Major
                                                                                                            Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                                  return ii;
                                                                                                              Severity: Major
                                                                                                              Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                    return ii;
                                                                                                                Severity: Major
                                                                                                                Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                                  return i;
                                                                                                                  Severity: Major
                                                                                                                  Found in zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js - About 30 mins to fix

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 2 other locations - About 1 day to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4419..4437
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4439..4457

                                                                                                                      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 196.

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 2 other locations - About 1 day to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4439..4457
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4459..4477

                                                                                                                      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 196.

                                                                                                                      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 getEraNarrow() {
                                                                                                                              var i,
                                                                                                                                  l,
                                                                                                                                  val,
                                                                                                                                  eras = this.localeData().eras();
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 2 other locations - About 1 day to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4419..4437
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4459..4477

                                                                                                                      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 196.

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1136..1154
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1753..1771
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1773..1791
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1793..1811

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1136..1154
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1156..1174
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1773..1791
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1793..1811

                                                                                                                      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 monthsShortRegex(isStrict) {
                                                                                                                              if (this._monthsParseExact) {
                                                                                                                                  if (!hasOwnProp(this, '_monthsRegex')) {
                                                                                                                                      computeMonthsParse.call(this);
                                                                                                                                  }
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1156..1174
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1753..1771
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1773..1791
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1793..1811

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1136..1154
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1156..1174
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1753..1771
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1793..1811

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1136..1154
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1156..1174
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1753..1771
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1773..1791

                                                                                                                      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 to(time, withoutSuffix) {
                                                                                                                              if (
                                                                                                                                  this.isValid() &&
                                                                                                                                  ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
                                                                                                                              ) {
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 3998..4009

                                                                                                                      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 from(time, withoutSuffix) {
                                                                                                                              if (
                                                                                                                                  this.isValid() &&
                                                                                                                                  ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
                                                                                                                              ) {
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 4 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4015..4026

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 3 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1620..1642

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 3 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1609..1642

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1016..1022

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1601..1607

                                                                                                                      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

                                                                                                                          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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 945..953

                                                                                                                      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

                                                                                                                          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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1489..1497

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 3055..3065

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 2 hrs to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 3044..3054

                                                                                                                      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

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

                                                                                                                      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

                                                                                                                                  } else {
                                                                                                                                      ii = indexOf.call(this._longMonthsParse, llc);
                                                                                                                                      if (ii !== -1) {
                                                                                                                                          return ii;
                                                                                                                                      }
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 1 hr to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/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

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

                                                                                                                      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

                                                                                                                                  if (
                                                                                                                                      strict &&
                                                                                                                                      format === 'MMMM' &&
                                                                                                                                      this._longMonthsParse[i].test(monthName)
                                                                                                                                  ) {
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 1 hr to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1695..1709

                                                                                                                      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

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

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 1 hr to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1557..1563

                                                                                                                      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

                                                                                                                              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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 55 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 3913..3917

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 55 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 3909..3913

                                                                                                                      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 erasNameRegex(isStrict) {
                                                                                                                              if (!hasOwnProp(this, '_erasNameRegex')) {
                                                                                                                                  computeErasParse.call(this);
                                                                                                                              }
                                                                                                                              return isStrict ? this._erasNameRegex : this._erasRegex;
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 2 other locations - About 50 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4512..4517
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4519..4524

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 2 other locations - About 50 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4505..4510
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4512..4517

                                                                                                                      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 erasAbbrRegex(isStrict) {
                                                                                                                              if (!hasOwnProp(this, '_erasAbbrRegex')) {
                                                                                                                                  computeErasParse.call(this);
                                                                                                                              }
                                                                                                                              return isStrict ? this._erasAbbrRegex : this._erasRegex;
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 2 other locations - About 50 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4505..4510
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4519..4524

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 45 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4653..4656

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 45 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4658..4661

                                                                                                                      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._fullWeekdaysParse[i] = new RegExp(
                                                                                                                                          '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
                                                                                                                                          'i'
                                                                                                                                      );
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1062..1065
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1066..1069
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1669..1672
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1673..1676

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1062..1065
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1665..1668
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1669..1672
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1673..1676

                                                                                                                      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._longMonthsParse[i] = new RegExp(
                                                                                                                                          '^' + this.months(mom, '').replace('.', '') + '$',
                                                                                                                                          'i'
                                                                                                                                      );
                                                                                                                      Severity: Major
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1066..1069
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1665..1668
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1669..1672
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1673..1676

                                                                                                                      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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1062..1065
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1066..1069
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1665..1668
                                                                                                                      zk/src/main/resources/web/js/zk/ext/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 zk/src/main/resources/web/js/zk/ext/moment.js and 4 other locations - About 35 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1062..1065
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1066..1069
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1665..1668
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1673..1676

                                                                                                                      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

                                                                                                                          addWeekParseToken(
                                                                                                                              ['w', 'ww', 'W', 'WW'],
                                                                                                                              function (input, week, config, token) {
                                                                                                                                  week[token.substr(0, 1)] = toInt(input);
                                                                                                                              }
                                                                                                                      Severity: Minor
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 30 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 4610..4615

                                                                                                                      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) {
                                                                                                                                  week[token.substr(0, 2)] = toInt(input);
                                                                                                                              }
                                                                                                                      Severity: Minor
                                                                                                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 30 mins to fix
                                                                                                                      zk/src/main/resources/web/js/zk/ext/moment.js on lines 1404..1409

                                                                                                                      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