multiplex/multiplex.js

View on GitHub

Showing 102 of 109 total issues

Function iterableCount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function iterableCount(value, predicate) {
    var count = 0;

    if (!predicate) {
        count = collectionCount(value);
Severity: Minor
Found in src/lib/utils/count.js - About 1 hr 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 forOf has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function forOf(source, action) {
    var arr = asArray(source);

    // fast array iteration
    if (arr) {
Severity: Minor
Found in src/lib/utils/for-of.js - About 1 hr 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 quickSort has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    quickSort: function (map, left, right) {
        do {
            var i = left,
                j = right,
                x = map[i + ((j - i) >> 1)];
Severity: Minor
Found in src/lib/collections/ordered-iterable.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (
                (objA instanceof Date && objB instanceof Date) ||
                (objA instanceof Number && objB instanceof Number) ||
                (objA instanceof String && objB instanceof String) ||
                (objA instanceof Boolean && objB instanceof Boolean)) {
    Severity: Critical
    Found in src/lib/runtime/equals.js - About 1 hr to fix

      Function insert has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          insert: function (key, value, add) {
              var comparer = this.comparer,
                  hash = comparer.hash(key) & 0x7FFFFFFF,
                  bucket = hash % this.buckets.length,
                  slot = null,
      Severity: Minor
      Found in src/lib/collections/hash-table.js - About 1 hr to fix

        Function getGrouping has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            getGrouping: function (key, value, create) {
                var comparer = this.comparer,
                    hash = comparer.hash(key) & 0x7FFFFFFF,
                    bucket = hash % this.buckets.length,
                    index = this.buckets[bucket],
        Severity: Minor
        Found in src/lib/collections/lookup-table.js - About 1 hr 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 isArrayLike has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function isArrayLike(obj) {
            // - Array
            // - String
            //
            // - Typed arrays:
        Severity: Minor
        Found in src/lib/utils/is-array-like.js - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
        Open

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

        export default function singleOrDefaultIterator(source, predicate, defaultValue) {
            assertNotNull(source);
            predicate = predicate || trueFunction;
            assertType(predicate, Function);
        
        
        Severity: Minor
        Found in src/lib/linq/single-or-default.js - About 1 hr 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 linq has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function linq(iterable) {
            mixin(iterable, {
        
                /**
                * Returns an empty Iterable.
        Severity: Minor
        Found in src/lib/linq/_linq.js - About 1 hr 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 getGrouping has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            getGrouping: function (key, value, create) {
                var comparer = this.comparer,
                    hash = comparer.hash(key) & 0x7FFFFFFF,
                    bucket = hash % this.buckets.length,
                    index = this.buckets[bucket],
        Severity: Minor
        Found in src/lib/collections/lookup-table.js - About 1 hr to fix

          Function compute31BitNumberHash has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function compute31BitNumberHash(val) {
              var h = 0;
          
              // integer number
              if (val <= MAX_SAFE_INTEGER && val >= MIN_SAFE_INTEGER && val % 1 === 0) {
          Severity: Minor
          Found in src/lib/runtime/hash-number.js - About 1 hr to fix

            Function joinIterator has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function joinIterator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer) {
                assertNotNull(inner);
                assertType(outerKeySelector, Function);
                assertType(innerKeySelector, Function);
                assertType(resultSelector, Function);
            Severity: Minor
            Found in src/lib/linq/join.js - About 1 hr to fix

              Function selectManyIterator has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function selectManyIterator(source, collectionSelector, resultSelector) {
                  assertNotNull(source);
                  assertType(collectionSelector, Function);
                  if (resultSelector) {
                      assertType(resultSelector, Function);
              Severity: Minor
              Found in src/lib/linq/select-many.js - About 1 hr to fix

                Function singleOrDefaultIterator has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function singleOrDefaultIterator(source, predicate, defaultValue) {
                    assertNotNull(source);
                    predicate = predicate || trueFunction;
                    assertType(predicate, Function);
                
                
                Severity: Minor
                Found in src/lib/linq/single-or-default.js - About 1 hr to fix

                  Function hash has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function hash(obj, strict) {
                      // null/undefined hash is 0
                      if (obj === null || obj === undefined) {
                          return 0;
                      }
                  Severity: Minor
                  Found in src/lib/runtime/hash.js - About 1 hr to fix

                    Function equals has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function equals(objA, objB, strict) {
                        // Objects are identical
                        if (objA === objB) {
                            return true;
                        }
                    Severity: Minor
                    Found in src/lib/runtime/equals.js - About 1 hr to fix

                      Function insert has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          insert: function (key, value, add) {
                              var comparer = this.comparer,
                                  hash = comparer.hash(key) & 0x7FFFFFFF,
                                  bucket = hash % this.buckets.length,
                                  slot = null,
                      Severity: Minor
                      Found in src/lib/collections/hash-table.js - About 1 hr 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 compute31BitNumberHash has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function compute31BitNumberHash(val) {
                          var h = 0;
                      
                          // integer number
                          if (val <= MAX_SAFE_INTEGER && val >= MIN_SAFE_INTEGER && val % 1 === 0) {
                      Severity: Minor
                      Found in src/lib/runtime/hash-number.js - About 1 hr 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 elementAtIterator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function elementAtIterator(source, index) {
                          assertNotNull(source);
                          assertType(index, Number);
                      
                          if (index < 0) {
                      Severity: Minor
                      Found in src/lib/linq/element-at.js - About 1 hr 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