valor-software/angular2-bootstrap

View on GitHub

Showing 272 of 791 total issues

Function flagMonthsCalendar has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function flagMonthsCalendar(
  monthCalendar: MonthsCalendarViewModel,
  options: FlagMonthCalendarOptions
): MonthsCalendarViewModel {
  monthCalendar.months.forEach(
Severity: Minor
Found in src/datepicker/engine/flag-months-calendar.ts - About 1 hr to fix

    Function prepareMatches has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      protected prepareMatches(options: any[]): void {
        const limited: any[] = options.slice(0, this.typeaheadOptionsLimit);
    
        if (this.typeaheadGroupField) {
          let matches: TypeaheadMatch[] = [];
    Severity: Minor
    Found in src/typeahead/typeahead.directive.ts - About 1 hr to fix

      Function getPages has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        protected getPages(currentPage: number, totalPages: number): any[] {
          const pages: any[] = [];
      
          // Default page limits
          let startPage = 1;
      Severity: Minor
      Found in src/pagination/pager.component.ts - About 1 hr to fix

        Function getPages has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          protected getPages(currentPage: number, totalPages: number): any[] {
            const pages: any[] = [];
        
            // Default page limits
            let startPage = 1;
        Severity: Minor
        Found in src/pagination/pagination.component.ts - About 1 hr to fix

          Function flagYearsCalendar has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function flagYearsCalendar(
            yearsCalendar: YearsCalendarViewModel,
            options: FlagYearsCalendarOptions
          ): YearsCalendarViewModel {
            yearsCalendar.years.forEach(
          Severity: Minor
          Found in src/datepicker/engine/flag-years-calendar.ts - About 1 hr to fix

            Function translate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {
              var result = '';
              switch (key) {
                case 's':
                  return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
            Severity: Minor
            Found in src/chronos/i18n/fi.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 show has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    show(): void {
                      this._typeahead
                        .attach(TypeaheadContainerComponent)
                        // todo: add append to body, after updating positioning service
                        .to(this.container)
                  Severity: Minor
                  Found in src/typeahead/typeahead.directive.ts - About 1 hr to fix

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

                      private _getContentRef(
                        content: string | TemplateRef<any> | any,
                        context?: any,
                        initialState?: any
                      ): ContentRef {
                    Severity: Minor
                    Found in src/component-loader/component-loader.class.ts - About 1 hr to fix

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

                        openModal(template: TemplateRef<any>) {
                          this.messages = [];
                      
                          const _combine = Observable.combineLatest(
                            this.modalService.onShow,

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

                          add(value: T, position: number = this.length): void {
                            if (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 1 hr to fix

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

                            writeValue(value: Date[] | string) {
                              if (!value) {
                                this._value = null;
                              } else {
                                const _localeKey = this._localeService.currentLocale;
                          Severity: Minor
                          Found in src/datepicker/bs-daterangepicker-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

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

                            removeSlide(slide: SlideComponent): void {
                              const remIndex = this._slides.indexOf(slide);
                          
                              if (this._currentActiveSlide === remIndex) {
                                // removing of active slide
                          Severity: Minor
                          Found in src/carousel/carousel.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 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 isValid has a Cognitive Complexity of 11 (exceeds 5 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

                          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 showElement has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            protected showElement(): void {
                              // todo: replace this with component loader usage
                              if (
                                !this._element.nativeElement.parentNode ||
                                this._element.nativeElement.parentNode.nodeType !== Node.ELEMENT_NODE
                          Severity: Minor
                          Found in src/modal/modal.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 mergeConfigs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function mergeConfigs(parentConfig: LocaleData,
                                                       childConfig: LocaleData) {
                            const res: LocaleData = Object.assign({}, parentConfig);
                          
                            for (const childProp in childConfig) {
                          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 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 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

                          Severity
                          Category
                          Status
                          Source
                          Language