valor-software/angular2-bootstrap

View on GitHub

Showing 272 of 791 total issues

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

  private autoPosition(
    targetElPosition: ClientRect,
    hostElPosition: ClientRect,
    targetElement: HTMLElement,
    preferredPosition?: string
Severity: Minor
Found in src/positioning/ng-positioning.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 hightlight has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  hightlight(match: TypeaheadMatch, query: any): string {
    let itemStr: string = match.value;
    let itemStrHelper: string = (this.parent && this.parent.typeaheadLatinize
      ? latinize(itemStr)
      : itemStr).toLowerCase();
Severity: Minor
Found in src/typeahead/typeahead-container.component.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 onItemDragover has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  onItemDragover(event: DragEvent, i: number): void {
    if (!this.transfer.getItem()) {
      return;
    }
    event.preventDefault();
Severity: Minor
Found in src/sortable/sortable.component.ts - About 1 hr to fix

    Function getControlsValue has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function getControlsValue(
      state: TimepickerComponentState
    ): TimepickerComponentState {
      const {
        hourStep,
    Severity: Minor
    Found in src/timepicker/timepicker-controls.util.ts - About 1 hr to fix

      Function hightlight has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        hightlight(match: TypeaheadMatch, query: any): string {
          let itemStr: string = match.value;
          let itemStrHelper: string = (this.parent && this.parent.typeaheadLatinize
            ? latinize(itemStr)
            : itemStr).toLowerCase();
      Severity: Minor
      Found in src/typeahead/typeahead-container.component.ts - About 1 hr to fix

        Function defineLocale has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function defineLocale(name: string, config?: LocaleData): Locale {
          if (config === null) {
            // useful for testing
            delete locales[name];
            globalLocale = getLocale('en');
        Severity: Minor
        Found in src/chronos/locale/locales.ts - About 1 hr to fix

          Function select has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            select(date: Date, isManual = true): void {
              if (this.datepickerMode === this.minMode) {
                if (!this.activeDate) {
                  this.activeDate = new Date(0, 0, 0, 0, 0, 0, 0);
                }
          Severity: Minor
          Found in src/datepicker/datepicker-inner.component.ts - About 1 hr to fix

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

            export function configFromStringAndArray(config: DateParsingConfig): DateParsingConfig {
              let tempConfig;
              let bestMoment;
              let scoreToBeat;
              let currentScore;
            Severity: Minor
            Found in src/chronos/create/from-string-and-array.ts - About 1 hr to fix

              Function startOf has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function startOf(date: Date, unit: UnitOfTime, isUTC?: boolean): Date {
                const _date = cloneDate(date);
                // the following switch intentionally omits break keywords
                // to utilize falling through the cases.
                switch (unit) {
              Severity: Minor
              Found in src/chronos/utils/start-end-of.ts - About 1 hr to fix

                Function autoPosition has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private autoPosition(
                    targetElPosition: ClientRect,
                    hostElPosition: ClientRect,
                    targetElement: HTMLElement,
                    preferredPosition?: string
                Severity: Minor
                Found in src/positioning/ng-positioning.ts - About 1 hr to fix

                  Function as has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    as(_units: string): number {
                      if (!this.isValid()) {
                        return NaN;
                      }
                      let days;
                  Severity: Minor
                  Found in src/chronos/duration/constructor.ts - About 1 hr to fix

                    Function setUTCOffset has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function setUTCOffset(date: Date, input: number | string, keepLocalTime?: boolean, keepMinutes?: boolean, config: DateParsingConfig = {}): Date {
                      const offset = config._offset || 0;
                      let localAdjust;
                      let _input = input;
                      let _date = date;
                    Severity: Minor
                    Found in src/chronos/units/offset.ts - About 1 hr to fix

                      Function ngOnInit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        ngOnInit(): void {
                          if (this.isAnimated) {
                            this._renderer.addClass(
                              this._element.nativeElement,
                              CLASS_NAME.FADE
                      Severity: Minor
                      Found in src/modal/modal-container.component.ts - About 1 hr to fix

                        Function visitMembers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          visitMembers(members) {
                            const inputs = [];
                            const outputs = [];
                            const methods = [];
                            const properties = [];
                        Severity: Minor
                        Found in scripts/docs/api-doc.js - About 1 hr to fix

                          Function isValid has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function isValid(config: DateParsingConfig): boolean {
                            if (config._isValid == null) {
                              const flags = getParsingFlags(config);
                              const parsedParts = Array.prototype.some.call(flags.parsedDateParts, function (i: number) {
                                return i != null;
                          Severity: Minor
                          Found in src/chronos/create/valid.ts - About 1 hr to fix

                            Function formatDaysCalendar has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function formatDaysCalendar(daysCalendar: DaysCalendarModel,
                                                               formatOptions: DatepickerFormatOptions,
                                                               monthIndex: number): DaysCalendarViewModel {
                              return {
                                month: daysCalendar.month,
                            Severity: Minor
                            Found in src/datepicker/engine/format-days-calendar.ts - About 1 hr to fix

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

                                show(): void {
                                  if (
                                    this.isOpen ||
                                    this.isDisabled ||
                                    this._delayTimeoutId ||
                              Severity: Minor
                              Found in src/tooltip/tooltip.directive.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 configFromStringAndArray has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function configFromStringAndArray(config: DateParsingConfig): DateParsingConfig {
                                let tempConfig;
                                let bestMoment;
                                let scoreToBeat;
                                let currentScore;
                              Severity: Minor
                              Found in src/chronos/create/from-string-and-array.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 ordinal has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                ordinal(num: number): string {
                                  const b = num % 10;
                                  const output =
                                    toInt((num % 100) / 10) === 1
                                      ? 'th'
                              Severity: Minor
                              Found in src/chronos/locale/locales.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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

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

                              Severity
                              Category
                              Status
                              Source
                              Language