bronycub/sugarcub

View on GitHub
core/static/vendor/moment/src/lib/units/day-of-week.js

Summary

Maintainability
F
1 wk
Test Coverage

Function handleStrictParse has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

function handleStrictParse(weekdayName, format, strict) {
    var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
    if (!this._weekdaysParse) {
        this._weekdaysParse = [];
        this._shortWeekdaysParse = [];
Severity: Minor
Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 7 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File day-of-week.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { addFormatToken } from '../format/format';
import { addUnitAlias } from './aliases';
import { addUnitPriority } from './priorities';
import { addRegexToken, match1to2, matchWord, regexEscape } from '../parse/regex';
import { addWeekParseToken } from '../parse/token';
Severity: Minor
Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 3 hrs to fix

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

    function handleStrictParse(weekdayName, format, strict) {
        var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
        if (!this._weekdaysParse) {
            this._weekdaysParse = [];
            this._shortWeekdaysParse = [];
    Severity: Major
    Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 2 hrs to fix

      Function localeWeekdaysParse has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      export function localeWeekdaysParse (weekdayName, format, strict) {
          var i, mom, regex;
      
          if (this._weekdaysParseExact) {
              return handleStrictParse.call(this, weekdayName, format, strict);
      Severity: Minor
      Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function weekdaysRegex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      export function weekdaysRegex (isStrict) {
          if (this._weekdaysParseExact) {
              if (!hasOwnProp(this, '_weekdaysRegex')) {
                  computeWeekdaysParse.call(this);
              }
      Severity: Minor
      Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      function computeWeekdaysParse () {
          function cmpLenRev(a, b) {
              return b.length - a.length;
          }
      
      
      Severity: Minor
      Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr to fix

        Function weekdaysMinRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export function weekdaysMinRegex (isStrict) {
            if (this._weekdaysParseExact) {
                if (!hasOwnProp(this, '_weekdaysRegex')) {
                    computeWeekdaysParse.call(this);
                }
        Severity: Minor
        Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function weekdaysShortRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export function weekdaysShortRegex (isStrict) {
            if (this._weekdaysParseExact) {
                if (!hasOwnProp(this, '_weekdaysRegex')) {
                    computeWeekdaysParse.call(this);
                }
        Severity: Minor
        Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        export function localeWeekdaysParse (weekdayName, format, strict) {
            var i, mom, regex;
        
            if (this._weekdaysParseExact) {
                return handleStrictParse.call(this, weekdayName, format, strict);
        Severity: Minor
        Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr to fix

          Function getSetISODayOfWeek has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export function getSetISODayOfWeek (input) {
              if (!this.isValid()) {
                  return input != null ? this : NaN;
              }
          
          
          Severity: Minor
          Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Avoid too many return statements within this function.
          Open

                          return ii;
          Severity: Major
          Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return ii;
            Severity: Major
            Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return i;
              Severity: Major
              Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return ii !== -1 ? ii : null;
                Severity: Major
                Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return ii !== -1 ? ii : null;
                  Severity: Major
                  Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return ii;
                    Severity: Major
                    Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return ii;
                      Severity: Major
                      Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return ii;
                        Severity: Major
                        Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return ii !== -1 ? ii : null;
                          Severity: Major
                          Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 30 mins to fix

                            Function getSetDayOfWeek has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function getSetDayOfWeek (input) {
                                if (!this.isValid()) {
                                    return input != null ? this : NaN;
                                }
                                var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
                            Severity: Minor
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

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

                            function handleStrictParse(weekdayName, format, strict) {
                                var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
                                if (!this._weekdaysParse) {
                                    this._weekdaysParse = [];
                                    this._shortWeekdaysParse = [];
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 4 days to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1368..1430
                            core/static/vendor/moment/moment.js on lines 1374..1436

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

                            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

                            export function weekdaysShortRegex (isStrict) {
                                if (this._weekdaysParseExact) {
                                    if (!hasOwnProp(this, '_weekdaysRegex')) {
                                        computeWeekdaysParse.call(this);
                                    }
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 4 other locations - About 4 hrs to fix
                            core/static/vendor/moment/src/lib/units/day-of-week.js on lines 264..281
                            core/static/vendor/moment/src/lib/units/day-of-week.js on lines 304..321
                            core/static/vendor/moment/src/lib/units/month.js on lines 210..227
                            core/static/vendor/moment/src/lib/units/month.js on lines 230..247

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

                            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

                            export function weekdaysMinRegex (isStrict) {
                                if (this._weekdaysParseExact) {
                                    if (!hasOwnProp(this, '_weekdaysRegex')) {
                                        computeWeekdaysParse.call(this);
                                    }
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 4 other locations - About 4 hrs to fix
                            core/static/vendor/moment/src/lib/units/day-of-week.js on lines 264..281
                            core/static/vendor/moment/src/lib/units/day-of-week.js on lines 284..301
                            core/static/vendor/moment/src/lib/units/month.js on lines 210..227
                            core/static/vendor/moment/src/lib/units/month.js on lines 230..247

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

                            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

                            export function weekdaysRegex (isStrict) {
                                if (this._weekdaysParseExact) {
                                    if (!hasOwnProp(this, '_weekdaysRegex')) {
                                        computeWeekdaysParse.call(this);
                                    }
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 4 other locations - About 4 hrs to fix
                            core/static/vendor/moment/src/lib/units/day-of-week.js on lines 284..301
                            core/static/vendor/moment/src/lib/units/day-of-week.js on lines 304..321
                            core/static/vendor/moment/src/lib/units/month.js on lines 210..227
                            core/static/vendor/moment/src/lib/units/month.js on lines 230..247

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                            export function getSetISODayOfWeek (input) {
                                if (!this.isValid()) {
                                    return input != null ? this : NaN;
                                }
                            
                            
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 4 hrs to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1495..1510
                            core/static/vendor/moment/moment.js on lines 1501..1516

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

                            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

                            export function getSetLocaleDayOfWeek (input) {
                                if (!this.isValid()) {
                                    return input != null ? this : NaN;
                                }
                                var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 3 hrs to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1487..1493
                            core/static/vendor/moment/moment.js on lines 1493..1499

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                            export function localeWeekdays (m, format) {
                                if (!m) {
                                    return this._weekdays;
                                }
                                return isArray(this._weekdays) ? this._weekdays[m.day()] :
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 3 hrs to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1350..1356
                            core/static/vendor/moment/moment.js on lines 1356..1362

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

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

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

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

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

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 3 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 core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 2 hrs to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1307..1315
                            core/static/vendor/moment/moment.js on lines 1313..1321

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                            function parseWeekday(input, locale) {
                                if (typeof input !== 'string') {
                                    return input;
                                }
                            
                            
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 2 hrs to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1323..1338
                            core/static/vendor/moment/moment.js on lines 1329..1344

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                            function parseIsoWeekday(input, locale) {
                                if (typeof input === 'string') {
                                    return locale.weekdaysParse(input) % 7 || 7;
                                }
                                return isNaN(input) ? null : input;
                            Severity: Major
                            Found in core/static/vendor/moment/src/lib/units/day-of-week.js and 2 other locations - About 1 hr to fix
                            core/static/vendor/moment/min/moment-with-locales.js on lines 1340..1345
                            core/static/vendor/moment/moment.js on lines 1346..1351

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

                            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