valor-software/angular2-bootstrap

View on GitHub

Showing 272 of 791 total issues

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

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

export function updateLocale(name: string, config?: LocaleData): Locale {
  let _config = config;

  if (_config != null) {
    let parentConfig = baseConfig;
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 defineLocale has a Cognitive Complexity of 10 (exceeds 5 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

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

export function isDurationValid(duration: Partial<DateObject>): boolean {
  const durationKeys = Object.keys(duration);
  if (durationKeys
      .some((key: keyof DateObject) => {
        return (key in orderingHash)
Severity: Minor
Found in src/chronos/duration/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 prepareConfig has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function prepareConfig(config: DateParsingConfig): DateParsingConfig {
  let input = config._i;
  const format = config._f;

  config._locale = config._locale || getLocale(config._l);
Severity: Minor
Found in src/chronos/create/from-anything.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 num = Number(_num);
    let b = num % 10,
      output = (~~(num % 100 / 10) === 1) ? 'e' :
        (b === 1) ? 'a' :
Severity: Minor
Found in src/chronos/i18n/sv.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 show has a Cognitive Complexity of 10 (exceeds 5 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

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 num = Number(_num);
    const b = num % 10,
      output = (~~(num % 100 / 10) === 1) ? 'th' :
        (b === 1) ? 'st' :
Severity: Minor
Found in src/chronos/i18n/en-gb.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 configFromInput has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function configFromInput(config: DateParsingConfig): DateParsingConfig {
  const input = config._i;
  if (isUndefined(input)) {
    config._d = new Date();
  } else if (isDate(input)) {
Severity: Minor
Found in src/chronos/create/from-anything.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 27 lines of code (exceeds 25 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

    Function bubble has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function bubble(dur: Duration): Duration {
      let milliseconds = dur._milliseconds;
      let days = dur._days;
      let months = dur._months;
      const data = dur._data;
    Severity: Minor
    Found in src/chronos/duration/bubble.ts - About 1 hr to fix

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

      function translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {
        switch (key) {
          case 's':
            return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
          case 'ss':
      Severity: Minor
      Found in src/chronos/i18n/hu.ts - About 1 hr to fix

        Function ngOnInit has 26 lines of code (exceeds 25 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/pagination.component.ts - About 1 hr to fix

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

            Function ngOnInit has 26 lines of code (exceeds 25 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 1 hr to fix

              Function computeMonthsParse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private computeMonthsParse() {
                  const shortPieces: string[] = [];
                  const longPieces: string[] = [];
                  const mixedPieces: string[] = [];
                  let date;
              Severity: Minor
              Found in src/chronos/locale/locale.class.ts - About 1 hr to fix

                Function listenToTriggersV2 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function listenToTriggersV2(renderer: Renderer2,
                                                   options: ListenOptions): Function {
                  const parsedTriggers = parseTriggers(options.triggers);
                  const target = options.target;
                  // do nothing
                Severity: Minor
                Found in src/utils/triggers.ts - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if (
                          day.isOtherMonth !== newDay.isOtherMonth ||
                          day.isHovered !== newDay.isHovered ||
                          day.isSelected !== newDay.isSelected ||
                          day.isSelectionStart !== newDay.isSelectionStart ||
                  Severity: Major
                  Found in src/datepicker/engine/flag-days-calendar.ts - About 1 hr to fix

                    Function constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      constructor(
                        private _state: BsDropdownState,
                        private cd: ChangeDetectorRef,
                        private _renderer: Renderer2,
                        _element: ElementRef
                    Severity: Minor
                    Found in src/dropdown/bs-dropdown-container.component.ts - About 55 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 calculateReducer has a Cognitive Complexity of 9 (exceeds 5 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 55 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