valor-software/angular2-bootstrap

View on GitHub
src/chronos/locale/locale.class.ts

Summary

Maintainability
F
1 wk
Test Coverage

File locale.class.ts has 591 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// tslint:disable:max-file-line-count max-line-length cyclomatic-complexity

import { weekOfYear } from '../units/week-calendar-utils';
import { hasOwnProp, isArray, isFunction } from '../utils/type-checks';
import { getDay, getMonth } from '../utils/date-getters';
Severity: Major
Found in src/chronos/locale/locale.class.ts - About 1 day to fix

    Function handleWeekStrictParse has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

      private handleWeekStrictParse(weekdayName: string, format: string, strict: boolean): number {
        let ii;
        const llc = weekdayName.toLocaleLowerCase();
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
    Severity: Minor
    Found in src/chronos/locale/locale.class.ts - 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

    Locale has 33 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Locale {
      parentLocale?: Locale;
      _abbr: string;
      _config: LocaleData;
      meridiemHour: (hour: number, meridiem: string) => number;
    Severity: Minor
    Found in src/chronos/locale/locale.class.ts - About 4 hrs to fix

      Function handleWeekStrictParse has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private handleWeekStrictParse(weekdayName: string, format: string, strict: boolean): number {
          let ii;
          const llc = weekdayName.toLocaleLowerCase();
          if (!this._weekdaysParse) {
            this._weekdaysParse = [];
      Severity: Major
      Found in src/chronos/locale/locale.class.ts - About 2 hrs to fix

        Function handleMonthStrictParse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

          private handleMonthStrictParse(monthName: string, format: string, strict?: boolean) {
            const llc = monthName.toLocaleLowerCase();
            let i;
            let ii;
            let mom;
        Severity: Minor
        Found in src/chronos/locale/locale.class.ts - About 2 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

        Function weekdaysParse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

          weekdaysParse(weekdayName?: string, format?: string, strict?: boolean): number {
            let i;
            let regex;
        
            if (this._weekdaysParseExact) {
        Severity: Minor
        Found in src/chronos/locale/locale.class.ts - About 2 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

        Function monthsParse has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          monthsParse(monthName: string, format?: string, strict?: boolean): number {
            let date;
            let regex;
        
            if (this._monthsParseExact) {
        Severity: Minor
        Found in src/chronos/locale/locale.class.ts - 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 weekdaysParse has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          weekdaysParse(weekdayName?: string, format?: string, strict?: boolean): number {
            let i;
            let regex;
        
            if (this._weekdaysParseExact) {
        Severity: Minor
        Found in src/chronos/locale/locale.class.ts - About 1 hr to fix

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

            private handleMonthStrictParse(monthName: string, format: string, strict?: boolean) {
              const llc = monthName.toLocaleLowerCase();
              let i;
              let ii;
              let mom;
          Severity: Minor
          Found in src/chronos/locale/locale.class.ts - About 1 hr to fix

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

              monthsParse(monthName: string, format?: string, strict?: boolean): number {
                let date;
                let regex;
            
                if (this._monthsParseExact) {
            Severity: Minor
            Found in src/chronos/locale/locale.class.ts - About 1 hr to fix

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

                private computeWeekdaysParse() {
                  const minPieces = [];
                  const shortPieces = [];
                  const longPieces = [];
                  const mixedPieces = [];
              Severity: Minor
              Found in src/chronos/locale/locale.class.ts - About 1 hr to fix

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

                  weekdaysRegex(isStrict: boolean) {
                    if (this._weekdaysParseExact) {
                      if (!hasOwnProp(this, '_weekdaysRegex')) {
                        this.computeWeekdaysParse();
                      }
                Severity: Minor
                Found in src/chronos/locale/locale.class.ts - 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

                  weekdaysShortRegex(isStrict?: boolean): RegExp {
                    if (this._weekdaysParseExact) {
                      if (!hasOwnProp(this, '_weekdaysRegex')) {
                        this.computeWeekdaysParse();
                      }
                Severity: Minor
                Found in src/chronos/locale/locale.class.ts - 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 weekdaysMinRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  weekdaysMinRegex(isStrict?: boolean): RegExp {
                    if (this._weekdaysParseExact) {
                      if (!hasOwnProp(this, '_weekdaysRegex')) {
                        this.computeWeekdaysParse();
                      }
                Severity: Minor
                Found in src/chronos/locale/locale.class.ts - 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 computeMonthsParse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private computeMonthsParse() {
                    const shortPieces: string[] = [];
                    const longPieces: string[] = [];
                    const mixedPieces: string[] = [];
                    let date;
                Severity: Minor
                Found in src/chronos/locale/locale.class.ts - About 1 hr to fix

                  Function monthsShortRegex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    monthsShortRegex(isStrict: boolean): RegExp {
                      if (this._monthsParseExact) {
                        if (!hasOwnProp(this, '_monthsRegex')) {
                          this.computeMonthsParse();
                        }
                  Severity: Minor
                  Found in src/chronos/locale/locale.class.ts - About 35 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

                  Function monthsRegex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    monthsRegex(isStrict: boolean): RegExp {
                      if (this._monthsParseExact) {
                        if (!hasOwnProp(this, '_monthsRegex')) {
                          this.computeMonthsParse();
                        }
                  Severity: Minor
                  Found in src/chronos/locale/locale.class.ts - About 35 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 src/chronos/locale/locale.class.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return ii;
                    Severity: Major
                    Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                return ii;
                      Severity: Major
                      Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return ii !== -1 ? ii : null;
                        Severity: Major
                        Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                    return ii;
                          Severity: Major
                          Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return i;
                            Severity: Major
                            Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return ii;
                              Severity: Major
                              Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                          return ii;
                                Severity: Major
                                Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return i;
                                  Severity: Major
                                  Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return ii !== -1 ? ii : null;
                                    Severity: Major
                                    Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                          return ii !== -1 ? ii : null;
                                      Severity: Major
                                      Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return ii !== -1 ? ii : null;
                                        Severity: Major
                                        Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                    return ii;
                                          Severity: Major
                                          Found in src/chronos/locale/locale.class.ts - About 30 mins to fix

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

                                              weekdaysRegex(isStrict: boolean) {
                                                if (this._weekdaysParseExact) {
                                                  if (!hasOwnProp(this, '_weekdaysRegex')) {
                                                    this.computeWeekdaysParse();
                                                  }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 2 other locations - About 4 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 465..483
                                            src/chronos/locale/locale.class.ts on lines 485..503

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

                                            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

                                              weekdaysShortRegex(isStrict?: boolean): RegExp {
                                                if (this._weekdaysParseExact) {
                                                  if (!hasOwnProp(this, '_weekdaysRegex')) {
                                                    this.computeWeekdaysParse();
                                                  }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 2 other locations - About 4 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 440..459
                                            src/chronos/locale/locale.class.ts on lines 485..503

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

                                            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

                                              weekdaysMinRegex(isStrict?: boolean): RegExp {
                                                if (this._weekdaysParseExact) {
                                                  if (!hasOwnProp(this, '_weekdaysRegex')) {
                                                    this.computeWeekdaysParse();
                                                  }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 2 other locations - About 4 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 440..459
                                            src/chronos/locale/locale.class.ts on lines 465..483

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

                                            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

                                              monthsShortRegex(isStrict: boolean): RegExp {
                                                if (this._monthsParseExact) {
                                                  if (!hasOwnProp(this, '_monthsRegex')) {
                                                    this.computeMonthsParse();
                                                  }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 3 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 303..321

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

                                            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

                                              monthsRegex(isStrict: boolean): RegExp {
                                                if (this._monthsParseExact) {
                                                  if (!hasOwnProp(this, '_monthsRegex')) {
                                                    this.computeMonthsParse();
                                                  }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 3 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 323..340

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

                                            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 = this._weekdaysParse.indexOf(llc);
                                                    if (ii !== -1) {
                                                      return ii;
                                                    }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 3 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 635..659

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

                                            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 = this._shortWeekdaysParse.indexOf(llc);
                                                    if (ii !== -1) {
                                                      return ii;
                                                    }
                                            Severity: Major
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 3 hrs to fix
                                            src/chronos/locale/locale.class.ts on lines 623..659

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

                                            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

                                            export const defaultLongDateFormat: { [index: string]: string } = {
                                              LTS: 'h:mm:ss A',
                                              LT: 'h:mm A',
                                              L: 'MM/DD/YYYY',
                                              LL: 'MMMM D, YYYY',
                                            Severity: Minor
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 55 mins to fix
                                            src/chronos/i18n/ro.ts on lines 14..21

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 54.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                    this._shortWeekdaysParse[i] = new RegExp(`^${this.weekdaysShort(date).replace('.', '\.?')}$`, 'i');
                                            Severity: Minor
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 35 mins to fix
                                            src/chronos/locale/locale.class.ts on lines 412..412

                                            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

                                                    this._minWeekdaysParse[i] = new RegExp(`^${this.weekdaysMin(date).replace('.', '\.?')}$`, 'i');
                                            Severity: Minor
                                            Found in src/chronos/locale/locale.class.ts and 1 other location - About 35 mins to fix
                                            src/chronos/locale/locale.class.ts on lines 411..411

                                            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

                                            There are no issues that match your filters.

                                            Category
                                            Status