swimlane/ngx-ui

View on GitHub

Showing 731 of 731 total issues

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

  minuteChanged(newVal: number, type: string) {
    if (type === 'start') {
      if (this.range.startDate) this.range.startDate.setMinutes(newVal);
      this.startMinute = newVal;
    } else {

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 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

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

  onInputKeyUp(event: KeyboardEvent): void {
    event.stopPropagation();

    const value = (event.target as any).value;

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

  onClick(msg: string, targetId?: string, successProbability = 0.5) {
    this.onBtnClick(msg);

    const buttonPromise = new Promise((resolve, reject) => {
      setTimeout(() => {
Severity: Minor
Found in src/app/components/button-group-page/button-group-page.component.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

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

  private focusIn(dir: 1 | -1) {
    if (!this.disabled && this._radios) {
      const len = this._radios.length;
      for (let i = 1; i < len; i++) {
        const ii = mod(this.focusIndex + dir * i, len);

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

export const determinePlacement = (
  placement: PlacementTypes,
  elmDim: Dimensions,
  hostDim: Dimensions,
  spacing: number,

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

  focusPrev() {
    const options = this.options;
    if (this.focusIndex > 0) {
      for (let i = this.focusIndex - 1; i >= 0; i--) {
        if (!options[i].disabled && !options[i].hidden) {

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

export function iff(
  element: JQuery<HTMLElement>,
  selector: string,
  fn: (currentSubject: JQuery<any>) => void
): Cypress.Chainable<JQuery<Element>> {
Severity: Minor
Found in projects/swimlane/ngx-ui-testing/src/functions.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

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

  position(): void {
    const nativeElm = this.element.nativeElement;
    if (this.hostElement) {
      const hostDim = this.hostElement.getBoundingClientRect();

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

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

  @HostBinding('class.ng-dirty')
  get focusedOrDirty(): any {
    if (this.focused) {
      return true;
    }
Severity: Minor
Found in projects/swimlane/ngx-ui/src/lib/components/input/input.component.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

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

export function getMinMaxPct(
  minBasis: string,
  maxBasis: string,
  grow: string,
  shrink: string,

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