multiplex/multiplex.js

View on GitHub

Showing 109 of 109 total issues

Avoid too many return statements within this function.
Open

        return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
Severity: Major
Found in src/lib/runtime/compare.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return compute31BitObjecHash(obj, strict);
    Severity: Major
    Found in src/lib/runtime/hash.js - About 30 mins to fix

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

          setEquals: function (other) {
              assertNotNull(other);
      
              if (areEqualityComparersEqual(this, other)) {
                  if (this.count() !== other.count()) {
      Severity: Minor
      Found in src/lib/collections/hash-set.js - 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 entries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          entries: function (keysOnly) {
              var arr = new Array(this.count()),
                  slot = null,
                  index = 0;
      
      
      Severity: Minor
      Found in src/lib/collections/hash-table.js - 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 addLast has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          addLast: function (value) {
              var node;
      
              if (value instanceof LinkedListNode) {
                  node = value;
      Severity: Minor
      Found in src/lib/collections/linked-list.js - 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 from has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          from: function (value) {
              if (value === null || value === undefined || value === defaultComparer) {
                  return defaultComparer;
              }
      
      
      Severity: Minor
      Found in src/lib/collections/comparer.js - 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 Dictionary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function Dictionary(value, comparer) {
          var dic = isType(value, Dictionary) ? value : null,
              cmp = EqualityComparer.from(dic ? comparer : value),
              table = new HashTable(cmp, dic ? dic.count() : (isNumber(value) ? value : 0));
      
      
      Severity: Minor
      Found in src/lib/collections/dictionary.js - 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 addFirst has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          addFirst: function (value) {
              var node;
      
              if (value instanceof LinkedListNode) {
                  node = value;
      Severity: Minor
      Found in src/lib/collections/linked-list.js - 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 computeObjectEquals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function computeObjectEquals(objA, objB) {
          // Objects having different hash code are not equal
          // also prevents mutually recursive structures to stack overflow
          if (hash(objA) !== hash(objB)) {
              return false;
      Severity: Minor
      Found in src/lib/runtime/equals-object.js - 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