valor-software/ng2-select

View on GitHub

Showing 28 of 28 total issues

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

  private mainClick(e:any) {
    if (this.inputMode === true || this._disabled === true) {
      return;
    }

Severity: Minor
Found in components/select/select.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;
Severity: Major
Found in components/select/select.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return;
    Severity: Major
    Found in components/select/select.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return;
      Severity: Major
      Found in components/select/select.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return;
        Severity: Major
        Found in components/select/select.ts - About 30 mins to fix

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

            public ensureHighlightVisible(optionsMap:Map<string, number> = null) {
              let container = this.actor.element.nativeElement.querySelector('.ui-select-choices-content');
          
              if (!container) {
                return;
          Severity: Minor
          Found in components/select/select.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 selectMatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            private selectMatch(value:SelectItem, e:Event = null) {
              if (e) {
                e.stopPropagation();
                e.preventDefault();
              }
          Severity: Minor
          Found in components/select/select.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor(source:any) {
              if (typeof source === 'string') {
                this.id = this.text = source;
              }
          
          
          Severity: Minor
          Found in components/select/select-item.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