multiplex/multiplex.js

View on GitHub

Showing 102 of 109 total issues

Function $iterator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function $iterator(obj) {
    // empty iteration
    if (obj === null || obj === undefined) {
        return new EmptyIterator();
    }
Severity: Minor
Found in src/lib/iteration/iterator-factory.js - About 45 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 buffer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function buffer(value, forceIterate) {
    if (!forceIterate) {
        if (isArrayLike(value)) {                      // array-likes have fixed element count
            return arrayBuffer(value);
        }
Severity: Minor
Found in src/lib/utils/buffer.js - About 45 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 binarySearch has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export default function binarySearch(array, index, length, value, compare) {
Severity: Minor
Found in src/lib/utils/binary-search.js - About 35 mins to fix

    Function join has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            join: function (inner, outerKeySelector, innerKeySelector, resultSelector, comparer) {
    Severity: Minor
    Found in src/lib/linq/_linq.js - About 35 mins to fix

      Function groupJoin has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              groupJoin: function (inner, outerKeySelector, innerKeySelector, resultSelector, comparer) {
      Severity: Minor
      Found in src/lib/linq/_linq.js - About 35 mins to fix

        Function OrderedIterable has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export default function OrderedIterable(source, keySelector, comparer, descending, parent) {
        Severity: Minor
        Found in src/lib/collections/ordered-iterable.js - About 35 mins to fix

          Function groupIterator has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          export default function groupIterator(source, keySelector, elementSelector, resultSelector, comparer) {
          Severity: Minor
          Found in src/lib/linq/group-by.js - About 35 mins to fix

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

            export default function isType(obj, type) {
                // use 'typeof' operator in an if clause yields in better performance than switch-case
            
                if (obj === null || obj === undefined) {
                    return false;
            Severity: Minor
            Found in src/lib/utils/is-type.js - 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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                remove: function (key) {
                    var comparer = this.comparer,
                        hash = comparer.hash(key) & 0x7FFFFFFF,     // hash-code of the key
                        bucket = hash % this.buckets.length,        // bucket index
                        last,
            Severity: Minor
            Found in src/lib/collections/hash-table.js - 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 removeAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                removeAll: function (match) {
                    assertType(match, Function);
            
                    var freeIndex = 0,
                        len = this.length;
            Severity: Minor
            Found in src/lib/collections/list.js - 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 sumIterator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function sumIterator(source, selector) {
                assertNotNull(source);
            
                if (selector) {
                    assertType(selector, Function);
            Severity: Minor
            Found in src/lib/linq/sum.js - 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 isSupersetOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                isSupersetOf: function (other) {
                    assertNotNull(other);
            
                    var c = collectionCount(other);
            
            
            Severity: Minor
            Found in src/lib/collections/hash-set.js - 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 res > 0 ? 1 : (res < 0 ? -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 new EnumerableIterator(obj);
              Severity: Major
              Found in src/lib/iteration/iterator-factory.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return new Iterable(value);
                Severity: Major
                Found in src/lib/iteration/iterable-factory.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

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

                    Avoid too many return statements within this function.
                    Open

                            return type === Boolean;
                    Severity: Major
                    Found in src/lib/utils/is-type.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return new Iterable(value);
                      Severity: Major
                      Found in src/lib/iteration/iterable-factory.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return computeObjectEquals(objA, objB);
                        Severity: Major
                        Found in src/lib/runtime/equals.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return false;
                          Severity: Major
                          Found in src/lib/runtime/equals.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language