valor-software/angular2-bootstrap

View on GitHub

Showing 272 of 791 total issues

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

  ngOnInit(): void {
    if (typeof window !== 'undefined') {
      this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';
    }
    // watch for maxSize
Severity: Minor
Found in src/pagination/pager.component.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 positionElements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  public positionElements(
    hostElement: HTMLElement,
    targetElement: HTMLElement,
    placement: string,
    appendToBody?: boolean
Severity: Minor
Found in src/positioning/ng-positioning.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 getValueFromObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function getValueFromObject(object: any, option: string): string {
  if (!option || typeof object !== 'object') {
    return object.toString();
  }

Severity: Minor
Found in src/typeahead/typeahead-utils.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 calendar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function calendar(date: Date,
                         time: Date,
                         formats: CalendarSpec,
                         locale: Locale = getLocale(),
                         config: DateParsingConfig = {}): string {
Severity: Minor
Found in src/chronos/moment/calendar.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 ordinal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  ordinal(_num: number, period: string): string {
    const num = Number(_num);
    switch (period) {
      // TODO: Return 'e' when day of month > 1. Move this case inside
      // block for masculine words below.
Severity: Minor
Found in src/chronos/i18n/fr.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 finalizeAsyncCall has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  protected finalizeAsyncCall(matches: any[]): void {
    this.prepareMatches(matches);

    this.typeaheadLoading.emit(false);
    this.typeaheadNoResults.emit(!this.hasMatches());
Severity: Minor
Found in src/typeahead/typeahead.directive.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 nextWeek has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    nextWeek(date: Date, now: Date) {
      if (getWeek(now) !== getWeek(date)) {
        switch (getDayOfWeek(date)) {
          case 0:
            return '[В следующее] dddd [в] LT';
Severity: Minor
Found in src/chronos/i18n/ru.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 lastWeek has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    lastWeek(date: Date, now: Date) {
      if (getWeek(now) !== getWeek(date)) {
        switch (getDayOfWeek(date)) {
          case 0:
            return '[В прошлое] dddd [в] LT';
Severity: Minor
Found in src/chronos/i18n/ru.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 meridiemHour has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  meridiemHour(hour, meridiem) {
    if (hour === 12) {
      hour = 0;
    }
    if (meridiem === 'pagi') {
Severity: Minor
Found in src/chronos/i18n/id.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 active has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  set active(active: boolean) {
    if (this._active === active) {
      return;
    }
    if ((this.disabled && active) || !active) {
Severity: Minor
Found in src/tabs/tab.directive.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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  remove(position = 0): void {
    if (this.length === 0 || position < 0 || position >= this.length) {
      throw new Error('Position is out of the list');
    }

Severity: Minor
Found in src/utils/linked-list.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 listen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  listen(listenOpts: ListenOptions): ComponentLoader<T> {
    this.triggers = listenOpts.triggers || this.triggers;
    this._listenOpts.outsideClick = listenOpts.outsideClick;
    listenOpts.target = listenOpts.target || this._elementRef.nativeElement;

Severity: Minor
Found in src/component-loader/component-loader.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 Object.assign({}, state, newState);
Severity: Major
Found in src/datepicker/reducer/bs-datepicker.reducer.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return Object.assign({}, state, newState);
    Severity: Major
    Found in src/datepicker/reducer/bs-datepicker.reducer.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 state;
        Severity: Major
        Found in src/timepicker/reducer/timepicker.reducer.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return Object.assign({}, state, { value: _newTime });
          Severity: Major
          Found in src/timepicker/reducer/timepicker.reducer.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return undefined;
            Severity: Major
            Found in src/datepicker/datepicker-inner.component.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
                  Severity
                  Category
                  Status
                  Source
                  Language