swimlane/ngx-ui

View on GitHub

Showing 139 of 731 total issues

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

  ngOnChanges(changes: SimpleChanges) {
    if (changes.schema) {
      if (this.schema && this.schema.required) {
        for (const prop of this.schema.required) {
          this.requiredCache[prop] = true;

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

  focusNext() {
    const options = this.options;
    const len = options.length;
    if (this.focusIndex < len - 1) {
      for (let i = this.focusIndex + 1; i < len; i++) {

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

  adjustMenuDirection(event: {
    [InViewportMetadata]: { entry: IntersectionObserverEntry };
    target: HTMLElement;
    visible: boolean;
  }): void {

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

  set optionTemplates(val: QueryList<SelectOptionDirective>) {
    this._optionTemplates = val;

    if (val) {
      const arr = val.toArray();
Severity: Minor
Found in projects/swimlane/ngx-ui/src/lib/components/select/select.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 toggleDropdown has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  toggleDropdown(state: boolean): void {
    if (this.dropdownActive === state) return;

    this.dropdownActive = state;

Severity: Minor
Found in projects/swimlane/ngx-ui/src/lib/components/select/select.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

Avoid too many return statements within this function.
Open

          return DATE_DISPLAY_FORMATS.date;
Severity: Major
Found in projects/swimlane/ngx-ui/src/lib/utils/date-formats/default-formats.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return;
    Severity: Major
    Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return;
      Severity: Major
      Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return DATE_DISPLAY_FORMATS.dateTime;
        Severity: Major
        Found in projects/swimlane/ngx-ui/src/lib/utils/date-formats/default-formats.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return DATE_DISPLAY_FORMATS.dateTime;
          Severity: Major
          Found in projects/swimlane/ngx-ui/src/lib/utils/date-formats/default-formats.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                      return DATE_DISPLAY_FORMATS.date;
            Severity: Major
            Found in projects/swimlane/ngx-ui/src/lib/utils/date-formats/default-formats.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return;
              Severity: Major
              Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return;
                Severity: Major
                Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return placement;

                    Avoid too many return statements within this function.
                    Open

                          return;
                    Severity: Major
                    Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return el.parent().find('.radio-label--content').text().trim() || '';
                      Severity: Major
                      Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return undefined;

                          Avoid too many return statements within this function.
                          Open

                                return;
                          Severity: Major
                          Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return findInput(element).val();
                            Severity: Major
                            Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 30 mins to fix

                              Function increment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                private increment(): void {
                                  if (this.progress >= 100) return;
                              
                                  // inspired by angular-loading-bar
                                  // https://github.com/chieffancypants/angular-loading-bar
                              Severity: Minor
                              Found in projects/swimlane/ngx-ui/src/lib/components/loading/loading.service.ts - About 25 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