valor-software/angular2-bootstrap

View on GitHub

Showing 272 of 791 total issues

Avoid too many return statements within this function.
Open

    return new ContentRef([[this._renderer.createText(`${content}`)]]);
Severity: Major
Found in src/component-loader/component-loader.class.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return result + 'měsíci';
    Severity: Major
    Found in src/chronos/i18n/cs.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return 'रात';
      Severity: Major
      Found in src/chronos/i18n/hi.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return '晚上';
        Severity: Major
        Found in src/chronos/i18n/zh-cn.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return result + (plural(num) ? 'měsíce' : 'měsíců');
          Severity: Major
          Found in src/chronos/i18n/cs.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return null;
            Severity: Major
            Found in src/positioning/ng-positioning.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return result;
              Severity: Major
              Found in src/chronos/i18n/sl.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return result + (plural(num) ? 'dny' : 'dní');
                Severity: Major
                Found in src/chronos/i18n/cs.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return result + 'lety';
                  Severity: Major
                  Found in src/chronos/i18n/cs.ts - About 30 mins to fix

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

                      set isShown(value: boolean) {
                        this._isShown = value;
                        if (value) {
                          this.renderer.addClass(
                            this.element.nativeElement,
                    Severity: Minor
                    Found in src/modal/modal-backdrop.component.ts - 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

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

                    export function configFromString(config: DateParsingConfig): DateParsingConfig {
                      if (!isString(config._i)) {
                        return config;
                      }
                    
                    
                    Severity: Minor
                    Found in src/chronos/create/from-string.ts - 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

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

                      show(): void {
                        this.dismissReason = null;
                        this.onShow.emit(this);
                        if (this._isShown) {
                          return;
                    Severity: Minor
                    Found in src/modal/modal.directive.ts - 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

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

                    export function getSetGlobalLocale(key?: string | string[], values?: LocaleData): string {
                      let data: Locale;
                    
                      if (key) {
                        if (isUndefined(values)) {
                    Severity: Minor
                    Found in src/chronos/locale/locales.ts - 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

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

                      protected compareDateDisabled(
                        date1Disabled: { date: Date; mode: string },
                        date2: Date
                      ): number {
                        if (date1Disabled === undefined || date2 === undefined) {
                    Severity: Minor
                    Found in src/datepicker/datepicker-inner.component.ts - 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

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

                      _showBackdrop(): void {
                        const isBackdropEnabled =
                          this.config.backdrop || this.config.backdrop === 'static';
                        const isBackdropInDOM =
                          !this.backdropRef || !this.backdropRef.instance.isShown;
                    Severity: Minor
                    Found in src/modal/bs-modal.service.ts - 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

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

                      compare(date1: Date, date2: Date): number | undefined {
                        if (date1 === undefined || date2 === undefined) {
                          return undefined;
                        }
                    
                    
                    Severity: Minor
                    Found in src/datepicker/datepicker-inner.component.ts - 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

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

                      private _renderTime(value: string | Date): void {
                        if (!isValidDate(value)) {
                          this.hours = '';
                          this.minutes = '';
                          this.seconds = '';
                    Severity: Minor
                    Found in src/timepicker/timepicker.component.ts - 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

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

                      validate(c: AbstractControl): ValidationErrors | null {
                        const _value: [Date, Date] = c.value;
                    
                        if (_value === null || _value === undefined || !isArray(_value)) {
                          return null;
                    Severity: Minor
                    Found in src/datepicker/bs-daterangepicker-input.directive.ts - 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

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

                      protected isDisabled(date: Date): boolean {
                        let isDateDisabled = false;
                        if (this.dateDisabled) {
                          this.dateDisabled.forEach(
                            (disabledDate: { date: Date; mode: string }) => {
                    Severity: Minor
                    Found in src/datepicker/datepicker-inner.component.ts - 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

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

                    function plural(word, num) {
                      let forms = word.split('_');
                      return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
                    }
                    Severity: Minor
                    Found in src/chronos/i18n/uk.ts - 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

                    Severity
                    Category
                    Status
                    Source
                    Language