valor-software/angular2-bootstrap

View on GitHub

Showing 272 of 791 total issues

Function calculateReducer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function calculateReducer(state: BsDatepickerState): BsDatepickerState {
  // how many calendars
  const displayMonths = state.displayMonths;
  // use selected date on initial rendering if set
  let viewDate = state.view.date;
Severity: Minor
Found in src/datepicker/reducer/bs-datepicker.reducer.ts - About 1 hr to fix

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

      protected showBackdrop(callback?: Function): void {
        if (
          this._isShown &&
          this.config.backdrop &&
          (!this.backdrop || !this.backdrop.instance.isShown)
    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 setEventHandlers has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      setEventHandlers(container: BsDatepickerAbstractComponent): BsDatepickerEffects {
        container.setViewMode = (event: BsDatepickerViewMode): void => {
          this._store.dispatch(this._actions.changeViewMode(event));
        };
    
    
    Severity: Minor
    Found in src/datepicker/reducer/bs-datepicker.effects.ts - About 1 hr to fix

      Function show has 42 lines of code (exceeds 25 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

        Function visitClassDeclaration has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          visitClassDeclaration(fileName, classDeclaration) {
            const symbol = this.program.getTypeChecker().getSymbolAtLocation(classDeclaration.name);
            const description = getDescription(symbol);
            const className = classDeclaration.name.text;
            let directiveInfo, members;
        Severity: Minor
        Found in scripts/docs/api-doc.js - About 1 hr to fix

          Function show has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            show(): void {
              if (this.isOpen || this.isDisabled) {
                return;
              }
          
          
          Severity: Minor
          Found in src/dropdown/bs-dropdown.directive.ts - About 1 hr to fix

            Function dayOfYearFromWeekInfo has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function dayOfYearFromWeekInfo(config: DateParsingConfig): DateParsingConfig {
              let w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
            
              w = config._w;
              if (w.GG != null || w.W != null || w.E != null) {
            Severity: Minor
            Found in src/chronos/create/from-array.ts - About 1 hr to fix

              Function show has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                show(opts: {
                  content?: string | TemplateRef<any>;
                  context?: any;
                  initialState?: any; [key: string]: any;
                } = {}
              Severity: Minor
              Found in src/component-loader/component-loader.class.ts - About 1 hr to fix

                Function diff has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function diff(date: Date, input: Date,
                                     units: UnitOfTime, asFloat: boolean,
                                     config: DateParsingConfig = {}
                                     ): number {
                  if (!isDateValid(date)) {
                Severity: Minor
                Found in src/chronos/moment/diff.ts - About 1 hr to fix

                  Function getPages has a Cognitive Complexity of 13 (exceeds 5 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

                  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 getPages has a Cognitive Complexity of 13 (exceeds 5 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

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

                    private findNextSlideIndex(direction: Direction, force: boolean): number {
                      let nextSlideIndex = 0;
                  
                      if (
                        !force &&
                  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 formatReducer has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function formatReducer(state: BsDatepickerState,
                                         action: Action): BsDatepickerState {
                    if (state.view.mode === 'day') {
                      const formattedMonths = state.monthsModel.map((month, monthIndex) =>
                        formatDaysCalendar(month, getFormatOptions(state), monthIndex)
                  Severity: Minor
                  Found in src/datepicker/reducer/bs-datepicker.reducer.ts - About 1 hr to fix

                    Function position has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public position(element: HTMLElement, round = true): ClientRect {
                        let elPosition: ClientRect;
                        let parentOffset: ClientRect = {
                          width: 0,
                          height: 0,
                    Severity: Minor
                    Found in src/positioning/ng-positioning.ts - About 1 hr to fix

                      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 showBackdrop has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          protected showBackdrop(callback?: Function): void {
                            if (
                              this._isShown &&
                              this.config.backdrop &&
                              (!this.backdrop || !this.backdrop.instance.isShown)
                        Severity: Minor
                        Found in src/modal/modal.directive.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 chooseLocale has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function chooseLocale(names: string[]): Locale {
                              let next;
                              let locale;
                              let i = 0;
                            
                            
                            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 setUTCOffset has a Cognitive Complexity of 12 (exceeds 5 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

                            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